Esempio n. 1
0
        private void dataGridResults_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            string     id  = dataGridResults.CurrentRow.Cells[0].Value.ToString();
            frmBooking frm = new frmBooking(id, CurrentUser);

            frm.Show();
        }
Esempio n. 2
0
        private void frmMenu_Load(object sender, EventArgs e)
        {
            myCon = new mySQLcon();
            con   = myCon.con;

            comboBoxType.Items.Add("Booking");
            comboBoxType.Items.Add("Course");
            comboBoxType.Items.Add("Enrolment");
            comboBoxType.Items.Add("Equipment");
            comboBoxType.Items.Add("Instructor");
            comboBoxType.Items.Add("Staff");
            comboBoxType.Items.Add("Student");
            if (CurrentUser.IsAdmin)
            {
                comboBoxType.Items.Add("User");
                comboBoxType.Items.Add("EmailAccount");
            }
            rbtnAdd.Select();
            comboBoxType.SelectedIndex = 0;
            frmBooking frm = new frmBooking(CurrentUser);

            frm.Show();
            ShowBookings();
        }
Esempio n. 3
0
 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()");
     }
 }