Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ZoomLa.Common.function.AccessRulo();
            string action = "添加广告内容";

            if (!IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                if (!B_ARoleAuth.Check(ZoomLa.Model.ZLEnum.Auth.other, "ADManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                listbind();
                txtOverdueDate.Text = DateTime.Now.AddYears(1).ToString("yyyy-MM-dd");
                //this.InitJSScript();
                string id = base.Request.QueryString["ADId"];
                if (string.IsNullOrEmpty(id))
                {
                    id = "0";
                    this.HdnID.Value = id;
                    action           = "添加广告内容";
                    this.Label1.Text = "添加广告内容";
                    string ZoneIDs = base.Request.QueryString["ZoneId"];
                    if (!string.IsNullOrEmpty(ZoneIDs))
                    {
                        this.SetLstZoneNameSelected(ZoneIDs);
                    }
                }
                else
                {
                    this.HdnID.Value = id;
                    this.Label1.Text = "修改广告";
                    M_Advertisement adv = B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(id));
                    this.TxtADName.Text      = adv.ADName;
                    this.TxtPriority.Text    = adv.Priority.ToString();
                    this.txtOverdueDate.Text = adv.OverdueDate.ToString("yyyy-MM-dd");
                    this.InitRadlAdType(adv.ADType);
                    this.InitShowPanel(adv);
                    this.SetLstZoneNameSelected(B_Advertisement.GetZoneIDByAd(adv.ADID));
                    this.ChkCountClick.Checked = adv.CountClick;
                    this.ChkCountView.Checked  = adv.CountView;
                    this.TxtClicks.Text        = adv.Clicks.ToString();
                    this.TxtViews.Text         = adv.Views.ToString();
                    ChkPasses.Checked          = adv.Passed;
                    if (adv.ADType > 0)
                    {
                        this.ChkCountClick.Enabled = false;
                        this.TxtClicks.Enabled     = false;
                    }
                    this.Price.Text = Math.Round(adv.Price, 2).ToString();
                    ADBuy.Checked   = adv.ADBuy == 1 ? true : false;
                    action          = "<a href='Advertisement.aspx?ADId=" + id + "'>修改广告</a>[" + adv.ADName + "]";
                }
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ADManage.aspx'>广告管理</a></li><li class='active'>" + action + "</li>" + Call.GetHelp(29));
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         listbind();
         this.InitJSScript();
         string id = base.Request.QueryString["ADId"];
         if (string.IsNullOrEmpty(id))
         {
             id = "0";
             this.HdnID.Value = id;
             this.Label1.Text = "添加广告";
             string ZoneIDs = base.Request.QueryString["ZoneId"];
             if (!string.IsNullOrEmpty(ZoneIDs))
             {
                 this.SetLstZoneNameSelected(ZoneIDs);
             }
             this.txtOverdueDate.Text = DateTime.Now.AddDays(30).ToString("yyyy-MM-dd");
         }
         else
         {
             this.HdnID.Value = id;
             this.Label1.Text = "修改广告";
             M_Advertisement adv = B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(id));
             this.TxtADName.Text      = adv.AdName;
             this.TxtPriority.Text    = adv.Priority.ToString();
             this.txtOverdueDate.Text = adv.OverdueDate.ToString("yyyy-MM-dd");
             this.InitRadlAdType(adv.AdType);
             this.InitShowPanel(adv);
             this.SetLstZoneNameSelected(B_Advertisement.GetZoneIDByAd(adv.AdId));
             this.ChkCountClick.Checked = adv.CountClick;
             this.ChkCountView.Checked  = adv.CountView;
             this.TxtClicks.Text        = adv.Clicks.ToString();
             this.TxtViews.Text         = adv.Views.ToString();
             if (adv.AdType > 0)
             {
                 this.ChkCountClick.Enabled = false;
                 this.TxtClicks.Enabled     = false;
             }
         }
     }
 }