public EditWorkerViewModel(EditWorker editWorkerOpen, vwWorker workerEdit) { _editWorker = editWorkerOpen; _worker = workerEdit; _location = new vwLocation(); _gender = new tblGender(); _sector = new tblSector(); _manager = new vwManager(); LocationList = _dbService.GetAllLocations(); WorkerList = _dbService.GetAllWorkerRecords(); GenderList = _dbService.GetAllGenders(); SectorList = _dbService.GetAllSectors(); ManagerList = new List <vwManager>(); foreach (var item in _dbService.GetAllManagers()) { if (item.WorkerID != _worker.WorkerID) { ManagerList.Add(item); } } FirstNameBeforeEdit = _worker.FirstName; LastNameBeforeEdit = _worker.LastName; JMBGBeforeEdit = _worker.JMBG; actionEventObject = new ActionEvent(); actionEventObject.ActionPerformed += ActionPerformed; }
public AddWorkerViewModel(AddWorker addEmployeeOpen) { _addWorker = addEmployeeOpen; _worker = new vwWorker(); _location = new vwLocation(); LocationList = _dbService.GetAllLocations(); WorkerList = _dbService.GetAllWorkerRecords(); GenderList = _dbService.GetAllGenders(); SectorList = _dbService.GetAllSectors(); ManagerList = _dbService.GetAllManagers(); actionEventObject = new ActionEvent(); actionEventObject.ActionPerformed += ActionPerformed; }