Exemple #1
0
        private void AddEmployee(object sender)
        {
            sel_emp = new EmployeeModel();
            EmployeeWindow cw = new EmployeeWindow(sel_emp);

            if (cw.ShowDialog() == true)
            {
                db.AddEmployee(sel_emp);
                db.Save();
                SetData();
            }
        }
Exemple #2
0
        private void EditEmployee(object sender)
        {
            if (sel_emp != null)
            {
                EmployeeWindow cw = new EmployeeWindow(sel_emp);

                if (cw.ShowDialog() == true)
                {
                    db.UpdateEmployee(sel_emp);
                    db.Save();
                    SetData();
                }
            }
            else
            {
                MessageBox.Show("Пожалуйста, выберите сотрудника!");
            }
        }