Пример #1
0
        /// <summary>
        /// 编辑权限-编辑过滤页面
        /// </summary>
        public void Admin_url_Edit()
        {
            if (!EX_Admin.Power("admin_url_edit", "编辑过滤页面"))
            {
                AjaxNoPower();
                return;
            }
            int              id    = RequestTool.RequestInt("id", 0);
            int              gid   = RequestTool.RequestInt("gid", 0);
            string           url   = RequestTool.RequestString("Url");
            Lebi_Admin_Group group = B_Lebi_Admin_Group.GetModel(gid);

            if (url == "")
            {
                Response.Write("{\"msg\":\"" + Tag("地址不能为空") + "\"}");
                return;
            }
            if (group == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            Lebi_Admin_Power p = B_Lebi_Admin_Power.GetModel(id);

            if (p == null)
            {
                p = B_Lebi_Admin_Power.GetList("Admin_Group_id=" + group.id + " and Url=lbsql{'" + url + "'}", "").FirstOrDefault();
                if (p != null)
                {
                    Response.Write("{\"msg\":\"" + Tag("地址已经存在") + "\"}");
                    return;
                }
                p = new Lebi_Admin_Power();
                p.Admin_Group_id = group.id;
                p.Url            = url;
                B_Lebi_Admin_Power.Add(p);
                string action      = Tag("添加过滤页面");
                string description = url;
                Log.Add(action, "Admin_Power", p.id.ToString(), CurrentAdmin, description);
            }
            else
            {
                p.Url = url;
                B_Lebi_Admin_Power.Update(p);
                string action      = Tag("编辑过滤页面");
                string description = url;
                Log.Add(action, "Admin_Power", p.id.ToString(), CurrentAdmin, description);
            }

            Response.Write("{\"msg\":\"OK\"}");
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("admin_url_edit", "编辑过滤页面"))
            {
                WindowNoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int gid = RequestTool.RequestInt("gid", 0);

            model = B_Lebi_Admin_Power.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Admin_Power();
            }
            else
            {
                gid = model.Admin_Group_id;
            }
            group = B_Lebi_Admin_Group.GetModel(gid);
        }