/// <summary> /// Загрузка реестра заявок подразделений. /// </summary> /// <param name="model"></param> /// <returns></returns> public StaffDepartmentRequestListModel SetStaffDepartmentRequestList(StaffDepartmentRequestListModel model) { model.DepRequestList = StaffDepartmentRequestDao.GetDepartmentRequestList(userDao.Load(AuthenticationService.CurrentUser.Id), AuthenticationService.CurrentUser.UserRole, model.DepartmentId, model.Id.HasValue ? model.Id.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 = StaffDepartmentRequestTypesDao.LoadAll(); model.RequestTypes.Insert(0, new StaffDepartmentRequestTypes() { Id = 0, Name = "Все" }); return model; }
/// <summary> /// Загрузка запросной формы реестра заявок подразделений. /// </summary> /// <returns></returns> public StaffDepartmentRequestListModel GetStaffDepartmentRequestList() { StaffDepartmentRequestListModel model = new StaffDepartmentRequestListModel(); DateTime today = DateTime.Today; model.DateBegin = new DateTime(today.Year, today.Month, 1); model.DateEnd = today; model.DepartmentAccessoryes = GetDepartmentAccessoryes(); model.Statuses = GetRequestStatuses(); model.RequestTypes = StaffDepartmentRequestTypesDao.LoadAll(); model.RequestTypes.Insert(0, new StaffDepartmentRequestTypes() { Id = 0, Name = "Все" }); model.IsMyAcceptShow = AuthenticationService.CurrentUser.UserRole == UserRole.Manager || AuthenticationService.CurrentUser.UserRole == UserRole.Director || AuthenticationService.CurrentUser.UserRole == UserRole.Inspector || AuthenticationService.CurrentUser.UserRole == UserRole.ConsultantPersonnel ? true : false; return model; }
public ActionResult StaffDepartmentRequestList() { StaffDepartmentRequestListModel model = new StaffDepartmentRequestListModel(); model = StaffListBl.GetStaffDepartmentRequestList(); return View(model); }
public ActionResult StaffDepartmentRequestList(StaffDepartmentRequestListModel model) { if (ValidateModel(model)) model = StaffListBl.SetStaffDepartmentRequestList(model); else model.Statuses = StaffListBl.GetRequestStatuses(); return View(model); }
protected bool ValidateModel(StaffDepartmentRequestListModel model) { return ModelState.IsValid; }