Esempio n. 1
0
 /**
 * @desc Default constructor for creating new class from main menu.
 * This is for loading from main menu,
 * the class list reference is not necessary so it will be set to null
 * @params [none] No input parameter.
 * @return [none] No directly returned data.
 */
 public frm_class()
 {
     InitializeComponent();
     clClass = new Class();
     this.frmClassList = null;
     // Hide the Remove button as a class not yet existing can't be removed
     button_remove.Hide();
     rd_group.Checked = false;
 }
Esempio n. 2
0
 /**
 * @desc Default constructor for creating new class from main menu.
 * This is for loading from main menu,
 * the class list reference is not necessary so it will be set to null
 * @params [none] No input parameter.
 * @return [none] No directly returned data.
 */
 public frm_class()
 {
     InitializeComponent();
     this.Text = "Create a New Type of Gym Class";
     clClass = new Class();
     this.frmClassList = null;
     // Hide the Remove button as a class not yet existing can't be removed
     button_remove.Enabled = false;
     rd_group.Checked = false;
 }
Esempio n. 3
0
 /**
  * @desc Constructor for creating new class, that was opened from class list.
  * (To be able to refresh class list after saving the new class)
  * @params [frm_class_list] frmClassList: by taking this parameter there will be a reference
  * to the class list so it can be refreshed after saving the new class
  * @return [none] No directly returned data.
  */
 public frm_class(frm_class_list frmClassList)
 {
     InitializeComponent();
     clClass = new Class();
     // Create reference to the parent form (frm_class_list)
     this.frmClassList = frmClassList;
     // Hide the Remove button as a new class can't be removed
     button_remove.Hide();
     rd_group.Checked = false;
 }
Esempio n. 4
0
 /**
   * @desc Constructor for editing an existing class.
   * (To be able to refresh class list after saving the edited class)
   * @params [int] id_class: identifies the class to modify
   * @params [frm_class_list] frmClassList: by taking this parameter there will be a reference
   * to the class list so it can be refreshed after saving the edited class
   * @return [none] No directly returned data.
   */
 public frm_class(int id_class, frm_class_list frmClassList)
 {
     InitializeComponent();
     // Create reference to the parent form (frm_class_list)
     this.frmClassList = frmClassList;
     // Load in class details for specified class
     clClass = new Class(id_class);
     // Check if there was such a class in the database
     if (clClass.Id_class == -1)
         MessageBox.Show("The class could not be found");
     // If the class was found
     else
     {
         // Display table field contents on form
         txt_classdesc.Text = clClass.Description;
         txt_classname.Text = clClass.Name;
         if (clClass.Type == "Personal")
             rd_personal.Checked = true;
         else
             rd_group.Checked = true;
     }
 }
Esempio n. 5
0
        /**
          * @desc Executes at panel events
          * It watches the selectedBand and executes the "if" section that it currently belongs to
          * @params [none] No input parameter.
          * @return [none] No directly returned data.
          */
        public void PanelEvent(object sender, EventArgs e)
        {
            Control ctrl = (Control)sender;
            PanelIcon panelIcon = ctrl.Tag as PanelIcon;
            string selectedBand = panelIcon.iconPanel.BandName;

            foreach (Form childForm in MdiChildren)
            childForm.Close();

            /////////////////////////  MANAGER OPTIONS BAND   ////////////////////////
            // Add Staff
            if (selectedBand == "manager" && panelIcon.Index.ToString() == "0")
            {
                frm_staff frmStaff = new frm_staff();
                frmStaff.ShowDialog();
            }
            // Edit Staff
            if (selectedBand == "manager" && panelIcon.Index.ToString() == "1")
            {
                frm_staff_list frmStaffList = new frm_staff_list();
                frmStaffList.ShowDialog();
            }
            // Membership fees
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "2")
            {
                frm_payment_list frmPayments = new frm_payment_list();
                frmPayments.ShowDialog();
            }
            //Edit Arranged Class
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "3")
            {
                frm_class_instance_list frmClassArrangeList = new frm_class_instance_list();
                frmClassArrangeList.ShowDialog();
            }
            // Add Class
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "4")
            {
                frm_class frmClass = new frm_class();
                frmClass.ShowDialog();
            }
            // Edit Class
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "5")
            {
                frm_class_list frmClassList = new frm_class_list();
                frmClassList.ShowDialog();
            }
            // Add New Equipment
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "6")
            {
                frm_equipment frmEquipment = new frm_equipment();
                frmEquipment.ShowDialog();
            }
            // Edit Equipment
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "7")
            {
                frm_equipment_list frmEquipmentList = new frm_equipment_list();
                frmEquipmentList.ShowDialog();
            }
            // Edit Room
            else if (selectedBand == "manager" && panelIcon.Index.ToString() == "8")
            {
                frm_room_list frmRoomList = new frm_room_list();
                frmRoomList.Show();
            }
            /////////////////////  STAFF OPTIONS BAND //////////////////////
            // Add Member
            else if (selectedBand == "staff" && panelIcon.Index.ToString() == "0")
            {
                frm_member frmMember = new frm_member();
                frmMember.ShowDialog();
            }
            //Edit Member
            else if (selectedBand == "staff" && panelIcon.Index.ToString() == "1")
            {
                frm_member_list frmMemberList = new frm_member_list();
                frmMemberList.ShowDialog();
            }
            //Book Class
            else if (selectedBand == "staff" && panelIcon.Index.ToString() == "2")
            {
                frm_class_instance_arrange frmClassArrange = new frm_class_instance_arrange();
                frmClassArrange.ShowDialog();
            }
            //Edit Arranged Class
            else if (selectedBand == "staff" && panelIcon.Index.ToString() == "3")
            {
                frm_class_instance_list frmClassArrangeList = new frm_class_instance_list();
                frmClassArrangeList.ShowDialog();
            }
            // Search Eq. Bookings
            else if (selectedBand == "staff" && panelIcon.Index.ToString() == "4")
            {
                frm_equipment_bookings_list frmEqBookingsList = new frm_equipment_bookings_list();
                frmEqBookingsList.ShowDialog();
            }
            // Room Search
            else if (selectedBand == "staff" && panelIcon.Index.ToString() == "5")
            {
                frm_room_list frmRoomList = new frm_room_list();
                frmRoomList.ShowDialog();
            }
            /////////////////////////  LOGIN OPTIONS BAND  ///////////////////////
            // Login Options
            else if (selectedBand == "all" && panelIcon.Index.ToString() == "0")
            {
                frm_login_options frmLoginOptions = new frm_login_options(this);
                frmLoginOptions.ShowDialog();
            }
            // Log Out
            else if (selectedBand == "all" && panelIcon.Index.ToString() == "1")
            {
                Controls.Remove(this.outlookBar);
                frm_login frmLogin = new frm_login(this);
                frmLogin.ShowDialog();
            }
        }