Exemple #1
0
        private void NewEmployee_Click(object sender, EventArgs e)
        {
            var edit = new EmployeeCreateEdit();

            if (edit.ShowDialog() == DialogResult.OK)
            {
                using (var context = new ApplicationDBContext())
                {
                    context.AddEmployee(edit.Employee);
                    UpdateView();
                }
            }
        }
Exemple #2
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            var edit = new EmployeeCreateEdit(Employee);

            if (edit.ShowDialog() == DialogResult.OK)
            {
                using (var context = new ApplicationDBContext())
                {
                    context.EditEmployee(edit.Employee);
                }
                Employee = edit.Employee;
                this.Close();
            }
        }