简体   繁体   English

从数据库检索

[英]Retrieving from database

I have a pre registering system with these tables: 我有这些表的预注册系统:

  1. StudentInfo 学生信息
  2. Courses 课程
  3. Departments 部门
  4. SystemAdmin 系统管理员
  5. RegisteredCoursesCompletely 完全注册课程
  6. RegisteredCoursesIncomplete 注册课程不完整

After creating a login using a stored procedure I need to show the courses that are related to a particular dep id . 使用存储过程创建登录后,我需要显示与特定部门dep id相关的课程。 I did it. 我做的。 After that I needed students to be able to choose every course and then add it to a table and this is where the problems began... 之后,我需要学生能够选择每门课程,然后将其添加到表格中,这就是问题开始的地方...

I have two kinds of buttons. 我有两种按钮。 One of them is Registered Completely it means user never can go back and changes the courses (I did it) but the second one is Registered Incompletely it means user can go back and see what he/she chose and then uncheck it or check something else. 其中一个Registered Completely这意味着用户永远无法返回并更改课程(我做到了),但是第二个已Registered Incompletely这意味着用户可以返回并查看他/她选择的内容,然后取消选中它或检查其他内容。

---> I want to do this in this way if he/she go back I want to show them all courses that related to them with courses that they chose before I mean the checkbox that consisted of data that user checked in the first time. --->如果他/她回去,我想以这种方式执行此操作。我想向他们显示与他们相关的所有课程以及他们选择的课程,我的意思是包含用户首次检查的数据的复选框。 Also show courses that not have been checked yet. 还显示尚未检查的课程。 All of them in a one grid view. 所有这些都在一个网格视图中。

Please help me. 请帮我。 I do everything that my lecture needs but this part that i try to solve it is a little tricky. 我做了我的演讲所需要的一切,但是我试图解决的这一部分有些棘手。 I used to session and then save the index of the grid view that user checked and then insert it to database but you know more than 20 units user can choose and how do it please explain it with complete code. 我曾经进行会话,然后保存用户检查的网格视图的索引,然后将其插入数据库,但是您知道用户可以选择20多个单位,并且如何操作,请用完整的代码进行解释。

in Registered Incompletely scenario you need to save selected courses, user and flag with Registered Incompletely . 在“ Registered Incompletely方案中,您需要保存选定的课程,用户并使用“ Registered Incompletely标记。 Then any time same user logged in or go back you can load all the courses and mark the selected courses based on previous saved data. 然后,同一位用户每次登录或返回时,您都可以加载所有课程并根据以前保存的数据标记所选课程。 if user is Registered Completely then you can save Registered Completely flag and user details in the database. 如果用户已Registered Completely则可以在数据库中保存“ Registered Completely标志和用户详细信息。

Edit: 编辑:

students and registration complete status need to saved on database, here you can have Boolean value for that. 学生和注册完成状态需要保存在数据库中,在这里您可以拥有布尔值。 true for complete, false for incomplete. 完整则为true,不完整则为false。 if you have several pages to select courses, then in each page when you move next, save current courses selection in the database. 如果您有多个页面来选择课程,则在下一步中在每个页面中,将当前课程选择保存在数据库中。 it can be used when you want. 可以在需要时使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM