//private void addStaffDetailsGroupBox_Enter(object sender, EventArgs e) //{ // if (studentRadioButton.Checked) // { // staff = 1; // studentDetailsGroupBox.Visible = true; // } // else if (LecturerRadioButton.Checked) // { // staff = 2; // studentDetailsGroupBox.Visible = false; // } //} private void AddStaffFormAddButton_Click(object sender, EventArgs e) { //MessageWarning(); //foreach (string element in staffDetailsList) //{ // if (element == "" || element == "middleName) // MessageBox.Show("Please complete the form!"); //} if (id == null) { MessageWarning("ID"); } else if (firstName == null) { MessageWarning("first name"); } else if (middleName == null) { MessageWarning("middle name"); } else if (lastName == null) { MessageWarning("last name"); } //else if (department_1 == "None" && department_2 == "None") // MessageWarning("department"); else if (studentRadioButton.Checked) { Student newStudent = new Student(); newStudent.Id = int.Parse(id); newStudent.FirstName = firstName; newStudent.MiddleName = middleName; newStudent.LastName = lastName; //newStudent.Department_1 = department_1; //newStudent.Department_2 = department_2; newStudent.Degree = degree; newStudent.Grade = grade; newStudent.Term = term; //newStudent.Major = major; if (!newStudent.uniqueIDChecking(int.Parse(id))) { MessageBox.Show("The student ID: " + id + " is exist."); } else { SystemList.StudentList.Add(newStudent); SavingAndReading data = new SavingAndReading(); data.WriteStudentFile(); } } else if (LecturerRadioButton.Checked) { Lecturer newLecturer = new Lecturer(); newLecturer.Id = int.Parse(id); newLecturer.FirstName = firstName; newLecturer.MiddleName = middleName; newLecturer.LastName = lastName; if (!newLecturer.uniqueIDChecking(int.Parse(id))) { MessageBox.Show("The lecturer ID: " + id + " is exist."); } else { SystemList.LecturerList.Add(newLecturer); SavingAndReading data = new SavingAndReading(); data.WriteLecturerFile(); } } }