public ActionResult ServiceQuestionsList(HelpServiceQuestionsListModel model) { bool hasError = !ValidateModel(model); HelpBl.SetServiceQuestionsListModel(model, hasError); return View(model); }
public HelpServiceQuestionsListModel GetServiceQuestionsListModel() { User user = UserDao.Load(AuthenticationService.CurrentUser.Id); IdNameReadonlyDto dep = GetDepartmentDto(user); HelpServiceQuestionsListModel model = new HelpServiceQuestionsListModel { UserId = AuthenticationService.CurrentUser.Id, DepartmentName = dep.Name, DepartmentId = dep.Id, DepartmentReadOnly = dep.IsReadOnly, }; SetInitialDates(model); SetDictionariesToModel(model); //SetInitialStatus(model); SetIsAvailable(model); return model; }
protected void SetIsAvailable(HelpServiceQuestionsListModel model) { model.IsAddAvailable = model.IsAddAvailable = ((CurrentUser.UserRole & UserRole.Manager) == UserRole.Manager || (CurrentUser.UserRole & UserRole.ConsultantPersonnel) == UserRole.ConsultantPersonnel); }
public void SetServiceQuestionsListModel(HelpServiceQuestionsListModel model, bool hasError) { SetDictionariesToModel(model); User user = UserDao.Load(model.UserId); if (hasError) model.Documents = new List<HelpServiceQuestionDto>(); else SetDocumentsToModel(model, user); }
public void SetDocumentsToModel(HelpServiceQuestionsListModel model, User user) { UserRole role = CurrentUser.UserRole; //model.Documents = new List<HelpServiceRequestDto>(); model.Documents = HelpQuestionRequestDao.GetDocuments( user.Id, role, model.DepartmentId, model.StatusId, model.BeginDate, model.EndDate, model.UserName, model.Number, model.SortBy, model.SortDescending); }
public void SetDictionariesToModel(HelpServiceQuestionsListModel model) { model.Statuses = GetServiceQuestionsStatuses(); model.IsManagerColumnVisible = (CurrentUser.UserRole & UserRole.Employee) != UserRole.Employee; }