public int AuthorityroleUpdate(AuthorityroleModel p) { Authorityrole pc = new Authorityrole() { pid = p.Pid, u_oid = p.U_oid, aut_id = p.Aut_id }; return(Update(pc)); }
public ActionResult XiuGai(UsersmanModel um) { if (iub.UsersmanUpdate(um) > 0) { string[] str = Request["rid"].Split(','); int cot = 0; bool flag = false; int t = 0; if (iab.AuthorityroleSel(um.U_oid) > 0) { t = iab.AuthorityroleDel(um.U_oid); flag = true; } //修改角色权限 if ((flag && t > 0) || (!flag)) { //循环添加权限 foreach (var item in str) { AuthorityroleModel rp = new AuthorityroleModel(); rp.Aut_id = item; rp.U_oid = um.U_oid.ToString(); if (iab.AuthorityroleAdd(rp) > 0) { cot++; } } if (cot == str.Length) { Cache ch = this.HttpContext.Cache; ch.Remove("userlist"); Response.Write(1); return(RedirectToAction("Index")); } else { Response.Write(0); return(RedirectToAction("Update", um.U_oid)); } } else { return(RedirectToAction("Update", um.U_oid)); } } else { return(RedirectToAction("Update", um.U_oid)); } }
public List <AuthorityroleModel> AuthorityroleSelect() { List <Authorityrole> list = Select(); List <AuthorityroleModel> list2 = new List <AuthorityroleModel>(); foreach (Authorityrole item in list) { AuthorityroleModel sm = new AuthorityroleModel() { Pid = item.pid, U_oid = item.u_oid, Aut_id = item.aut_id }; list2.Add(sm); } return(list2);; }
public List <AuthorityroleModel> SelectAuthorityroleBy(int id) { MyDbContext db = CreateContext(); List <Authorityrole> list = db.Authorityrole.AsNoTracking() .Where(e => e.pid == id) .Select(e => e) .ToList(); List <AuthorityroleModel> list2 = new List <AuthorityroleModel>(); foreach (Authorityrole item in list) { AuthorityroleModel sm = new AuthorityroleModel() { Pid = item.pid, U_oid = item.u_oid, Aut_id = item.aut_id }; list2.Add(sm); } return(list2);; }
public int AuthorityroleUpdate(AuthorityroleModel sm) { return(ist.AuthorityroleUpdate(sm)); }
public int AuthorityroleAdd(AuthorityroleModel sm) { return(ist.AuthorityroleAdd(sm)); }