public JsonResult GetOrderList(GEPOrderSearchModel model) { if (!ModelState.IsValid) { return Json(new JQGridResult { ErrorMessags = ModelState.Values.SelectMany(m => m.Errors) .Select(e => e.ErrorMessage) .ToList() }); } MongoPagingResult<GEPOrderGridT> GridData = new GEPOrderBiz().GetGEPOrderGridData(model.Page.Value , model.Rows.Value , (int)model.paymentStatus , (int)model.dateBase , Util.GetSafeInt(model.site) , (int)model.searchKind , model.searchKey , model.startDate.Value , model.endDate.Value.AddDays(1) , MemberContext.LoginID); JQGridResult result = new JQGridResult(); result.total = Math.Ceiling(Convert.ToDecimal(Convert.ToDecimal(GridData.Count) / 10)); result.page = model.Page.Value; result.rows = GridData.Result.ToArray(); result.Count = GridData.Count; return Json(result); }
public ActionResult Order(GEPOrderSearchModel model) { IEnumerable<SelectListItem> sites = ViewBag.Sites = new CommonBiz().GetExportSites(); if (!ModelState.IsValid) { model.Initialize(); if (sites.Count() > 0) { model.site = sites.ElementAt(0).Value; } ModelState.Clear(); } return View(model); }