public void OpenForm(string type, string task) { if (task == "Search") { if (type == "Booking") { frmSearch frm = new frmSearch(type, CurrentUser); frm.Show(); } else if (type == "EmailAccount") { frmEmailDetails frm = new frmEmailDetails(currentUser: CurrentUser); frm.Show(); } } else if (task == "Add") { if (type == "Booking") { frmBooking frm = new frmBooking(CurrentUser); frm.Show(); } else if (type == "User") { frmUser frm = new frmUser(CurrentUser); frm.Show(); } else if (type == "Course") { frmCourse frm = new frmCourse(CurrentUser); frm.Show(); } else if (type == "Instructor") { frmInstructor frm = new frmInstructor(CurrentUser); frm.Show(); } else if (type == "Staff") { frmStaff frm = new frmStaff(CurrentUser); frm.Show(); } else if (type == "Student") { frmStudent frm = new frmStudent(CurrentUser); frm.Show(); } else if (type == "Enrolment") { frmEnrolment frm = new frmEnrolment(CurrentUser); frm.Show(); } else if (type == "Equipment") { frmEquipment frm = new frmEquipment(); frm.Show(); } } else { MessageBox.Show("Incorrect value for task: " + task, "Error in OpenForm()"); } }
private void btnInstructor_Click(object sender, EventArgs e) { frmInstructor frm = new frmInstructor(CurrentUser); frm.Show(); }