Пример #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\"}");
        }
Пример #2
0
        /// <summary>
        /// 删除模板-页面
        /// </summary>
        public void Skin_Del()
        {
            if (!EX_Admin.Power("theme_skin_del", "删除模板页面"))
            {
                AjaxNoPower();
                return;
            }
            if (RequestTool.GetConfigKey("OnlineFileEdit").Trim() != "1")
            {
                AjaxNoPower();
                return;
            }
            int             id    = RequestTool.RequestInt("id", 0);
            Lebi_Theme_Skin model = B_Lebi_Theme_Skin.GetModel(id);

            if (model == null)
            {
                Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}");
                return;
            }
            Log.Add("删除模板-页面", "Theme_Skin", id.ToString(), CurrentAdmin, model.Name);
            B_Lebi_Theme_Skin.Delete(id);
            Response.Write("{\"msg\":\"OK\"}");
        }