public ActionResult TableServerSideGetData(int pageIndex, int pageSize, string filter = "") { var db = new OrganizationUnitDAL(); int?total = 0; var baseListParam = new BaseListParam() { FilterField = filter, OrderByField = "", UserType = Global.CurrentUser.RoleId, UserId = Global.CurrentUser.LoginUserId, DeptId = Global.CurrentUser.OrganizationUnitID, PageIndex = pageIndex, PageSize = pageSize, LanguageCode = Global.CurrentUser.CurrentLanguageID.ToString() }; var result = db.GetOrganizationUnit(baseListParam, out total); var lstTotal = new TableColumnsTotalModel(); lstTotal.Total1 = "15"; lstTotal.Total2 = "25"; lstTotal.Total3 = "35"; return(Content(JsonConvert.SerializeObject(new { employees = result, totalCount = total, lstTotal = lstTotal }))); }
public ActionResult GetListDepartment(int pageIndex = 1, int pageSize = 500, string filter = "") { var db = new OrganizationUnitDAL(); int?total = 0; var baseListParam = new BaseListParam() { FilterField = filter, OrderByField = "", UserType = Global.CurrentUser.RoleId, UserId = Global.CurrentUser.LoginUserId, DeptId = Global.CurrentUser.OrganizationUnitID, PageIndex = pageIndex, PageSize = pageSize, LanguageCode = Global.CurrentUser.CurrentLanguageID.ToString() }; var result = db.GetOrganizationUnit(baseListParam, out total);; var list = JsonConvert.SerializeObject(result, Formatting.None, new JsonSerializerSettings() { ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore }); return(Content(list, "application/json")); }