public ActionResult Index(int id) { var model = new IndexVM(); DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>(); DM_NHOMDANHMUCBusiness = Get <DM_NHOMDANHMUCBusiness>(); var searchmodel = new DM_DANHMUC_DATA_SEARCHBO(); SessionManager.SetValue("dmdanhmucdataSearchModel", null); model.lstData = DM_DANHMUC_DATABusiness.GetDaTaByPage(id, null); model.DanhMuc = DM_NHOMDANHMUCBusiness.Find(id); return(View(model)); }
public JsonResult getData(int id, int indexPage, string sortQuery, int pageSize) { DM_DANHMUC_DATABusiness = Get <DM_DANHMUC_DATABusiness>(); var searchModel = SessionManager.GetValue("dmdanhmucdataSearchModel") as DM_DANHMUC_DATA_SEARCHBO; if (!string.IsNullOrEmpty(sortQuery)) { if (searchModel == null) { searchModel = new DM_DANHMUC_DATA_SEARCHBO(); } searchModel.sortQuery = sortQuery; if (pageSize > 0) { searchModel.pageSize = pageSize; } SessionManager.SetValue("dmdanhmucdataSearchModel", searchModel); } var data = DM_DANHMUC_DATABusiness.GetDaTaByPage(id, searchModel, indexPage, pageSize); return(Json(data)); }