示例#1
0
        public ActionResult Succeed(RolePermission pope)
        {
            PermissionEntities perEntities = new PermissionEntities();

            perEntities.RolePermission.Add(pope);
            perEntities.SaveChanges();
            return(Redirect("/RolePermission_Zhang_/List"));
        }
示例#2
0
        public ActionResult Succeed(User user)
        {
            PermissionEntities perEntities = new PermissionEntities();

            perEntities.User.Add(user);
            perEntities.SaveChanges();
            return(Redirect("/User_Zhang_/List"));
        }
示例#3
0
        public ActionResult Succeed(RoleTable po)
        {
            PermissionEntities perEntities = new PermissionEntities();

            perEntities.RoleTable.Add(po);
            perEntities.SaveChanges();
            return(Redirect("/Role_Zhang_/List"));
            //return View();
        }
示例#4
0
        public ActionResult Succeed(Permission per)
        {
            PermissionEntities perEntities = new PermissionEntities();

            perEntities.Permission.Add(per);
            perEntities.SaveChanges();
            return(Redirect("/Permission_Zhang_/List"));
            //return View();
        }
示例#5
0
        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"));
        }
示例#6
0
        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"));
        }
示例#7
0
        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"));
        }
示例#8
0
        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"));
        }