Exemple #1
0
        private void InsertEmployee_Click(object sender, EventArgs e)
        {
            if (prevForm is Manager)
            {
                Manager man = prevForm as Manager;
                man.OpenFormPanel(new CreateEmployee(new Employee(), prevForm, "Insert"));
            }

            if (prevForm is Owners)
            {
                Owners own = prevForm as Owners;
                own.OpenFormPanel(new CreateEmployee(new Employee(), prevForm, "Insert"));
            }
        }
Exemple #2
0
 private void UpdateEmployee_Click(object sender, EventArgs e)
 {
     if (employee.Id != 0)
     {
         if (prevForm is Manager)
         {
             man = prevForm as Manager;
             man.OpenFormPanel(new CreateEmployee(employee, prevForm, "Update"));
         }
         if (prevForm is Owners)
         {
             Owners own = prevForm as Owners;
             own.OpenFormPanel(new CreateEmployee(employee, prevForm, "Update"));
         }
     }
     else
     {
         MessageBox.Show("Please select a row!!");
     }
 }
Exemple #3
0
 private void btnCreateAccount_Click(object sender, EventArgs e)
 {
     if (employee.Id != 0)
     {
         if (prevForm is Manager && (employee.Designation.ToUpper() == "CONSULTANT" || employee.Designation.ToUpper() == "REPORTER"))
         {
             man = prevForm as Manager;
             man.OpenFormPanel(new EmployeeAccount(employee));
         }
         else if (prevForm is Owners)
         {
             Owners own = prevForm as Owners;
             own.OpenFormPanel(new EmployeeAccount(employee));
         }
         else
         {
             MessageBox.Show("Invalid user type");
         }
     }
     else
     {
         MessageBox.Show("Please select a row!!");
     }
 }