public ActionResult PersonnelBillingList(HelpPersonnelBillingListModel model) { bool hasError = !ValidateModel(model); HelpBl.SetPersonnelBillingListModel(model, hasError); return View(model); }
public HelpPersonnelBillingListModel GetPersonnelBillingList() { User user = UserDao.Load(AuthenticationService.CurrentUser.Id); IdNameReadonlyDto dep = GetDepartmentDto(user); HelpPersonnelBillingListModel model = new HelpPersonnelBillingListModel { UserId = AuthenticationService.CurrentUser.Id, DepartmentName = dep.Name, DepartmentId = dep.Id, //DepartmentReadOnly = dep.IsReadOnly, }; SetInitialDates(model); SetDictionariesToModel(model); //SetInitialStatus(model); //SetIsOriginalDocsVisible(model); SetIsAvailable(model); return model; }
protected void SetIsAvailable(HelpPersonnelBillingListModel model) { //могут создавать задачи все кто имеет доступ к пункту меню, кроме просмотровой учетки model.IsAddAvailable = CurrentUser.UserRole != UserRole.OutsourcingManager || CurrentUser.UserRole != UserRole.Estimator || ((CurrentUser.UserRole & UserRole.PersonnelManager) > 0 && CurrentUser.Id == 10); }
public void SetPersonnelBillingListModel(HelpPersonnelBillingListModel model, bool hasError) { SetDictionariesToModel(model); //User user = UserDao.Load(model.UserId); if (hasError) model.Documents = new List<HelpPersonnelBillingRequestDto>(); else SetDocumentsToModel(model); }
public void SetDocumentsToModel(HelpPersonnelBillingListModel model) { //UserRole role = CurrentUser.UserRole; //model.Documents = new List<HelpPersonnelBillingRequestDto>(); model.Documents = HelpPersonnelBillingRequestDao.GetDocuments( CurrentUser.Id, CurrentUser.UserRole, model.DepartmentId, model.StatusId, model.BeginDate, model.EndDate, model.InitiatorUserName, model.WorkerUserName, model.Number, model.TitleId, model.UrgencyId, model.SortBy, model.SortDescending ); }
public void SetDictionariesToModel(HelpPersonnelBillingListModel model) { model.Statuses = GetPersonnelBillingStatuses(); model.Urgencies = GetPersonnelBillingUrgencies(true); model.Titles = GetPersonnelBillingTitles(true); }