public JsonResult GetAllData(int rows, int page) { TrinhDoLyLuanServices service = new TrinhDoLyLuanServices(); List<TrinhDoLyLuanEntity> TrinhDoLyLuans = new List<TrinhDoLyLuanEntity>(); try { TrinhDoLyLuans = service.GetAll(); return Json(PaginationHelper<TrinhDoLyLuanEntity>.Execute(TrinhDoLyLuans, page, rows), JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } return Json(null); }
public JsonResult GetAllDataWithoutPagination() { TrinhDoLyLuanServices service = new TrinhDoLyLuanServices(); List<TrinhDoLyLuanEntity> listTrinhDoLyLuan = new List<TrinhDoLyLuanEntity>(); string result = null; try { listTrinhDoLyLuan = service.GetAll(); result = JsonConvert.SerializeObject(listTrinhDoLyLuan); return Json(RenderResult.RequestCompleted(ViewData, result), JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } return Json(null); }
// GET: TrinhDoLyLuan public ActionResult Index() { TrinhDoLyLuanServices service = new TrinhDoLyLuanServices(); List<TrinhDoLyLuanEntity> listTrinhDoLyLuan = new List<TrinhDoLyLuanEntity>(); string result = null; try { listTrinhDoLyLuan = service.GetAll(); result = JsonConvert.SerializeObject(listTrinhDoLyLuan); RenderResult.RequestCompleted(ViewData, result); } catch (Exception e) { System.Console.WriteLine(e.ToString()); RenderResult.RequestError(ViewData, "Lỗi hệ thống"); } return View(); }
public JsonResult GetMaQuyDinh() { TrinhDoLyLuanServices service = new TrinhDoLyLuanServices(); try { return Json(RenderResult.RequestCompleted(ViewData, GenKey.GenIncrementKey("TDLL", 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); } }