Exemplo n.º 1
0
        /// <summary>
        /// 删除模板
        /// </summary>
        public void Theme_Del()
        {
            if (!EX_Admin.Power("theme_del", "删除模板"))
            {
                EX_Admin.NoPower();
                return;
            }
            int        id    = RequestTool.RequestInt("id", 0);
            Lebi_Theme model = B_Lebi_Theme.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            int count = B_Lebi_Language.Counts("Theme_id=" + model.id + "");

            if (count > 0)
            {
                Response.Write("{\"msg\":\"" + Tag("模板正在使用中,不能删除") + "\"}");
                return;
            }
            Log.Add("删除模板", "Theme", id.ToString(), CurrentAdmin, model.Name);
            B_Lebi_Theme.Delete(id);
            B_Lebi_Theme_Advert.Delete("Theme_id=" + id + "");
            B_Lebi_Theme_Skin.Delete("Theme_id=" + id + "");
            B_Lebi_Advert.Delete("Theme_id=" + id + "");

            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 2
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\"}");
        }
Exemplo n.º 3
0
        /// <summary>
        /// 删除自定义结点
        /// </summary>
        public void UserNode_Del()
        {
            if (!EX_Admin.Power("node_del", "删除自定义结点"))
            {
                EX_Admin.NoPower();
                return;
            }
            string ids      = RequestTool.RequestString("ids");
            string PageCode = RequestTool.RequestString("PageCode");

            if (ids != "")
            {
                List <Lebi_Node> nodes = B_Lebi_Node.GetList("id in (lbsql{" + ids + "})", "");
                foreach (Lebi_Node node in nodes)
                {
                    B_Lebi_Node.Delete("id=" + node.id + " or parentid=" + node.id + "");
                    B_Lebi_Page.Delete("Node_id=" + node.id + "");
                }

                string action      = Tag("删除自定义结点");
                string description = "";
                Log.Add(action, "Node", ids, CurrentAdmin, description);
            }
            if (PageCode == "P_Help")
            {
                Lebi_Theme_Page themepage = B_Lebi_Theme_Page.GetModel("Code='P_Help'");
                if (themepage.Type_id_PublishType == 122)
                {
                    PageStatic.Greate_Help(themepage);
                }
            }
            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 4
0
        /// <summary>
        /// 删除一个菜单
        /// </summary>
        public void Menu_Del()
        {
            if (!EX_Admin.Power("admin_menu_edit", "编辑菜单"))
            {
                EX_Admin.NoPower();
                return;
            }
            int       id    = RequestTool.RequestInt("id", 0);
            Lebi_Menu model = B_Lebi_Menu.GetModel(id);

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

            Log.Add(action, "Admin_Power", id.ToString(), CurrentAdmin, "");
            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 5
0
        /// <summary>
        /// 删除结点
        /// </summary>
        public void Node_Del()
        {
            if (!EX_Admin.Power("node_del", "删除结点"))
            {
                EX_Admin.NoPower();
                return;
            }
            int       id    = RequestTool.RequestInt("id", 0);
            Lebi_Node model = B_Lebi_Node.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg" + Tag("参数错误") + "\"}");
                return;
            }
            string action      = Tag("删除结点");
            string description = Shop.Bussiness.Language.Content(model.Name, "CN");

            Log.Add(action, "Node", id.ToString(), CurrentAdmin, description);
            B_Lebi_Node.Delete(id);
            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 6
0
        /// <summary>
        /// 编辑后台菜单
        /// </summary>
        public void Menu_Edit()
        {
            if (!EX_Admin.Power("admin_menu_edit", "编辑菜单"))
            {
                EX_Admin.NoPower();
                return;
            }
            int    id         = RequestTool.RequestInt("id", 0);
            int    pid        = RequestTool.RequestInt("pid", 0);
            int    parentid   = RequestTool.RequestInt("parentid", 0);
            string parentCode = "";

            if (parentid > 0)
            {
                Lebi_Menu parent = B_Lebi_Menu.GetModel(parentid);
                parentCode = parent.Code;
            }
            Lebi_Menu model = B_Lebi_Menu.GetModel(id);

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

            Log.Add(action, "Admin_Power", id.ToString(), CurrentAdmin, model.Name);
            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 7
0
        /// <summary>
        /// 编辑管理员桌面菜单
        /// </summary>
        public void SaveIndexMenu()
        {
            if (!EX_Admin.Power("admin_menu_edit", "编辑菜单"))
            {
                EX_Admin.NoPower();
                return;
            }
            string           ids   = RequestTool.RequestString("id");
            int              gid   = RequestTool.RequestInt("gid", 0);
            Lebi_Admin_Group group = B_Lebi_Admin_Group.GetModel(gid);

            if (group == null)
            {
                Response.Write("{\"msg" + Tag("参数错误") + "\"}");
                return;
            }
            group.Menu_ids_index = ids;
            B_Lebi_Admin_Group.Update(group);
            string action      = Tag("编辑桌面菜单");
            string description = Shop.Bussiness.Language.Content(group.Name, "CN");

            Log.Add(action, "Admin_Power", gid.ToString(), CurrentAdmin, description);
            Response.Write("{\"msg\":\"OK\"}");
        }
Exemplo n.º 8
0
        /// <summary>
        /// 保存权限
        /// </summary>
        public void SavePower()
        {
            if (!EX_Admin.Power("admin_limit_edit", "编辑权限"))
            {
                EX_Admin.NoPower();
                return;
            }
            string           ids   = RequestTool.RequestString("id");
            int              gid   = RequestTool.RequestInt("gid", 0);
            Lebi_Admin_Group group = B_Lebi_Admin_Group.GetModel(gid);

            if (group == null)
            {
                Response.Write("{\"msg" + Tag("参数错误") + "\"}");
                return;
            }
            B_Lebi_Admin_Power.Delete("Admin_Group_id=" + group.id + "");
            List <Lebi_Admin_Limit> models = B_Lebi_Admin_Limit.GetList("id in (lbsql{" + ids + "})", "");

            if (models != null)
            {
                Lebi_Admin_Power p = new Lebi_Admin_Power();
                foreach (Lebi_Admin_Limit model in models)
                {
                    p.Admin_Group_id   = group.id;
                    p.Admin_Limit_Code = model.Code;
                    p.Admin_Limit_id   = model.id;
                    B_Lebi_Admin_Power.Add(p);
                }
            }
            string action      = Tag("编辑权限");
            string description = Shop.Bussiness.Language.Content(group.Name, "CN");

            Log.Add(action, "Admin_Power", gid.ToString(), CurrentAdmin, description);
            Response.Write("{\"msg\":\"OK\"}");
        }