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