Пример #1
0
        public ActionResult GetData()
        {
            var viewmodle = new RolesViewModle();

            this.GetCmp <Store>("storedata").LoadPage(viewmodle.pageindex);
            this.GetCmp <Store>("storedata").LoadData(viewmodle.data);
            return(this.Direct());
        }
Пример #2
0
        public ActionResult authority(string roleid)
        {
            string name = new RolesViewModle().db.T_PE_Roles.Find(roleid).Description;

            ViewBag.name       = string.Format("授权给:{0}", name);
            TempData["roleid"] = roleid;
            return(View(new RolesViewModle().LoadNodes(roleid)));
        }
Пример #3
0
        public ActionResult Detail(T_PE_Roles obj)
        {
            T_PE_Roles obj_or = new RolesViewModle().db.T_PE_Roles.Find(obj.RoleID);

            foreach (var item in typeof(T_PE_Roles).GetProperties())
            {
                item.SetValue(obj_or, item.GetValue(obj, null), null);
            }
            return(this.Direct(new RolesViewModle().update(obj_or)));
        }
Пример #4
0
 public ActionResult SaveUsers(string users, string roleid)
 {
     if (roleid.IsNotEmpty())
     {
         RolesViewModle roles = new RolesViewModle();
         if (roles.AddUsersToRole(users.JsonToList <dynamic>(), roleid))
         {
             return(this.Direct());
         }
     }
     return(this.Direct(false));
 }
Пример #5
0
        public ActionResult SubmitNodes(SubmittedNode data)
        {
            object roleid = TempData.Peek("roleid");

            if (roleid == null)
            {
                return(this.Direct(false, "找不到角色,无法进行授权操作!"));
            }
            else
            {
                try
                {
                    RolesViewModle modle = new RolesViewModle();
                    modle.GrandAuthority(data, roleid.ToString());
                    this.GetCmp <TreePanel>("treepanel").SetRootNode(new RolesViewModle().LoadNodes(roleid.ToString()));
                    X.Msg.Alert("页面消息", "权限设置已保存!").Show();
                }
                catch (Exception e)
                {
                    return(this.Direct(false, e.Message));
                }
                return(this.Direct());
            }
        }