public Form_MenuSecretaryAdmin(User u) { InitializeComponent(); dal = new DbContextDal(); user = u; if (user != null) { if (user.permission.Equals("Secretary")) { secretary = dal.secretaries.Find(user.ID); lbl_userName.Text = lbl_userName.Text + secretary.Name; lbl_title.Text = lbl_title.Text + "Secretary"; } else if (user.permission.Equals("Admin")) { admin = dal.admins.Find(user.ID); lbl_userName.Text = lbl_userName.Text + admin.Name; lbl_title.Text = lbl_title.Text + "Admin"; } else { MessageBox.Show("Error: Could not identify user details! (Only Secretary or Admin can enter to here)"); clickGoBack = true; this.Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; this.Close(); } GeneralFuntion.Form_Center_FixedDialog(this); }
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(); } }
public Form_AddConstraint(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("Lecturer")) { lecturer = dal.lecturers.Find(user.ID); listApprovedCourses = lecturer.getAllMyCourseInStateApproved(); } else if (user.permission.Equals("Practitioner")) { practitioner = dal.practitiners.Find(user.ID); listApprovedCourses = practitioner.getAllMyCourseInStateApproved(); } else { MessageBox.Show("Error: Could not identify user details! (Only Lecturer / Practitioner can enter to here)"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } if (listApprovedCourses != null) { string[] CB_coursesItems = new string[listApprovedCourses.Count + 1]; CB_coursesItems[0] = ""; for (int i = 0; i < listApprovedCourses.Count; i++) { string str = listApprovedCourses.ElementAt(i).ID.ToString() + " : " + listApprovedCourses.ElementAt(i).Name; CB_coursesItems[i + 1] = str; } txt_CB_coursesApproved.DataSource = CB_coursesItems; } txt_checkBox_allCourses.Checked = true; updateButtonsAndTextBoxes(); GeneralFuntion.BlockResizeListViewColumns(listView_constraints); GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_ShowDetailStudent(Student s) { InitializeComponent(); student = s; if (student == null) { MessageBox.Show("Missed details!"); Close(); } lbl_title.Text = lbl_title.Text + " '" + student.Name + "'"; GeneralFuntion.BlockResizeListViewColumns(listView_Courses); GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_addCourseToStaffAndStudent(User u) { InitializeComponent(); // init connection to database 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")) { staffMember = secretary = dal.secretaries.Find(user.ID); } else if (user.permission.Equals("Admin")) { staffMember = admin = dal.admins.Find(user.ID); } else if (user.permission.Equals("Lecturer")) { staffMember = lecturer = dal.lecturers.Find(user.ID); } else if (user.permission.Equals("Practitioner")) { staffMember = practitioner = dal.practitiners.Find(user.ID); } else if (user.permission.Equals("Student")) { student = dal.students.Find(user.ID); } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } resertDetailCourse(); UpdateDefaultButton(); initPermission(); GeneralFuntion.BlockResizeListViewColumns(listView_coursesFounded); GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_LoginStart() { /* * Thread t = new Thread(new ThreadStart(splashStart)); * t.Start(); * Thread.Sleep(5000); * InitializeComponent(); * t.Abort(); * * updateButtons(); */ InitializeComponent(); GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_ShowDetailCourse(Course c) { InitializeComponent(); GeneralFuntion.Form_Center_FixedDialog(this); course = c; if (course == null) { //exit } lbl_title.Text = lbl_title.Text + " '" + course.Name + "'"; txt_lbl_syllabus.SelectionStart = 0; txt_lbl_syllabus.SelectionLength = 0; GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_AddUpdateStaffMember(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("Lecturer")) { lecturer = dal.lecturers.Find(user.ID); } else if (user.permission.Equals("Practitioner")) { practitioner = dal.practitiners.Find(user.ID); } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } updateButtons(); listView_staffFounded.Items.Clear(); GeneralFuntion.BlockResizeListViewColumns(listView_staffFounded); GeneralFuntion.Form_Center_FixedDialog(this); }
// the ctor of the frame public Form_AddUpdateStudent(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")) { studentAsPremission = dal.students.Find(user.ID); studentSelected = studentAsPremission; txt_TB_ID.Text = studentAsPremission.ID.ToString(); txt_TB_ID.Enabled = false; } else { MessageBox.Show("Error: Could not identify user details! (Only Secretary or Admin or Student can enter here!)"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } updateButtons(); GeneralFuntion.BlockResizeListViewColumns(listView_studentFounded); GeneralFuntion.Form_Center_FixedDialog(this); }
public Form_ScheduleLessonsByConstraint(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 / Admin can enter to here)"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } setLecturersAndPractitionersWithApprovedCourses(); setListViewClasses(); GeneralFuntion.BlockResizeListViewColumns(listView_constraints); GeneralFuntion.BlockResizeListViewColumns(listView_freeClasses); GeneralFuntion.Form_Center_FixedDialog(this); setEmptyDataInGridView(); updateComponents(); string[] days = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" }; }
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(); } }
public Form_MySchedule(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("Lecturer")) { lecturer = dal.lecturers.Find(user.ID); list_lessons = lecturer.GetAllMyLesson(); list_lessons_fix = lecturer.GetAllMyLesson(); checkBox_lectures.Enabled = true; checkBox_lectures.Checked = true; checkBox_practises.Enabled = false; checkBox_practises.Checked = false; checkBox_labs.Enabled = false; checkBox_labs.Checked = false; } else if (user.permission.Equals("Practitioner")) { practitioner = dal.practitiners.Find(user.ID); list_lessons = practitioner.GetAllMyLesson(); list_lessons_fix = practitioner.GetAllMyLesson(); checkBox_practises.Enabled = true; checkBox_practises.Checked = true; checkBox_labs.Enabled = true; checkBox_labs.Checked = true; checkBox_lectures.Enabled = false; checkBox_lectures.Checked = false; } else if (user.permission.Equals("Student")) { student = dal.students.Find(user.ID); list_lessons = student.getAllMyLessons(); list_lessons_fix = student.getAllMyLessons(); checkBox_practises.Enabled = true; checkBox_practises.Checked = true; checkBox_labs.Enabled = true; checkBox_labs.Checked = true; checkBox_lectures.Enabled = true; checkBox_lectures.Checked = true; } else { MessageBox.Show("Error: Could not identify user details! (Only Student / Lecturer / Practitioner can enter to here)"); clickGoBack = true; Close(); } } else { MessageBox.Show("Error: Could not identify user details!"); clickGoBack = true; Close(); } GeneralFuntion.Form_Center_FixedDialog(this); setEmptyDataInGridView(); setDataInGridView(); initListView(); }