コード例 #1
0
 public AddEmployeeViewModel(AddEmployeeView addEmployeeView)
 {
     this.addEmployeeView = addEmployeeView;
     GenderList           = genders.GetAllGenders();
     LocationList         = locations.GetAllLocations();
     ManagerList          = employees.GetAllEmployees();
     Employee             = new vwEmployee();
 }
コード例 #2
0
 public EditEmployeeViewModel(EditEmployeeView editEmployeeView, vwEmployee employeeToEdit)
 {
     this.editEmployeeView = editEmployeeView;
     Employee     = employeeToEdit;
     Sector       = employeeToEdit.SectorName;
     GenderList   = genders.GetAllGenders();
     LocationList = locations.GetAllLocations();
     ManagerList  = employees.GetAllManagers(employee);
     //gets user initial values before editing
     OldEmployee = new vwEmployee
     {
         NameAndSurname       = employeeToEdit.NameAndSurname,
         NumberOfIdentityCard = employeeToEdit.NumberOfIdentityCard,
         PhoneNumber          = employeeToEdit.PhoneNumber,
         JMBG       = employeeToEdit.JMBG,
         Gender     = employeeToEdit.Gender,
         Sector     = employeeToEdit.Sector,
         SectorName = employeeToEdit.SectorName,
         Location   = employeeToEdit.Location,
         Manager    = employeeToEdit.Manager
     };
 }