public EditEmployeeViewModel(EditEmployee editEmployeeOpen, vwEmployee employeeEdit) { eventObject = new EventClass(); editEmployee = editEmployeeOpen; selectedMenager = new vwMenager(); employee = employeeEdit; selctedLocation = new vwLOCATION(); selectedMenager = new vwMenager(); //selectedMenager.Menager = employee.MenagerName; StartDate = (DateTime)employee.DateOfBirth; Sector = employee.SectorName; locationService = new LocationService(); employeeService = new EmployeeService(); genderService = new GenderService(); sectorService = new SectorService(); LocationList = locationService.GetAllLocations().ToList(); LocationList.OrderByDescending(x => x.Location); LocationList.Reverse(); PotentialMenagers = employeeService.GetAllPotentialMenagersForEditWindow(employeeEdit.EmployeeID); eventObject.ActionPerformed += ActionPerformed; oldEmployee = new vwEmployee(); oldEmployee.FirstName = employee.FirstName; oldEmployee.LastName = employee.LastName; oldEmployee.JMBG = employee.JMBG; }
public AddEmployeeViewModel(AddEmployee addEmployeeOpen) { eventObject = new EventClass(); selctedLocation = new vwLOCATION(); selectedMenager = new vwMenager(); employee = new vwEmployee(); addEmployee = addEmployeeOpen; locationService = new LocationService(); employeeService = new EmployeeService(); genderService = new GenderService(); sectorService = new SectorService(); LocationList = locationService.GetAllLocations().ToList(); LocationList.OrderByDescending(x => x.Location); LocationList.Reverse(); PotentialMenagers = employeeService.GetAllPotentialMenagers(); eventObject.ActionPerformed += ActionPerformed; }