public void ModifyEntity(Employee employee) { EmployeeDTO employeeDTO = AllEmployees.Where <EmployeeDTO>(x => x.ID == employee.ID).FirstOrDefault(); if (employeeDTO == null) { employeeDTO = new EmployeeDTO() { ID = employee.ID, FIO = employee.FIO, Company = new CompanyDTO { ID = employee.Company.ID, Name = employee.Company.Name } }; AllEmployees.Add(employeeDTO); } else { AllEmployees.Remove(employeeDTO); employeeDTO = new EmployeeDTO() { ID = employee.ID, FIO = employee.FIO, Company = new CompanyDTO { ID = employee.Company.ID, Name = employee.Company.Name } }; AllEmployees.Add(employeeDTO); } }
private void AddEmployeeExecute(object parameter) { var newEmployee = new EmployeeViewModel(m_unitOfWorkFactory, AllDepartments.First()); AllEmployees.Add(newEmployee); SelectedEmployee = newEmployee; }
public void AddEmployee(Employee employee) { employee.ID = employeeService.AddEmployee(employee); AllEmployees.Add(employee); Filter(); Search(); mainWindow.DisplayEmployeesList(); }
public void NewEmployee() { Employee e = new Employee(); e.EmployeeName = "naam"; e.Email = "email"; e.Address = "adres"; e.Phone = "telefoonnummer"; e.Edit = Visibility.Visible; AllEmployees.Add(e); }
void AddExecute(object param) { AllEmployees.Add(Employee.CreateEmployee(NewEmployee.Name, NewEmployee.Age)); }