Exemplo n.º 1
0
 /**
   * @desc Executes when the Add Payment button is clicked
   * It invokes the frm_member_list panel for selecting a member to add a payment
   * Or if an id_member is already present then open frm_add_payment for that member
   * @params [none] No input parameter.
   * @return [none] No directly returned data.
   */
 private void button_addpayments_Click(object sender, EventArgs e)
 {
     // if this was launche from main menu invoke the frm_member_list panel for selecting a member to add a payment
     if (this.Id_member == -1)
     {
         frm_member_list frmMemberList = new frm_member_list(this);
         frmMemberList.ShowDialog();
     }
     // if an id_member is already present then open frm_add_payment for that member
     else
     {
         frm_add_payment frmAddPayment = new frm_add_payment(this.Id_member);
         frmAddPayment.ShowDialog();
     }
 }
 /**
   * @desc Executes when the "View Attendants" button is clicked
   * It opens up a member list for viewing the attendants to this class instance
   * @params [none] No input parameter.
   * @return [none] No directly returned data.
   */
 private void button_viewattendants_Click(object sender, EventArgs e)
 {
     // Params: this clClassInstance and a true boolean viewAttendants
     frm_member_list frmMemberList = new frm_member_list(clClassInstance, true);
     frmMemberList.ShowDialog();
 }
Exemplo n.º 3
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();
            }
        }
Exemplo n.º 4
0
 /**
   * @desc Constructor for creating new member, that was opened from member list.
   * (To be able to refresh member list after saving the new member)
   * @params [frm_member_list] frmMemberList: by taking this parameter there will be a reference
   * to the member list so it can be refreshed after saving the new member
   * @return [none] No directly returned data.
   */
 public frm_member(frm_member_list frmMemberList)
 {
     // Create reference to the parent form
     this.frmMemberList = frmMemberList;
     // create new member object
     clMember = new Member();
     InitializeComponent();
     txt_membernum.Text = Utils.sGenerateNewMemberNumber();
     txt_membernum.ReadOnly = true;
     // equipmentbooking, add payments and remove member buttons are hidden until saving (creating) the member
     button_equipmentbooking.Hide();
     button_payments.Hide();
     button_remove.Hide();
     // As this was opened from a member list there is no need to open a new one after closing
     button_saveOpen.Hide();
     clMember.Id_file = "";
     // Set a default type (Full time student)
     cmb_type.SelectedIndex = 0;
     // Set default gender and image
     rd_male.Checked = true;
     this.pictureBox1.BackgroundImage = global::Gym_administration.Properties.Resources.member_male_128;
 }
Exemplo n.º 5
0
 /**
   * @desc Executes when the "Save and Open" button is clicked
   * If the saving is ok, then closes the member form and opens up the member list
   * This button is never shown on a member form which was just called form a member list.
   * @params [none] No input parameter.
   * @return [none] No directly returned data.
   */
 private void button_saveOpen_Click(object sender, EventArgs e)
 {
     if (this.saveClick())
     {
         this.Dispose();
         frm_member_list frmMemberList = new frm_member_list();
         frmMemberList.ShowDialog();
     }
 }
Exemplo n.º 6
0
        /**
          * @desc Constructor for editing an existing member.
          * (To be able to refresh member list after saving the edited member)
          * @params [int] id_member: identifies the member to modify
          * @params [frm_member_list] frmMemberList: by taking this parameter there will be a reference
          * to the member list so it can be refreshed after saving the edited member
          * @return [none] No directly returned data.
          */
        public frm_member(int id_member, frm_member_list frmMemberList)
        {
            InitializeComponent();
            // Create reference to the parent form
            this.frmMemberList = frmMemberList;
            // Load in member details for specified member
            clMember = new Member(id_member);

            button_equipmentbooking.Show();
            button_payments.Show();
            button_remove.Show();
            button_saveOpen.Hide();

            if (clMember.Id_member < 1)
                MessageBox.Show("The member could not be found");
            else
            {
                // If the member was found, load in all member details into member object from database
                vLoadBookedList();
                 txt_firstName.Text = clMember.FirstName;
                 txt_lastName.Text = clMember.LastName;
                 chk_active.Checked = clMember.IsActive;
                 txt_dob.Text = Utils.sGetCsharpDateFromMysqlDate(clMember.Birthdate);
                 txt_address1.Text = clMember.Address_1;
                 txt_address2.Text = clMember.Address_2;
                 txt_city.Text = clMember.City;
                 txt_county.Text = clMember.County;
                 txt_emerg_mobile.Text = clMember.EmergContactMobile;
                 txt_emerg_name.Text = clMember.EmergContactName;
                 txt_emerg_telephone.Text = clMember.EmergContactPhone;
                 txt_emerg_relation.Text = clMember.EmergContactRelation;
                 txt_allergies.Text = clMember.MedicalAllergies;
                 txt_doctor_name.Text = clMember.MedicalDoctorName;
                 txt_medical_notes.Text = clMember.MedicalNotes;
                 txt_doctor_phone.Text = clMember.MedicalPhone;
                 txt_membernum.Text = clMember.Id_member.ToString();
                 txt_pc.Text = clMember.PostalCode;
                 cmb_type.Text = clMember.Type;
                 txt_email.Text = clMember.Email;
                 txt_mobile.Text = clMember.Mobile;
                 txt_telephone.Text = clMember.Phone;
                 txt_sid.Text = clMember.Sid;
                 txt_stcardnumber.Text = clMember.StudCardNumber;

                 // Create mysql connection
                mySqlConn conn = new mySqlConn();
                 conn.connect();
                // If there is a corresponing picture for this member, then load it in,
                // else show default image, depending on gender
                 if (clMember.Gender == "male")
                 {
                     rd_male.Checked = true;
                     if (clMember.Id_file == "")
                     {
                         this.pictureBox1.BackgroundImage = global::Gym_administration.Properties.Resources.member_male_128;
                     }
                     else
                     {

                         pictureBox1.Image = conn.loadImageFromDB(clMember.Id_file);
                     }
                 }
                 else
                 {
                     rd_female.Checked = true;
                     if (clMember.Id_file == "")
                     {
                         this.pictureBox1.BackgroundImage = global::Gym_administration.Properties.Resources.member_female_128;
                     }
                     else
                     {
                         pictureBox1.Image = conn.loadImageFromDB(clMember.Id_file);
                     }
                 }

            }
        }