public JsonResult SelectRows_chucvu(ChucDanhModels model) { ChucDanhModels param = new ChucDanhModels(); DanhmucServices service = new DanhmucServices(); List <ChucDanhModels> lstResult = service.SelectRows_chucvu(param); StringBuilder sbResult = new StringBuilder(); StringBuilder sbRows = new StringBuilder(); if (lstResult.Count > 0) { string strSTT = ""; int i = 1; foreach (var item in lstResult) { strSTT = i.ToString(); sbRows.Append(PrepareDataJson_chucvu(item, strSTT)); i++; } if (sbRows.Length > 0) { sbRows.Remove(sbRows.Length - 1, 1); } } sbResult.Append("{"); sbResult.Append("\"isHeader\":\"" + "111" + "\","); sbResult.Append("\"currentRow\":\"" + lstResult.Count + "\","); sbResult.Append("\"Pages\":\"" + lstResult.Count + "\","); if (model.machucdanh.ToString() != "0") { sbResult.Append("\"SubRow\":\"" + "true" + "\","); sbResult.Append("\"RowID\":\"" + model.machucdanh + "\","); } sbResult.Append("\"data\":[" + sbRows.ToString() + "]"); sbResult.Append("}"); return(Json(sbResult.ToString(), JsonRequestBehavior.AllowGet)); }
// // GET: /Account/Manage public ActionResult Manage() { if (!IsLogged()) { return(BackToLogin()); } DonViServices donViSer = new DonViServices(); PhongBanServices phongBanSer = new PhongBanServices(); PhongBanServices CongTruonger = new PhongBanServices(); DanhmucServices chucdanhser = new DanhmucServices(); ManageUserViewModel model = PrepareManageUserViewModel(CongTruonger.SelectRows2(new PhongBanModels()), phongBanSer.SelectRows(new PhongBanModels()), donViSer.SelectRows(new DonviModels()), chucdanhser.SelectRows_chucvu(new ChucDanhModels())); return(View(model)); }