public JsonResult GetAllData(int rows, int page) { ThongTinQuaTrinhCongTacServices service = new ThongTinQuaTrinhCongTacServices(); List<ThongTinQuaTrinhCongTacEntity> thongTinQuaTrinhCongTacs = new List<ThongTinQuaTrinhCongTacEntity>(); try { thongTinQuaTrinhCongTacs = service.GetAll(); return Json(PaginationHelper<ThongTinQuaTrinhCongTacEntity>.Execute(thongTinQuaTrinhCongTacs, page, rows), JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } return Json(null); }
// GET: ThongTinQuaTrinhCongTac public ActionResult Index() { ThongTinQuaTrinhCongTacServices service = new ThongTinQuaTrinhCongTacServices(); List<ThongTinQuaTrinhCongTacEntity> listTTQTCT = new List<ThongTinQuaTrinhCongTacEntity>(); string result = null; try { listTTQTCT = service.GetAll(); result = JsonConvert.SerializeObject(listTTQTCT); RenderResult.RequestCompleted(ViewData, result); } catch (Exception e) { System.Console.WriteLine(e.ToString()); RenderResult.RequestError(ViewData, "Lỗi hệ thống"); } return View(); }