public JsonResult GetAllData(int rows, int page) { CoSoServices service = new CoSoServices(); List<CoSoEntity> listCoso = new List<CoSoEntity>(); try { listCoso = service.GetAll(); return Json(PaginationHelper<CoSoEntity>.Execute(listCoso, page, rows), JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } return Json(null); }
// GET: CoSo public ActionResult Index() { CoSoServices service = new CoSoServices(); List<CoSoEntity> listCoSo = new List<CoSoEntity>(); string result = null; try { listCoSo = service.GetAll(); result = JsonConvert.SerializeObject(listCoSo); RenderResult.RequestCompleted(ViewData, result); } catch (Exception e) { System.Console.WriteLine(e.ToString()); RenderResult.RequestError(ViewData, "Lỗi hệ thống"); } return View(); }
public JsonResult GetAllIdCoSo() { string result = null; CoSoServices service = new CoSoServices(); List<CoSoEntity> csEntity = new List<CoSoEntity>(); try { csEntity = service.GetAll(); result = JsonConvert.SerializeObject(csEntity); return Json(csEntity, JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); return Json(null); } }
public JsonResult GetMaQuyDinh() { CoSoServices service = new CoSoServices(); try { return Json(RenderResult.RequestCompleted(ViewData, GenKey.GenIncrementKey("CS", 3, service.GetAll().Count)), JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); return Json(RenderResult.RequestError(ViewData, "Lỗi xảy ra"), JsonRequestBehavior.AllowGet); } }