Esempio n. 1
0
 protected bool ValidateModel(AppointmentListModel model)
 {
     if (model.BeginDate.HasValue && model.EndDate.HasValue &&
         model.BeginDate.Value > model.EndDate.Value)
         ModelState.AddModelError("BeginDate", StrInvalidListDates);
     return ModelState.IsValid;
 }
Esempio n. 2
0
 public ActionResult Index(AppointmentListModel model)
 {
     if(model.ForPrint>0)
         return RedirectToAction("GetPrintForm", "Graphics", new { param = model.ToParamsString(), controll = "Appointment", actionName = "Print", isLandscape = false });
     bool hasError = !ValidateModel(model);
     AppointmentBl.SetAppointmentListModel(model, hasError);
     return View("Index",model);
 }
Esempio n. 3
0
 public ActionResult Print(AppointmentListModel model)
 {
     if (model.ForPrint == 1)
     { model.ForPrint = 0; return Index(model); }
     else
     { model.ForPrint = 0; return AppointmentReportList(model); }
 }
Esempio n. 4
0
 public void SetDictionariesToModel(AppointmentListModel model)
 {
     model.Statuses = GetAppRequestStatuses();
     model.Reasons = AppointmentReasonDao.LoadAll().Select(x => new IdNameDto { Id = x.Id, Name = x.Name }).ToList();
     model.Reasons.Add(new IdNameDto{Id=0,Name="Все"});
 }
Esempio n. 5
0
 public void SetAppointmentReportsListModel(AppointmentListModel model, bool hasError)
 {
     SetDictionariesToReportsModel(model);
     User user = UserDao.Load(AuthenticationService.CurrentUser.Id);
     if (hasError)
         model.Documents = new List<AppointmentDto>();
     else
         SetDocumentsReportsToModel(model, user);
 }
Esempio n. 6
0
 public AppointmentListModel GetAppointmentReportListModel()
 {
     //User user = UserDao.Load(AuthenticationService.CurrentUser.Id);
     //IdNameReadonlyDto dep = GetDepartmentDto(user);
     UserRole role = AuthenticationService.CurrentUser.UserRole;
     AppointmentListModel model = new AppointmentListModel
     {
         //UserId = AuthenticationService.CurrentUser.Id,
         DepartmentName = string.Empty,
         DepartmentId = 0,
         DepartmentReadOnly = false,
     };
     SetInitialDates(model);
     SetDictionariesToReportsModel(model);
     model.IsAddAvailable = (role & UserRole.Manager) == UserRole.Manager;
     model.IsAddForStaffAvailable = role == UserRole.StaffManager;
     //SetInitialStatus(model);
     //SetIsAvailable(model);
     return model;
 }
Esempio n. 7
0
 public void SetDocumentsToModel(AppointmentListModel model, User user)
 {
     UserRole role = AuthenticationService.CurrentUser.UserRole;
     //model.Documents = new List<AppointmentDto>();
     model.Documents = AppointmentDao.GetDocuments(
         user.Id,
         role,
         model.DepartmentId,
         model.ReasonId,
         model.StatusId,
         model.Number,
         model.BeginDate,
         model.EndDate,
         model.UserName,
         model.RecruteFio,
         model.SortBy,
         model.SortDescending);
 }
Esempio n. 8
0
 public void SetDictionariesToReportsModel(AppointmentListModel model)
 {
     model.Statuses = GetAppReportStatuses();
     var employmentBl=Ioc.Resolve<IEmploymentBl>();
     model.EmploymentStatuses = employmentBl.GetEmploymentStatuses();
 }