예제 #1
0
 public AddEmployeeViewModel(AddEmployeeView addEmployeeView)
 {
     this.addEmployeeView = addEmployeeView;
     GenderList           = genders.GetAllGender();
     LocationList         = locations.GetAllLocations();
     ManagerList          = employees.GetAllEmployees();
     employee             = new vwEmployee();
 }
 public EditEmployeeViewModel(EditEmployeeView editEmployeeView, vwEmployee employeeToEdit)
 {
     this.editEmployeeView = editEmployeeView;
     this.employee         = employeeToEdit;
     sector       = employeeToEdit.SectorName;
     GenderList   = genders.GetAllGender();
     LocationList = locations.GetAllLocations();
     ManagerList  = employees.GetAllManagers(employee);
     //gets user initial values before editing
     CheckIsEmployeeChanged = new vwEmployee
     {
         Name    = employeeToEdit.Name,
         Surname = employeeToEdit.Surname,
         NumberOfIdentityCard = employeeToEdit.NumberOfIdentityCard,
         PhoneNumber          = employeeToEdit.PhoneNumber,
         JMBG       = employeeToEdit.JMBG,
         Gender     = employeeToEdit.Gender,
         Sector     = employeeToEdit.Sector,
         SectorName = employeeToEdit.SectorName,
         Location   = employeeToEdit.Location,
         Manager    = employee.Manager
     };
 }