Ejemplo n.º 1
0
        public ActionResult BanButtonAdd(string role_id, string button_id)
        {
            role_id   = RQ("role_id");
            button_id = RQ("button_id");
            var role = _role.Find(role_id);

            if (button_id.HasValue())
            {
                var button = _button.Find(button_id);
                InitForm("禁用按钮");
                return(View(BanButtonAdd_M.ToViewModel(role_id, role.name, button_id, button.name)));
            }
            else
            {
                InitForm("禁用按钮");
                return(View(BanButtonAdd_M.ToViewModel(role_id, role.name)));
            }
        }
Ejemplo n.º 2
0
 public ActionResult BanButtonAdd(BanButtonAdd_M model)
 {
     if (ModelState.IsValid)
     {
         model.role_Button_forbid_id = model.role_id + "-" + model.button_id;
         if (_roleFuncObjForbid.Find(model.role_Button_forbid_id) == null)
         {
             _roleFuncObjForbid.Add(model.ToModel());
             return(Redirect("/Permission/Admin2/BanButtonList?ReportID=Permision.v2_按钮禁用&Params=" + model.role_id));
         }
         else
         {
             return(Alert("操作失败!"));
         }
     }
     else
     {
         InitForm("禁用按钮");
         return(View(model));
     }
 }