Exemplo n.º 1
0
 public ActionResult PrintDeductionList(string beginDate,string endDate, int? departmentId,
             int? requestStatusId, int? typeId, string userName, int? sortBy, bool? sortDescending)
 {
     DeductionListModel model = new DeductionListModel
                                    {
                                        BeginDate = parseDateTime(beginDate),
                                        EndDate = parseDateTime(endDate),
                                        DepartmentId = departmentId.HasValue?departmentId.Value:0,
                                        RequestStatusId = requestStatusId.HasValue?requestStatusId.Value:0,
                                        TypeId = typeId.HasValue?typeId.Value:0,
                                        UserName = string.IsNullOrEmpty(userName)?string.Empty:Server.UrlDecode(userName),
                                        SortBy = sortBy.HasValue?sortBy.Value:0,
                                        SortDescending = sortDescending.HasValue?sortDescending.Value:new bool?(),
                                    };
     RequestBl.SetDeductionListModel(model, !ValidateModel(model));
     return View(model);
 }
Exemplo n.º 2
0
 protected bool ValidateModel(DeductionListModel model)
 {
     if (model.BeginDate.HasValue && model.EndDate.HasValue &&
         model.BeginDate.Value > model.EndDate.Value)
         ModelState.AddModelError("BeginDate", "Дата в поле <Период с> не может быть больше даты в поле <по>.");
     return ModelState.IsValid;
 }
Exemplo n.º 3
0
 public ActionResult Index(DeductionListModel model)
 {
     RequestBl.SetDeductionListModel(model, !ValidateModel(model));
     return View(model);
 }