public JsonResult GetSysRoleList(int?pageIndex, int?pageSize, string RoleName) { SysRoleBll bll = new SysRoleBll(); int recordCounts = 0; var result = bll.GetSysRoleList(pageIndex, pageSize, RoleName, ref recordCounts); return(Json(new { messCode = 200, recordCount = recordCounts, data = result })); }
public ActionResult RoleOperation(string data) { SysRoleModel sysRole = JsonConvert.DeserializeObject <SysRoleModel>(data); SysRoleBll bll = new SysRoleBll(); if (sysRole.RowID == null || sysRole.RowID == 0) { //新增操作 bll.InsertData(sysRole); } else { //编辑操作 bll.UpData(sysRole); } return(Json(new { msgCode = 200 })); }
public ActionResult DelRole(string rowid) { if (!string.IsNullOrEmpty(rowid)) { var list = rowid.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); SysRoleBll bll = new SysRoleBll(); foreach (string t in list) { try { bll.DelData(Convert.ToInt32(t)); } catch (Exception ex) { } } return(Json(new { msgCode = 200 })); } else { return(Json(new { msgCode = 500 })); } }