Beispiel #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\"}");
        }
Beispiel #2
0
        /// <summary>
        /// 删除一个广告位
        /// </summary>
        public void Advert_Del()
        {
            if (!EX_Admin.Power("advert_del", "删除广告位"))
            {
                AjaxNoPower();
                return;
            }
            int id = RequestTool.RequestInt("id", 0);

            B_Lebi_Theme_Advert.Delete(id);
            B_Lebi_Advert.Delete("Theme_Advert_id=" + id + "");
            string action = Tag("删除广告位");

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