Esempio n. 1
0
        }  // end activateWorker

        // Disables Person textboxes and highlights the Person groupbox
        public static void deactivatePerson(frmEmpMan f)
        {
            deactivateEmployee(f);   // Must deactivate Employee too
            deactivateClient(f);     // Must deactivate Client too
            f.grpPerson.Enabled   = false;
            f.grpPerson.BackColor = Color.Red;
        }  // end deactivatePerson
Esempio n. 2
0
        // Resets form to initial state after form is loaded or
        //    an add Employee operation is performed

        public static void resetForm(frmEmpMan f)
        {
            //  Reset button components
            // f.btnClear.Enabled = true;
            f.btnDelete.Enabled = false;
            //f.btnEdit.Enabled = false;
            // f.btnToString.Enabled = false;
            f.btnCreateManager.Enabled = true;
            f.btnCreateManager.Text    = "Create Manager";
            f.btnCreateWorker.Enabled  = true;
            f.btnCreateWorker.Text     = "Create Worker";
            f.btnCreateClient.Enabled  = true;
            f.btnCreateClient.Text     = "Create Client";
            //f.btnNext.Visible = true;
            //f.btnPrevious.Visible = true;
            //f.btnCancel.Visible = false;

            // Reset group components
            f.grpPerson.Enabled     = false;
            f.grpPerson.BackColor   = Color.Gainsboro;
            f.grpEmployee.Enabled   = false;
            f.grpEmployee.BackColor = Color.Gainsboro;
            f.grpClient.Enabled     = false;
            f.grpClient.BackColor   = Color.Gainsboro;
            f.grpManager.Enabled    = false;
            f.grpManager.BackColor  = Color.Gainsboro;
            f.grpWorker.Enabled     = false;
            f.grpWorker.BackColor   = Color.Gainsboro;
        } // end resetForm
Esempio n. 3
0
        }  // end deactivatePerson

        // Disables Employee textboxes and highlights the Employee groupbox
        public static void deactivateEmployee(frmEmpMan f)
        {
            deactivateManager(f);   // Must deactivate Manager too
            deactivateWorker(f);    // Must deactivate Worker too
            f.grpEmployee.Enabled   = false;
            f.grpEmployee.BackColor = Color.Red;
        }  // end deactivateEmployee
Esempio n. 4
0
        }  // end activateAddButtons

        // Enable/disable buttons when not in edit mode
        public static void deactivateAddButtons(frmEmpMan f)
        {
            f.btnCreateManager.Enabled = false;
            f.btnCreateWorker.Enabled  = false;
            f.btnCreateClient.Enabled  = false;
            //   f.btnNext.Visible = false;
            //  f.btnPrevious.Visible = false;
            //  f.btnCancel.Visible = true;
        }  // end deactivateAddButtons
Esempio n. 5
0
        } // end Clear

        public static void initialActivate(frmEmpMan f)
        {
            f.lblID.Enabled              = true;
            f.txtPersonID.Enabled        = true;
            f.lblName.Enabled            = true;
            f.txtPersonName.Enabled      = true;
            f.lblBirthDate.Enabled       = true;
            f.txtPersonBirthDate.Enabled = true;
        }
Esempio n. 6
0
        } // end resetForm

        // Activates and deactivates necessary form buttons
        //    when in add mode
        public static void formAddMode(frmEmpMan f)
        {
            clear(f);
            //  f.btnClear.Enabled = true;
            f.btnDelete.Enabled = false;
            // f.btnEdit.Enabled = false;
            //  f.btnToString.Enabled = false;
            //  f.btnNext.Visible = false;
            //  f.btnPrevious.Visible = false;
            //   f.btnCancel.Visible = true;
        }  // end formAddMode
Esempio n. 7
0
        }  // end deativateWorker

        // Clear all textboxes on the form
        public static void clear(frmEmpMan f)
        {
            f.txtPersonName.Text       = "";
            f.txtPersonBirthDate.Text  = "";
            f.txtPersonID.Text         = "";
            f.txtClientType.Text       = "";
            f.txtEmployeeJobTitle.Text = "";
            f.txtManagerSalary.Text    = "";
            f.txtManagerBonus.Text     = "";
            f.txtWorkerHourlyPay.Text  = "";
        } // end Clear
Esempio n. 8
0
 public FormController(frmEmpMan parentForm)
 {
     f = parentForm;
 }
Esempio n. 9
0
 public static void createWorker(frmEmpMan f)
 {
     f.grpEmployee.Enabled = true;
     f.grpClient.Enabled   = true;
 }
Esempio n. 10
0
 public static void createManager(frmEmpMan f)
 {
     f.grpEmployee.Enabled = true;
     f.grpManager.Enabled  = true;
 }
Esempio n. 11
0
 public static void createClient(frmEmpMan f)
 {
     f.grpClient.Enabled = true;
 }
