コード例 #1
0
        private void EmployeeBtn_Click_1(object sender, EventArgs e)
        {
            EmployeeOptionsForm employee = new EmployeeOptionsForm();

            employee.ShowDialog();
            this.Visible = false;
        }
コード例 #2
0
 private void SaveBtn_Click(object sender, EventArgs e)
 {
     try
     {
         FamilyStatus famStatus = FamilyStatus.single;
         if (MarriedRBtn.Checked)
         {
             famStatus = FamilyStatus.married;
         }
         Department currentDep = depController.GetDepartmentByName(SelectDepartment_CmbBox.Text);
         if (!employeeController.EmployeeSalaryValidation(SalaryTxtBox.Text, currentDep))
         {
             throw new Exception("The salary is too low!");
         }
         employeeController.ReworkEmployee(currentEmployee, NameBox.Text, int.Parse(SalaryTxtBox.Text), famStatus, int.Parse(InternshipBox.Text), depController.GetDepartmentByName(SelectDepartment_CmbBox.Text), double.Parse(SalaryTxtBox.Text));
         MessageBox.Show("Operation is successful!", "Successful operation", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Visible = false;
         EmployeeOptionsForm emp = new EmployeeOptionsForm();
         emp.Visible = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Incorrect data",
                         MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
コード例 #3
0
        private void EmployeeBtn_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            EmployeeOptionsForm employeeOptions = new EmployeeOptionsForm();

            employeeOptions.Show();
        }
コード例 #4
0
        private void BackBtn_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            EmployeeOptionsForm empOpt = new EmployeeOptionsForm();

            empOpt.Visible = true;
        }
コード例 #5
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            ClearInputData();
            employeeController.RemoveEmployeeById(currentEmployee.EmployeeId);
            currentEmployee = null;

            MessageBox.Show("Employee successfully removed", "Successful operation", MessageBoxButtons.OK, MessageBoxIcon.Information);
            this.Visible = false;
            EmployeeOptionsForm emp = new EmployeeOptionsForm();

            emp.Visible = true;
        }