private void showEmployeeList()
 {
     if (_employee_list != null)
     {
         _employee_list.EmployeeList();
     }
 }
Пример #2
0
        private void btn_save_Click(object sender, EventArgs e)
        {
            try
            {
                employee.FirstName  = this.txt_firstName.Text;
                employee.LastName   = this.txt_lastName.Text;
                employee.EmployeeID = this.txt_empid.Text;
                //employee.GenderId = int.Parse(this.cb_gender.SelectedIndex.ToString());
                employee.DepartmentId = int.Parse(this.cb_department.SelectedValue.ToString());
                employee.PositionId   = int.Parse(this.cb_position.SelectedValue.ToString());
                employee.DateHired    = this.dateTimePicker1.Value.Date.ToString("yyyy-MM-dd HH:mm");
                //employee.EmploymentStatusId = int.Parse(this.cb_employmentStatus.SelectedValue.ToString());
                switch (this._employeeId)
                {
                case 0:
                    employee.CreateEmployee();
                    MessageBox.Show("Records has been saved!");

                    break;

                default:
                    employee.ID = this._employeeId;
                    employee.UpdateEmployee();
                    MessageBox.Show("Records has been Updated!");
                    break;
                }
                this.ClearFields();
                if (_employee != null)
                {
                    _employee.EmployeeList();
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }