public Form_ScheduleStudent(User u) { InitializeComponent(); dal = new DbContextDal(); //Receives a staff member indicating what authorization is, to know what actions are allowed user = u; if (user != null) { if (user.permission.Equals("Secretary")) { secretary = dal.secretaries.Find(user.ID); } else if (user.permission.Equals("Admin")) { admin = dal.admins.Find(user.ID); } else if (user.permission.Equals("Student")) { student = dal.students.Find(user.ID); selected_student = student; if (student == null) { return; } txt_CB_students.Text = "S" + student.ID.ToString() + " : " + student.Name; txt_CB_students.Enabled = false; txt_CB_courses.Enabled = true; handlerShowCoursesStudent(); } else { MessageBox.Show("Error: Could not identify user details! (Only Secretary / Admin can enter to here)"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } checkBox_onlyPractises.Enabled = true; checkBox_onlyLectures.Enabled = true; checkBox_onlyLabs.Enabled = true; checkBox_onlyLabs.Checked = true; checkBox_onlyLectures.Checked = true; checkBox_onlyPractises.Checked = true; checkBox_LessonsOfStudentSelected.Checked = false; checkBox_LessonsOfStudentSelected.Enabled = true; GeneralFuntion.Form_Center_FixedDialog(this); setEmptyDataInGridView(); setStudents(); updateButtons(); }
public Form_MenuStudent(User u) { InitializeComponent(); GeneralFuntion.Form_Center_FixedDialog(this); dal = new DbContextDal(); user = u; if (user != null) { if (user.permission.Equals("Student")) { student = dal.students.Find(user.ID); lbl_userName.Text = lbl_userName.Text + student.Name; lbl_title.Text = lbl_title.Text + "Student"; } else { MessageBox.Show("Error: Could not identify user details! (Only Student can enter to here)"); clickGoBack = true; this.Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; this.Close(); } }
private void txt_TB_CourseID_TextChanged(object sender, EventArgs e) { GeneralFuntion.textBox_numeric(txt_TB_CourseID, null); // search course by id - from database if (txt_TB_CourseID.TextLength > 0) { int id = System.Convert.ToInt32(txt_TB_CourseID.Text.ToString()); courses = dal.courses.Where(x => x.ID == id).ToList <Course>(); } UpdateCoursesInComboBox(courses); if (CourseSelected == null && txt_TB_CourseID.TextLength > 0) { txt_TB_CourseName.Text = ""; } }
private void txt_TB_CourseName_TextChanged(object sender, EventArgs e) { GeneralFuntion.textBox_letters(txt_TB_CourseName); // search course by id - from database if (txt_TB_CourseName.TextLength > 0) { courses = dal.courses.Where(x => x.Name.Contains(txt_TB_CourseName.Text)).ToList <Course>(); } if (courses != null) { UpdateCoursesInComboBox(courses); } if (CourseSelected == null && txt_TB_CourseName.TextLength > 0) { txt_TB_CourseID.Text = ""; } }
public Form_SearchingStudents(User u) { InitializeComponent(); dal = new DbContextDal(); //Receives a staff member indicating what authorization is, to know what actions are allowed user = u; if (user != null) { if (user.permission.Equals("Secretary")) { secretary = dal.secretaries.Find(user.ID); } else if (user.permission.Equals("Admin")) { admin = dal.admins.Find(user.ID); } else { MessageBox.Show("Error: Could not identify user details! (Only Secretary or Admin can enter here!)"); MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } rbtn_FailedAtCourse.Checked = true; UpdateCoursesInComboBox(courses); updateButtons(); GeneralFuntion.BlockResizeListViewColumns(listView_studentCourseGrade); GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_MenuLecturerPractitioner(User u) { InitializeComponent(); GeneralFuntion.Form_Center_FixedDialog(this); dal = new DbContextDal(); user = u; if (user != null) { if (user.permission.Equals("Lecturer")) { lecturer = dal.lecturers.Find(user.ID); lbl_userName.Text = lbl_userName.Text + lecturer.Name; lbl_title.Text = lbl_title.Text + "Lecturer"; } else if (user.permission.Equals("Practitioner")) { practitioner = dal.practitiners.Find(user.ID); lbl_userName.Text = lbl_userName.Text + practitioner.Name; lbl_title.Text = lbl_title.Text + "Practitioner"; } else { MessageBox.Show("Error: Could not identify user details! (Only Lecturer or Practitioner can enter to here)"); clickGoBack = true; this.Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; this.Close(); } }