private void Window_Loaded(object sender, RoutedEventArgs e) { cbDepartment.ItemsSource = DepartmentDAL.ListALL(); cbEducation.ItemsSource = IdNameDAL.GetByCatagory("学历"); cbGender.ItemsSource = IdNameDAL.GetByCatagory("性别"); cbMarriage.ItemsSource = IdNameDAL.GetByCatagory("婚姻状况"); cbPartyStatus.ItemsSource = IdNameDAL.GetByCatagory("政治面貌"); if (IsAddNew) { Employee employee = new Employee(); employee.InDate = DateTime.Today; employee.ContractStartDay = DateTime.Today; employee.ContractEndDay = DateTime.Today.AddYears(1); employee.Nationality = "汉族"; employee.Email = "*****@*****.**"; //employee.Number = "Ideas"; employee.Number = SettingDAL.GetValue("员工工号前缀"); gridEmployee.DataContext = employee; } else { Employee employee = EmployeeDAL.GetById(EditingId); gridEmployee.DataContext = employee; if (employee.Photo != null) { ShowImage(employee.Photo); } } }
private void Window_Loaded(object sender, RoutedEventArgs e) { columnEducationId.ItemsSource = IdNameDAL.GetByCatagory("学历"); columnDepartmentId.ItemsSource = DepartmentDAL.ListALL(); LoadData(); cbSearchByName.IsChecked = true; dpInDateStart.SelectedDate = DateTime.Today.AddMonths(-1); dpEndDate.SelectedDate = DateTime.Today; cmbDept.ItemsSource = DepartmentDAL.ListALL(); }