Beispiel #1
0
        /// <summary>
        /// 删除一个菜单
        /// </summary>
        public void Menu_Del()
        {
            if (!EX_Admin.Power("supplier_group_edit", "编辑商家分组"))
            {
                AjaxNoPower();
                return;
            }
            int id = RequestTool.RequestInt("id", 0);
            Lebi_Supplier_Menu model = B_Lebi_Supplier_Menu.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg" + Tag("参数错误") + "\"}");
                return;
            }
            else
            {
                if (model.IsSYS == 0)
                {
                    B_Lebi_Supplier_Menu.Delete(id);
                }
            }
            string action = Tag("删除菜单");

            Log.Add(action, "Supplier_Menu", id.ToString(), CurrentAdmin, "");
            Response.Write("{\"msg\":\"OK\"}");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("supplier_menu_edit", "编辑菜单"))
            {
                WindowNoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int pid = RequestTool.RequestInt("pid", 0);

            model = B_Lebi_Supplier_Menu.GetModel(id);
            if (model == null)
            {
                model          = new Lebi_Supplier_Menu();
                model.parentid = pid;
                model.Isshow   = 1;
            }
            else
            {
                pid = model.parentid;
            }
            pmodel = B_Lebi_Supplier_Menu.GetModel(pid);
            if (pmodel == null)
            {
                pmodel      = new Lebi_Supplier_Menu();
                pmodel.Name = "-";
            }
        }
Beispiel #3
0
        /// <summary>
        /// 编辑后台菜单
        /// </summary>
        public void Menu_Edit()
        {
            if (!EX_Admin.Power("supplier_menu_edit", "编辑菜单"))
            {
                EX_Admin.NoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int pid = RequestTool.RequestInt("pid", 0);
            Lebi_Supplier_Menu model = B_Lebi_Supplier_Menu.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Supplier_Menu();
                B_Lebi_Supplier_Menu.BindForm(model);
                model.Isshow = 1;
                B_Lebi_Supplier_Menu.Add(model);
            }
            else
            {
                B_Lebi_Supplier_Menu.BindForm(model);
                B_Lebi_Supplier_Menu.Update(model);
            }
            ImageHelper.LebiImagesUsed(model.Image, "menu", id);
            string action = Tag("编辑菜单");

            Log.Add(action, "Supplier_Menu", id.ToString(), CurrentAdmin, model.Name);
            Response.Write("{\"msg\":\"OK\"}");
        }