Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("theme_advert_list", "广告位页面列表"))
            {
                PageReturnMsg = PageNoPowerMsg();
            }

            id  = RequestTool.RequestInt("id", 0);
            key = RequestTool.RequestString("key");
            tid = RequestTool.RequestInt("tid", 0);
            adv = B_Lebi_Theme_Advert.GetModel(id);
            if (adv == null)
            {
                adv = new Lebi_Theme_Advert();
            }
            theme = B_Lebi_Theme.GetModel(tid);
            if (theme == null)
            {
                theme = new Lebi_Theme();
            }
            string where = "Theme_Advert_id=" + id;
            if (key != "")
            {
                where += " and (Title like lbsql{'%" + key + "%'} or [URL] like lbsql{'%" + key + "%'})";
            }
            imgs = B_Lebi_Advert.GetList(where, "Sort desc", PageSize, page);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!EX_Admin.Power("advert_edit", "设置广告位"))
     {
         WindowNoPower();
     }
     id    = RequestTool.RequestInt("id", 0);
     tid   = RequestTool.RequestInt("tid", 0);
     theme = B_Lebi_Theme.GetModel(tid);
     if (theme == null)
     {
         PageError();
         return;
     }
     model = B_Lebi_Theme_Advert.GetModel(id);
     if (model == null)
     {
         model          = new Lebi_Theme_Advert();
         model.Theme_id = theme.id;
     }
 }
Beispiel #3
0
        /// <summary>
        /// 编辑广告位
        /// </summary>
        public void Advert_Edit()
        {
            if (!EX_Admin.Power("advert_edit", "设置广告位"))
            {
                AjaxNoPower();
                return;
            }
            int    id       = RequestTool.RequestInt("id", 0);
            int    Theme_id = RequestTool.RequestInt("Theme_id", 0);
            string code     = RequestTool.RequestString("Code");
            int    count    = B_Lebi_Theme_Advert.Counts("Theme_id=" + Theme_id + " and Code=lbsql{'" + code + "'} and id!=" + id + "");

            if (count > 0)
            {
                Response.Write("{\"msg\":\"代码已存在\"}");
                return;
            }
            Lebi_Theme        theme = B_Lebi_Theme.GetModel(Theme_id);
            Lebi_Theme_Advert model = B_Lebi_Theme_Advert.GetModel(id);

            if (model == null)
            {
                model = new Lebi_Theme_Advert();
                model = B_Lebi_Theme_Advert.BindForm(model);
                B_Lebi_Theme_Advert.Add(model);
            }
            else
            {
                model = B_Lebi_Theme_Advert.BindForm(model);
                B_Lebi_Theme_Advert.Update(model);
            }
            string action = Tag("设置广告位");

            Log.Add(action, "Theme_Advert", model.id.ToString(), CurrentAdmin);
            Response.Write("{\"msg\":\"OK\",\"id\":\"" + id + "\"}");
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!EX_Admin.Power("advertimage_edit", "编辑广告"))
            {
                PageNoPower();
            }
            int id  = RequestTool.RequestInt("id", 0);
            int aid = RequestTool.RequestInt("aid");

            advert = B_Lebi_Theme_Advert.GetModel(aid);
            if (advert == null)
            {
                PageError();
                return;
            }
            theme = B_Lebi_Theme.GetModel(advert.Theme_id);
            model = B_Lebi_Advert.GetModel(id);
            if (model == null)
            {
                model = new Lebi_Advert();
                model.Theme_Advert_Code = advert.Code;
                model.Theme_Advert_id   = advert.id;
            }
        }