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