Exemple #1
0
 public ActionResult ServiceQuestionsList(HelpServiceQuestionsListModel model)
 {
     bool hasError = !ValidateModel(model);
     HelpBl.SetServiceQuestionsListModel(model, hasError);
     return View(model);
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 protected void SetIsAvailable(HelpServiceQuestionsListModel model)
 {
     model.IsAddAvailable = model.IsAddAvailable = ((CurrentUser.UserRole & UserRole.Manager) == UserRole.Manager || (CurrentUser.UserRole & UserRole.ConsultantPersonnel) == UserRole.ConsultantPersonnel);
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 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);
 }
Exemple #6
0
 public void SetDictionariesToModel(HelpServiceQuestionsListModel model)
 {
     model.Statuses = GetServiceQuestionsStatuses();
     model.IsManagerColumnVisible = (CurrentUser.UserRole & UserRole.Employee) != UserRole.Employee;
 }