Esempio n. 12
0
 public static void deactivatePerson1(frmEmpMan f)
 {
     f.grpPerson.Enabled = false;
 }
Esempio n. 13
0
        } // end Save

        // Display data in object on form
        public override void Display(frmEmpMan f)
        {
            base.Display(f);
            f.txtManagerSalary.Text = managerSalary.ToString();
            f.txtManagerBonus.Text  = managerBonus.ToString();
        } // end Display
Esempio n. 14
0
        } // end Save

        // Display data in object on form
        public override void Display(frmEmpMan f)
        {
            base.Display(f);
            f.txtWorkerTitle.Text = employeeJobTitle.ToString();
        } // end Display
Esempio n. 15
0
        } // end Save

        // Display data in object on form
        public override void Display(frmEmpMan f)
        {
            base.Display(f);
            f.txtClientType.Text = clientType.ToString();
        } // end Display
Esempio n. 16
0
        }     // end Property
          // Accessor/mutator for bonus

        // Save data from form to object
        public override void Save(frmEmpMan f)
        {
            base.Save(f);
            workerPay = Convert.ToDecimal(f.txtWorkerPay.Text);
        } // end Save
Esempio n. 17
0
        }     // End Property


        // Save data from form to object
        public virtual void Save(frmEmpMan f)
        {
            personName      = f.txtPersonName.Text;
            personBirthDate = DateTime.Parse(f.txtPersonBirthDate.Text);
            personID        = f.txtPersonID.Text;
        }  // end Save
Esempio n. 18
0
        }  // end Save

        // Display data in object on form
        public virtual void Display(frmEmpMan f)
        {
            f.txtPersonName.Text      = personName;
            f.txtPersonBirthDate.Text = personBirthDate.ToShortDateString();
            f.txtPersonID.Text        = personID;
        }  // end Display
Esempio n. 19
0
        }  // end activateManager

        // Enables Worker textboxes and highlights the Worker groupbox
        public static void activateWorker(frmEmpMan f)
        {
            activateEmployee(f);  // Employee must be activated too
            f.grpWorker.Enabled   = true;
            f.grpWorker.BackColor = Color.LimeGreen;
        }  // end activateWorker
Esempio n. 20
0
        }  // end ActivateEm[ployee

        // Enables Employee textboxes and highlights the Client groupbox
        public static void activateClient(frmEmpMan f)
        {
            activatePerson(f);
            f.grpClient.Enabled   = true;
            f.grpClient.BackColor = Color.LimeGreen;
        }  // end activateClient
Esempio n. 21
0
        }  // end activatePerson

        //  Enables Employee textboxes and highlights the Employee groupbox
        public static void activateEmployee(frmEmpMan f)
        {
            activatePerson(f);
            f.grpEmployee.Enabled   = true;
            f.grpEmployee.BackColor = Color.LimeGreen;
        }  // end ActivateEm[ployee
Esempio n. 22
0
 }     // end Property
   // Save data from form to object
 public override void Save(frmEmpMan f)
 {
     base.Save(f);
     managerSalary = Convert.ToDecimal(f.txtManagerSalary.Text);
     managerBonus  = Convert.ToDecimal(f.txtManagerBonus.Text);
 } // end Save
Esempio n. 23
0
        }  // end deactivateEmployee

        // Disables Client textboxes and highlights the Client groupbox
        public static void deactivateClient(frmEmpMan f)
        {
            f.grpClient.Enabled   = false;
            f.grpClient.BackColor = Color.Red;
        }  // end deactivateClient
Esempio n. 24
0
        }     // end Property

        // Save data from form to object
        public override void Save(frmEmpMan f)
        {
            base.Save(f);
            employeeJobTitle = Convert.ToString(f.txtWorkerTitle.Text);
        } // end Save
Esempio n. 25
0
        }  // end deactivateAddButtons

        //  Enables Employee textboxes and highlights the Person groupbox
        public static void activatePerson(frmEmpMan f)
        {
            f.grpPerson.Enabled   = true;
            f.grpPerson.BackColor = Color.LimeGreen;
        }  // end activatePerson
Esempio n. 26
0
        }  // end deactivateManager

        // Disables Worker textboxes and highlights the Worker groupbox
        public static void deactivateWorker(frmEmpMan f)
        {
            f.grpWorker.Enabled   = false;
            f.grpWorker.BackColor = Color.Red;
        }  // end deativateWorker
Esempio n. 27
0
        } // end Save

        // Display data in object on form
        public override void Display(frmEmpMan f)
        {
            base.Display(f);
            f.txtWorkerPay.Text = workerPay.ToString();
        } // end Display
Esempio n. 28
0
        }     // end Property

        // Save data from form to object
        public override void Save(frmEmpMan f)
        {
            base.Save(f);
            clientType = Convert.ToString(f.txtClientType.Text);
        } // end Save