public int UsersmanUpdate(UsersmanModel p) { Usersman pc = new Usersman() { u_oid = p.U_oid, u_name1 = p.U_name1, u_sm = p.U_sm, u_sf = p.U_sf }; return(Update(pc)); }
public ActionResult Adds(UsersmanModel um) { if (iub.UsersmanAdd(um) > 0) { Cache ch = this.HttpContext.Cache; ch.Remove("userlist"); return(RedirectToAction("Index")); } else { return(View(um)); } }
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)); } }
/// <summary> /// 角色删除 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Del(int id) { UsersmanModel um = new UsersmanModel(); um.U_oid = id; if (iub.UsersmanDelete(um) > 0) { Cache ch = this.HttpContext.Cache; ch.Remove("userlist"); return(RedirectToAction("Index")); } else { return(View(um)); } }
public List <UsersmanModel> UsersmanSelect() { List <Usersman> list = Select(); List <UsersmanModel> list2 = new List <UsersmanModel>(); foreach (Usersman item in list) { UsersmanModel sm = new UsersmanModel() { U_oid = item.u_oid, U_name1 = item.u_name1, U_sm = item.u_sm, U_sf = item.u_sf }; list2.Add(sm); } return(list2);; }
public List <UsersmanModel> SelectUsersmanBy(int id) { MyDbContext db = CreateContext(); List <Usersman> list = db.Usersman.AsNoTracking() .Where(e => e.u_oid == id) .Select(e => e) .ToList(); List <UsersmanModel> list2 = new List <UsersmanModel>(); foreach (Usersman item in list) { UsersmanModel sm = new UsersmanModel() { U_oid = item.u_oid, U_name1 = item.u_name1, U_sm = item.u_sm, U_sf = item.u_sf }; list2.Add(sm); } return(list2); }
public List <UsersmanModel> UsersmanFenYe(int currentPage, int PageSize, out int rows) { var list = CreateContext().Usersman.AsNoTracking().OrderBy(e => e.u_oid).ToList(); rows = list.Count(); var data = list .Skip((currentPage - 1) * PageSize) .Take(PageSize) .ToList(); List <UsersmanModel> list2 = new List <UsersmanModel>(); foreach (var p in data) { UsersmanModel e = new UsersmanModel() { U_oid = p.u_oid, U_name1 = p.u_name1, U_sm = p.u_sm, U_sf = p.u_sf }; list2.Add(e); } return(list2); }
public int UsersmanUpdate(UsersmanModel sm) { return(ist.UsersmanUpdate(sm)); }
public int UsersmanDelete(UsersmanModel sm) { return(ist.UsersmanDelete(sm)); }
public int UsersmanAdd(UsersmanModel sm) { return(ist.UsersmanAdd(sm)); }