public JsonResult GetAllData(int rows, int page) { LoaiCoSoService service = new LoaiCoSoService(); List<LoaiCoSoEntity> loaicosos= new List<LoaiCoSoEntity>(); try { loaicosos= service.GetAll(); return Json(PaginationHelper<LoaiCoSoEntity>.Execute(loaicosos, page, rows), JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); } return Json(null); }
// GET: LoaiCoSo public ActionResult Index() { LoaiCoSoService service = new LoaiCoSoService(); List<LoaiCoSoEntity> loaicosos= new List<LoaiCoSoEntity>(); string result = null; try { loaicosos= service.GetAll(); result = JsonConvert.SerializeObject(loaicosos); RenderResult.RequestCompleted(ViewData, result); } catch (Exception e) { System.Console.WriteLine(e.ToString()); RenderResult.RequestError(ViewData, "Lỗi hệ thống"); } return View(); }
public string GetAllLoaiCoSoChucVu() { string result = "<select>"; LoaiCoSoService lcsService = new LoaiCoSoService(); List<LoaiCoSoEntity> listTT = lcsService.GetAll(); int ttSize = listTT.Count; for (int i = 0; i < ttSize; i++) { result += "<option value =\'" + listTT[i].Id.ToString() + "\'>" + listTT[i].TenLoai + "</option>\n"; } result += "</select>"; return result; }
public JsonResult GetAllIdLoaiCoSo() { string result = null; LoaiCoSoService service = new LoaiCoSoService(); List<LoaiCoSoEntity> lcsEntity = new List<LoaiCoSoEntity>(); try { lcsEntity = service.GetAll(); result = JsonConvert.SerializeObject(lcsEntity); return Json(lcsEntity, JsonRequestBehavior.AllowGet); } catch (Exception e) { System.Console.WriteLine(e.ToString()); return Json(null); } }
public JsonResult GetMaQuyDinh() { LoaiCoSoService service = new LoaiCoSoService(); try { return Json(RenderResult.RequestCompleted(ViewData, GenKey.GenIncrementKey("LCS", 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); } }