コード例 #1
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"));
        }
コード例 #2
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"));
        }
コード例 #3
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"));
        }
コード例 #4
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"));
        }