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;
        }
示例#3
0
 public void AddEmployee(Employee employee)
 {
     employee.ID = employeeService.AddEmployee(employee);
     AllEmployees.Add(employee);
     Filter();
     Search();
     mainWindow.DisplayEmployeesList();
 }
示例#4
0
        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);
        }
示例#5
0
 void AddExecute(object param)
 {
     AllEmployees.Add(Employee.CreateEmployee(NewEmployee.Name, NewEmployee.Age));
 }