private void RetrieveData() { using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey)) { EmployeeFacade facade = new EmployeeFacade(uow); EmployeeDto instance = facade.RetrieveOrNewEmployee(InstanceId, new EmployeeConverter()); CurrentInstance = instance; ucIEdit.CurrentInstance = instance; } }
private void RetrieveInstances(EmployeeFacade facade) { if (CurrentUserContext.IsAdmin) { CurrentInstances = facade.RetrieveAllEmployee(new EmployeeConverter()); } else if (CurrentUserContext.IsEmployee) { List <EmployeeDto> instances = new List <EmployeeDto>(); EmployeeDto instance = facade.RetrieveOrNewEmployee(CurrentUserContext.User.MatchId, new EmployeeConverter()); instances.Add(instance); CurrentInstances = instances; } }