public ActionResult Succeed(RolePermission pope) { PermissionEntities perEntities = new PermissionEntities(); perEntities.RolePermission.Add(pope); perEntities.SaveChanges(); return(Redirect("/RolePermission_Zhang_/List")); }
public ActionResult Succeed(User user) { PermissionEntities perEntities = new PermissionEntities(); perEntities.User.Add(user); perEntities.SaveChanges(); return(Redirect("/User_Zhang_/List")); }
public ActionResult Succeed(RoleTable po) { PermissionEntities perEntities = new PermissionEntities(); perEntities.RoleTable.Add(po); perEntities.SaveChanges(); return(Redirect("/Role_Zhang_/List")); //return View(); }
public ActionResult Succeed(Permission per) { PermissionEntities perEntities = new PermissionEntities(); perEntities.Permission.Add(per); perEntities.SaveChanges(); return(Redirect("/Permission_Zhang_/List")); //return View(); }
public ActionResult Delete(RolePermission pope) { PermissionEntities perEntities = new PermissionEntities(); System.Data.Entity.Infrastructure.DbEntityEntry entityEntry = perEntities.Entry(pope); entityEntry.State = System.Data.Entity.EntityState.Deleted; perEntities.SaveChanges(); return(Redirect("/RolePermission_Zhang_/List")); }
public ActionResult Updata(RoleTable po) { if (po.Name != "") { //声明数据库上下文类 PermissionEntities perEntities = new PermissionEntities(); System.Data.Entity.Infrastructure.DbEntityEntry entityEntry = perEntities.Entry(po); entityEntry.State = System.Data.Entity.EntityState.Modified; perEntities.SaveChanges(); } else { return(Content("名称为空")); } return(Redirect("/Role_Zhang_/List")); }
public ActionResult Updata(RolePermission pope) { if (pope.RoleID != null || pope.PermissionID != null) { pope.ID = sId; //声明数据库上下文类 PermissionEntities perEntities = new PermissionEntities(); System.Data.Entity.Infrastructure.DbEntityEntry entityEntry = perEntities.Entry(pope); entityEntry.State = System.Data.Entity.EntityState.Modified; perEntities.SaveChanges(); } else { return(Content("名称为空")); } return(Redirect("/RolePermission_Zhang_/List")); }
public ActionResult Updata(User user) { if (user.Name != "") { user.ID = sId; //声明数据库上下文类 PermissionEntities perEntities = new PermissionEntities(); System.Data.Entity.Infrastructure.DbEntityEntry entityEntry = perEntities.Entry(user); entityEntry.State = System.Data.Entity.EntityState.Modified; perEntities.SaveChanges(); } else { return(Content("名称为空")); } return(Redirect("/User_Zhang_/List")); }