Exemple #1
0
 public ActionResult PersonnelBillingList(HelpPersonnelBillingListModel model)
 {
     bool hasError = !ValidateModel(model);
     HelpBl.SetPersonnelBillingListModel(model, hasError);
     return View(model);
 }
Exemple #2
0
 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;
 }
Exemple #3
0
 protected void SetIsAvailable(HelpPersonnelBillingListModel model)
 {
     //могут создавать задачи все кто имеет доступ к пункту меню, кроме просмотровой учетки
     model.IsAddAvailable = CurrentUser.UserRole != UserRole.OutsourcingManager || CurrentUser.UserRole != UserRole.Estimator || ((CurrentUser.UserRole & UserRole.PersonnelManager) > 0 && CurrentUser.Id == 10);
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 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
        );
 }
Exemple #6
0
 public void SetDictionariesToModel(HelpPersonnelBillingListModel model)
 {
     model.Statuses = GetPersonnelBillingStatuses();
     model.Urgencies = GetPersonnelBillingUrgencies(true);
     model.Titles = GetPersonnelBillingTitles(true);
 }