public AddEmployee() { InitializeComponent(); Employee = new Models.Employees(); EmployeeAdd.DataContext = Employee; Models.EmployeesContext DB = new Models.EmployeesContext(); Department.ItemsSource = DB.Departments.ToList(); Position.ItemsSource = DB.Positions.ToList(); DB.Dispose(); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { DB.SaveChanges(); DB.Dispose(); }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { DB.Dispose(); }