Esempio n. 1
0
        /// <summary>
        /// Загрузка реестра заявок ШЕ.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public StaffEstablishedPostRequestListModel SetStaffEstablishedPostRequestList(StaffEstablishedPostRequestListModel model)
        {
            model.EPRequestList = StaffEstablishedPostRequestDao.GetEstablishedPostRequestList(userDao.Load(AuthenticationService.CurrentUser.Id),
                AuthenticationService.CurrentUser.UserRole,
                model.DepartmentId,
                model.Id.HasValue ? model.Id.Value : 0,
                model.SEPId.HasValue ? model.SEPId.Value : 0,
                model.Creator,
                model.DateBegin,
                model.DateEnd,
                model.StatusId,
                model.SortBy,
                model.SortDescending,
                model.RequestTypeId,
                model.BFGId,
                model.IsMyAcceptNeed);

            model.Statuses = GetRequestStatuses();
            model.DepartmentAccessoryes = GetDepartmentAccessoryes();
            model.RequestTypes = StaffEstablishedPostRequestTypesDao.LoadAll();
            model.RequestTypes.Insert(0, new StaffEstablishedPostRequestTypes() { Id = 0, Name = "Все" });
            return model;
        }
Esempio n. 2
0
        /// <summary>
        /// Загрузка запросной формы реестра заявок ШЕ.
        /// </summary>
        /// <returns></returns>
        public StaffEstablishedPostRequestListModel GetStaffEstablishedPostRequestList()
        {
            StaffEstablishedPostRequestListModel model = new StaffEstablishedPostRequestListModel();
            DateTime today = DateTime.Today;
            model.DateBegin = new DateTime(today.Year, today.Month, 1);
            model.DateEnd = today;
            model.Statuses = GetRequestStatuses();
            model.DepartmentAccessoryes = GetDepartmentAccessoryes();
            model.RequestTypes = StaffEstablishedPostRequestTypesDao.LoadAll();
            model.RequestTypes.Insert(0, new StaffEstablishedPostRequestTypes() { Id = 0, Name = "Все" });
            model.IsMyAcceptShow = AuthenticationService.CurrentUser.UserRole == UserRole.Manager || AuthenticationService.CurrentUser.UserRole == UserRole.Director
                || AuthenticationService.CurrentUser.UserRole == UserRole.Inspector ? true : false;

            return model;
        }
Esempio n. 3
0
 protected bool ValidateModel(StaffEstablishedPostRequestListModel model)
 {
     return ModelState.IsValid;
 }
Esempio n. 4
0
        public ActionResult StaffEstablishedPostRequestList()
        {
            StaffEstablishedPostRequestListModel model = new StaffEstablishedPostRequestListModel();
            model = StaffListBl.GetStaffEstablishedPostRequestList();

            return View(model);
        }
Esempio n. 5
0
        public ActionResult StaffEstablishedPostRequestList(StaffEstablishedPostRequestListModel model)
        {
            if (ValidateModel(model))
                model = StaffListBl.SetStaffEstablishedPostRequestList(model);
            else
                model.Statuses = StaffListBl.GetRequestStatuses();

            //ModelState.AddModelError("MessageStr", "В разработке");
            //model.Statuses = StaffListBl.GetDepRequestStatuses();
            return View(model);
        }