Esempio n. 1
0
        public ActionResult Save([ModelBinder(typeof(JsonBinder <List <string> >))] List <string> List, string roleNum)
        {
            PowerProvider provider = new PowerProvider();
            int           line     = provider.AllotPower(roleNum, List);

            if (line > 0)
            {
                this.ReturnJson.AddProperty("d", "success");
            }
            else
            {
                this.ReturnJson.AddProperty("d", "");
            }
            return(Content(this.ReturnJson.ToString()));
        }
Esempio n. 2
0
        /// <summary>
        /// 保存权限分配
        /// </summary>
        /// <returns></returns>
        public ActionResult SavePower()
        {
            string        CompanyID  = WebUtil.GetFormValue <string>("CompanyID", string.Empty);
            string        RoleNum    = WebUtil.GetFormValue <string>("RoleNum", string.Empty);
            List <string> listItems  = WebUtil.GetFormObject <List <string> >("List");
            PowerProvider provider   = new PowerProvider(CompanyID);
            int           line       = provider.AllotPower(RoleNum, listItems);
            DataResult    dataResult = new DataResult();

            if (line > 0)
            {
                dataResult.Code    = (int)EResponseCode.Success;
                dataResult.Message = "权限分配成功";
            }
            else
            {
                dataResult.Code    = (int)EResponseCode.Exception;
                dataResult.Message = "权限分配失败";
            }
            return(Content(JsonHelper.SerializeObject(dataResult)));
        }