Beispiel #1
0
        private void addNewEmployee_Click(object sender, RoutedEventArgs e)
        {
            EmployeeRegistrationWindow addEmp = new EmployeeRegistrationWindow();

            addEmp.Closed += new EventHandler(addEmp_Closed);
            addEmp.Show();
        }
Beispiel #2
0
        void addEmp_Closed(object sender, EventArgs e)
        {
            EmployeeRegistrationWindow emp = (EmployeeRegistrationWindow)sender;

            if (emp.NewEmployee != null)
            {
                OrganizationContext _OrganizationContext = (OrganizationContext)(employeeDataSource.DomainContext);
                _OrganizationContext.Employees.Add(emp.NewEmployee);
                employeeDataSource.SubmitChanges();
            }
        }