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