protected void Page_Load(object sender, EventArgs e)
        {
            int zoneId = DataConverter.CLng(base.Request.QueryString["ZoneID"]);

            if (string.Compare(base.Request.QueryString["Type"], "Zone", true) == 0)
            {
                if (B_Advertisement.GetADList(zoneId).Count == 0)
                {
                    this.ShowJS.InnerHtml = "广告版位中暂无广告信息";
                }
                else
                {
                    M_Adzone adZoneById = B_ADZone.getAdzoneByZoneId(zoneId);
                    string   adpath     = SiteConfig.SiteOption.AdvertisementDir + "/" + adZoneById.ZoneJSName.Replace(" ", "") + "?temp=" + function.GetRandomString(6);
                    if (!adZoneById.IsNull)
                    {
                        this.ShowJS.InnerHtml = "<script type=\"text/javascript\" src='" + adpath + "'></script>";
                    }
                }
            }
            else
            {
                this.ShowAd();
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ADManage.aspx'>广告管理</a></li><li class='active'>预览版位JS效果</li>");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                B_Admin badmin = new B_Admin();
                if (!B_ARoleAuth.Check(ZLEnum.Auth.other, "ADManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                string ChartID = base.Request.QueryString["ChartID"];
                chart = B_ADZone.getChartByChartID(DataConverter.CLng(ChartID));
                int    ChartWidth  = chart.ChartWidth;
                int    ChartHeight = chart.ChartHeight;
                string ChartTitle  = chart.ChartTitle;
                string ChartUnit   = chart.ChartUnit;
                string strUrl      = HttpContext.Current.Request.Url.Authority.ToString();
                //string strRaw = HttpContext.Current.Request.Url.PathAndQuery.ToString();
                string ChartType = Request["ChartType"];
                strUrl = "http://" + strUrl;
                string str = "";
                str += "<iframe src=\"" + strUrl;

                str += "/Plugins/Chart/Show.aspx?Did=" + ChartID;

                str += "\" marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\"  scrolling=\"no\" ";
                str += "width=\"" + (ChartWidth + 80) + "\"" + " height=\"" + (ChartHeight + 80) + "\"" + ">";
                str += "</iframe>";

                TxtChartCode.Text = str;
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='" + customPath2 + "Plus/ADManage.aspx'>广告管理</a></li><li><a href='../Plus/ChartManage.aspx'>图表管理</a></li><li class='active'>获取图表代码</li>");
        }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int zoneId = DataConverter.CLng(base.Request.QueryString["ZoneID"]);

            if (string.Compare(base.Request.QueryString["Type"], "Zone", true) == 0)
            {
                if (B_Advertisement.GetADList(zoneId).Count == 0)
                {
                    this.ShowJS.InnerHtml = "广告版位中暂无广告信息";
                }
                else
                {
                    M_Adzone adZoneById = B_ADZone.getAdzoneByZoneId(zoneId);

                    if (!adZoneById.IsNull)
                    {
                        this.ShowJS.InnerHtml = "<script  type=\"text/javascript\" src='" + base.ResolveUrl("~/" + VirtualPathUtility.AppendTrailingSlash(SiteConfig.SiteOption.AdvertisementDir) + adZoneById.ZoneJSName) + "?temp=" + DataSecurity.RandomNum() + "'></script>";
                    }
                }
            }
            else
            {
                this.ShowAd();
            }
        }
Exemple #4
0
        private void DataBind(string key = "")
        {
            DataTable dt = new DataTable();

            if (!string.IsNullOrEmpty(Request.QueryString["type"]))
            {
                if (Request.QueryString["type"] == "1")
                {
                    dt = B_ADZone.Select_Bytype("饼状图");
                }
                if (Request.QueryString["type"] == "2")
                {
                    dt = B_ADZone.Select_Bytype("线状图");
                }
                if (Request.QueryString["type"] == "3")
                {
                    dt = B_ADZone.Select_Bytype("柱状图");
                }
            }
            else
            {
                dt = B_ADZone.SelectChart();
            }
            Egv.DataSource = dt;
            Egv.DataBind();
        }
Exemple #5
0
 private void listbind()
 {
     this.LstZoneName.DataSource     = B_ADZone.ADZone_GetAll();
     this.LstZoneName.DataTextField  = "ZoneName";
     this.LstZoneName.DataValueField = "ZoneID";
     this.LstZoneName.DataBind();
 }
Exemple #6
0
 protected void EBtnAdZone_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         adzone.ZoneName       = this.TxtZoneName.Text;
         adzone.ZoneType       = DataConverter.CLng(this.radlZonetype.SelectedValue);
         adzone.ShowType       = DataConverter.CLng(this.RadlShowType.SelectedValue);
         adzone.DefaultSetting = DataConverter.CBool(this.RBLDefaultSetting.SelectedValue);
         adzone.ZoneSetting    = this.GetZoneSetting(DataConverter.CBool(this.RBLDefaultSetting.SelectedValue));
         adzone.Active         = this.ChkActive.Checked;
         adzone.UpdateTime     = DateTime.Now;
         adzone.ZoneHeight     = DataConverter.CLng(this.TxtZoneHeight.Text.Trim());
         adzone.ZoneWidth      = DataConverter.CLng(this.TxtZoneWidth.Text.Trim());
         adzone.UpdateTime     = DateTime.Now;
         adzone.ZoneJSName     = this.TxtZoneJSName.Text;
         adzone.ZoneIntro      = this.TxtZoneIntro.Text;
         adzone.ZoneID         = DataConverter.CLng(this.HdnZoneId.Value);
         if (adzone.ZoneID > 0)
         {
             if (B_ADZone.ADZone_Update(adzone))
             {
                 Response.Write("<script>alert('修改成功');window.document.location.href='ADZoneManage.aspx'</script>");
             }
         }
         else
         {
             adzone.ZoneID = B_ADZone.ADZone_MaxID();
             if (B_ADZone.ADZone_Add(adzone))
             {
                 Response.Write("<script>alert('添加成功');window.document.location.href='ADZoneManage.aspx'</script>");
             }
         }
     }
 }
Exemple #7
0
        /// <summary>
        /// 批量暂停
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BtnPause_Click(object sender, EventArgs e)
        {
            string Ids = "";

            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("chkSel");
                if (cbox.Checked == true)
                {
                    if (string.IsNullOrEmpty(Ids))
                    {
                        Ids = GridView1.DataKeys[i].Value.ToString();
                    }
                    else
                    {
                        Ids += "," + GridView1.DataKeys[i].Value.ToString();
                    }
                }
            }
            if (!string.IsNullOrEmpty(Ids))
            {
                B_ADZone.BatchPause(Ids);
            }
            this.RepNodeBind();
        }
Exemple #8
0
        public void DataBind(string key = "")
        {
            DataTable dt = new DataTable();

            if (!string.IsNullOrEmpty(Request.QueryString["type"]))
            {
                int type = DataConverter.CLng(Request.QueryString["type"]);
                dt = B_ADZone.ADZone_ByCondition(" Where ShowTime=" + type + " order by ID desc");
                Egv.DataKeyNames = new string[] { "ZoneID" };
            }
            else
            {
                string adname = this.ViewState["AdName"].ToString();
                if (string.IsNullOrEmpty(adname))
                {
                    dt = B_A.SelectAdbuy();
                    Egv.DataKeyNames = new string[] { "ID" };
                }
                else
                {
                    dt = B_ADZone.ADZone_ByCondition(" Where ShowTime like @adname order by ID desc", new SqlParameter[] { new SqlParameter("adname", "%" + adname + "%") });
                    Egv.DataKeyNames = new string[] { "ID" };
                }
            }
            Egv.DataSource = dt;
            Egv.DataBind();
        }
Exemple #9
0
        private void SearchAndBind(string lblKey)
        {
            DataTable dt = B_ADZone.GetZoneName(lblKey);

            this.Egv.DataSource   = dt;
            this.Egv.DataKeyNames = new string[] { "ZoneId" };
            this.Egv.DataKeyNames = new string[] { "ZoneName" };
            this.Egv.DataBind();
        }
Exemple #10
0
        // 批量暂停
        protected void BtnPause_Click(object sender, EventArgs e)
        {
            string Ids = Request.Form["idchk"];

            if (!string.IsNullOrEmpty(Ids))
            {
                B_ADZone.BatchPause(Ids);
            }
            DataBind();
        }
Exemple #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string src = "";
         chart = B_ADZone.getChartByChartID(DataConverter.CLng(Request.QueryString["Did"]));
         try
         {
             if (chart.ChartType == "线状图")//曲线
             {
                 if (Request.QueryString["width"] == null || Request.QueryString["height"] == null)
                 {
                     src = "Line.aspx?Cid=" + Request.QueryString["Did"];
                     Bbiao.Attributes.Add("width", chart.ChartWidth.ToString()); Bbiao.Attributes.Add("height", chart.ChartHeight.ToString());
                 }
                 else
                 {
                     src = "Line.aspx?Cid=" + Request.QueryString["Did"] + "&width=" + Request.QueryString["width"] + "&height=" + Request.QueryString["height"];
                     Bbiao.Attributes.Add("width", Request.QueryString["width"]); Bbiao.Attributes.Add("height", Request.QueryString["height"]);
                 }
             }
             else if (chart.ChartType == "柱状图")//柱状
             {
                 if (Request.QueryString["width"] == null || Request.QueryString["height"] == null)
                 {
                     src = "colum.aspx?Cid=" + Request.QueryString["Did"];
                     Bbiao.Attributes.Add("width", chart.ChartWidth.ToString()); Bbiao.Attributes.Add("height", chart.ChartHeight.ToString());
                 }
                 else
                 {
                     src = "colum.aspx?Cid=" + Request.QueryString["Did"] + "&width=" + Request.QueryString["width"] + "&height=" + Request.QueryString["height"];
                     Bbiao.Attributes.Add("width", Request.QueryString["width"]); Bbiao.Attributes.Add("height", Request.QueryString["height"]);
                 }
             }
             else if (chart.ChartType == "饼状图")//饼状
             {
                 if (Request.QueryString["width"] == null || Request.QueryString["height"] == null)
                 {
                     src = "pie-basic.aspx?Cid=" + Request.QueryString["Did"];
                     Bbiao.Attributes.Add("width", chart.ChartWidth.ToString()); Bbiao.Attributes.Add("height", chart.ChartHeight.ToString());
                 }
                 else
                 {
                     src = "pie-basic.aspx?Cid=" + Request.QueryString["Did"] + "&width=" + Request.QueryString["width"] + "&height=" + Request.QueryString["height"];
                     Bbiao.Attributes.Add("width", Request.QueryString["width"]); Bbiao.Attributes.Add("height", Request.QueryString["height"]);
                 }
             }
         }
         catch (Exception)
         {
             Response.Write("数据不存在!");
         }
         Bbiao.Attributes.Add("src", src);
     }
 }
Exemple #12
0
        public ActionResult AdPlanAdd()
        {
            DataTable dt = B_ADZone.ADZone_ID();

            ViewBag.noad = dt == null || dt.Rows.Count < 1;
            int     id     = DataConverter.CLng(Request["ID"]);
            M_Adbuy adbMod = adbBll.SelectId(id);

            ViewBag.ADID_DT = dt;
            return(View(adbMod));
        }
Exemple #13
0
 /// <summary>
 /// 批量刷新JS
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void BtnRefurbish_Click(object sender, EventArgs e)
 {
     for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
     {
         CheckBox cbox = (CheckBox)GridView1.Rows[i].FindControl("chkSel");
         if (cbox.Checked == true)
         {
             B_ADZone.CreateJS(GridView1.DataKeys[i].Value.ToString());
         }
     }
     Response.Write("<script>alert('批量刷新JS成功!')</script>");
     this.RepNodeBind();
 }
Exemple #14
0
        protected void EBtnAdZone_Click(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                adzone.ZoneName       = this.TxtZoneName.Text;
                adzone.ZoneType       = DataConverter.CLng(this.radlZonetype.SelectedValue);
                adzone.ShowType       = DataConverter.CLng(this.RadlShowType.SelectedValue);
                adzone.DefaultSetting = DataConverter.CBool(this.RBLDefaultSetting.SelectedValue);
                adzone.ZoneSetting    = this.GetZoneSetting(DataConverter.CBool(this.RBLDefaultSetting.SelectedValue));

                adzone.Active     = this.ChkActive.Checked;
                adzone.UpdateTime = DateTime.Now;
                adzone.ZoneHeight = DataConverter.CLng(this.TxtZoneHeight.Text.Trim());
                adzone.ZoneWidth  = DataConverter.CLng(this.TxtZoneWidth.Text.Trim());
                adzone.UpdateTime = DateTime.Now;
                adzone.ZoneJSName = this.TxtZoneJSName.Text;
                adzone.ZoneIntro  = this.TxtZoneIntro.Text;
                adzone.ZoneID     = DataConverter.CLng(this.HdnZoneId.Value);
                if (this.CheckApply.Checked == true)
                {
                    adzone.Sales = 1;
                }
                else
                {
                    adzone.Sales = 0;
                }
                if (adzone.ZoneID > 0)
                {
                    if (B_ADZone.ADZone_Update(adzone))
                    {
                        function.WriteSuccessMsg("修改成功", "ADZoneManage.aspx");
                    }
                }
                else
                {
                    adzone.ZoneID = B_ADZone.ADZone_MaxID();
                    if (B_ADZone.ADZone_Add(adzone))
                    {
                        function.WriteSuccessMsg("添加成功", "ADZoneManage.aspx");
                    }
                }
            }
        }
Exemple #15
0
        // 批量刷新JS
        protected void BtnRefurbish_Click(object sender, EventArgs e)
        {
            string Ids = Request.Form["idchk"];

            if (!string.IsNullOrEmpty(Ids))
            {
                string[] chkArr = Ids.Split(',');
                for (int i = 0; i < chkArr.Length; i++)
                {
                    B_ADZone.CreateJS(chkArr[i]);
                }
                //JS
                function.WriteSuccessMsg("批量刷新版位成功!");
            }
            else
            {
                function.WriteErrMsg("批量刷新版位失败!");
            }
            DataBind();
        }
Exemple #16
0
    /// <summary>
    /// 添加版位信息时,创建对应的JS文件
    /// </summary>
    public static void CreateJS(string ids)
    {
        if (string.IsNullOrEmpty(ids))
        {
            return;
        }
        B_ADZone   zoneBll = new B_ADZone();
        B_ADZoneJs jsBll   = new B_ADZoneJs();

        string[] idArr = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
        for (int i = 0; i < idArr.Length; i++)
        {
            M_Adzone  zoneMod = zoneBll.SelReturnModel(Convert.ToInt32(idArr[i]));
            DataTable dt      = B_Advertisement.GetADList(zoneMod.ZoneID);
            //if (dt.Rows.Count > 0)
            //{
            jsBll.CreateJS(zoneMod, dt);
            //}
        }
    }
Exemple #17
0
        protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            if (e.CommandName == "Edit")
            {
                Page.Response.Redirect("../Flex/AddChart.aspx?ChartID=" + id);
            }
            if (e.CommandName == "Del")
            {
                if (B_ADZone.Chart_Remove(id))
                {
                    function.WriteSuccessMsg("删除成功!");
                }
                DataBind();
            }
            if (e.CommandName == "ifframe")
            {
                Page.Response.Redirect("ShowChartCode.aspx?ChartID=" + id);
            }
        }
Exemple #18
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         M_Adzone adZoneById = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(base.Request.QueryString["ZoneId"]));
         if ((adZoneById.IsNull) || string.IsNullOrEmpty(adZoneById.ZoneJSName))
         {
             this.TxtZoneCode.Text = "版位调用代码不存在!";
         }
         else
         {
             this.TxtZoneCode.Text = "<script type=\"text/javascript\" src=\"{$AdDir/}/" + adZoneById.ZoneJSName + "\"></script>";
         }
     }
 }
Exemple #19
0
        private void RepNodeBind()
        {
            string adname = this.ViewState["AdName"].ToString();

            if (string.IsNullOrEmpty(adname))
            {
                DataTable da = B_ADZone.ADZone_GetAll();
                if (da.Rows.Count > 0)
                {
                    this.nocontent.Style["display"] = "none";
                    this.GridView1.DataSource       = da;
                    GridView1.DataKeyNames          = new string[] { "ZoneID" };
                    this.GridView1.DataBind();
                    this.GridView1.Visible = true;
                }
                else
                {
                    this.nocontent.Style["display"] = "";
                    this.GridView1.Visible          = false;
                }
            }
            else
            {
                DataTable da = B_ADZone.ADZone_ByCondition(" Where ZoneName like '%" + adname + "%'");
                if (da.Rows.Count != 0)
                {
                    this.nocontent.Style["display"] = "none";
                    this.GridView1.DataSource       = da;
                    GridView1.DataKeyNames          = new string[] { "ZoneId" };
                    this.GridView1.DataBind();
                    this.GridView1.Visible = true;
                }
                else
                {
                    this.nocontent.Style["display"] = "";
                    this.GridView1.Visible          = false;
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     ZoomLa.Common.function.AccessRulo();
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         if (!B_ARoleAuth.Check(ZLEnum.Auth.other, "ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         M_Adzone adZoneById = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(base.Request.QueryString["ZoneId"]));
         if ((adZoneById.IsNull) || string.IsNullOrEmpty(adZoneById.ZoneJSName))
         {
             this.TxtZoneCode.Text = "版位调用代码不存在!";
         }
         else
         {
             this.TxtZoneCode.Text = "<script src=\"{$AdDir/}/" + adZoneById.ZoneJSName.Trim() + "\"></script>";
         }
     }
     Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ADManage.aspx'>广告管理</a></li><li class='active'>获取广告代码</li>");
 }
Exemple #21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "I/Main.aspx'>工作台</a></li><li><a href='ADZoneManage.aspx'>扩展功能</a></li><li><a href='ADZoneManage.aspx'>版位管理</a></li><li class='active'><a href='ADZone.aspx'>版位编辑</a></li>" + Call.GetHelp(28));
     ZoomLa.Common.function.AccessRulo();
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         if (!B_ARoleAuth.Check(ZoomLa.Model.ZLEnum.Auth.other, "ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         this.DropFixedPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropFloatPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropMovePosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropPopPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         foreach (ListItem lit in this.radlZonetype.Items)
         {
             lit.Attributes.Add("onclick", "ShowZoenTypePanel()");
         }
         foreach (ListItem li2 in this.RBLDefaultSetting.Items)
         {
             li2.Attributes.Add("onclick", "ShowZoenTypePanel()");
         }
         this.DropAdZoneSize.Attributes.Add("onchange", "Zone_SelectSize(this)");
         string zoneid = base.Request.QueryString["ZoneId"];
         if (string.IsNullOrEmpty(zoneid))
         {
             this.TxtZoneJSName.Text = this.GetJSFileName().Trim();
             zoneid = "0";
             this.HdnZoneId.Value = zoneid;
             this.Label1.Text     = "添加广告版位";
         }
         else
         {
             this.HdnZoneId.Value = zoneid;
             this.Label1.Text     = "修改广告版位";
             adzone = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(zoneid));
             this.TxtZoneName.Text           = adzone.ZoneName;
             this.TxtZoneJSName.Text         = adzone.ZoneJSName.Trim();
             this.TxtZoneIntro.Text          = adzone.ZoneIntro;
             this.TxtZoneHeight.Text         = adzone.ZoneHeight.ToString();
             this.TxtZoneWidth.Text          = adzone.ZoneWidth.ToString();
             this.radlZonetype.SelectedValue = adzone.ZoneType.ToString();
             if (adzone.Sales == 1)
             {
                 this.CheckApply.Checked = true;
             }
             else
             {
                 this.CheckApply.Checked = false;
             }
             if (!adzone.DefaultSetting)
             {
                 this.RBLDefaultSetting.SelectedValue = "0";
             }
             else
             {
                 this.RBLDefaultSetting.SelectedValue = "1";
             }
             InitShowPanel(adzone.ZoneType);
             InitSetting(adzone.ZoneSetting, adzone.ZoneType);
             this.RadlShowType.SelectedValue = adzone.ShowType.ToString();
             if (adzone.Active)
             {
                 this.ChkActive.Checked = true;
             }
             else
             {
                 this.ChkActive.Checked = false;
             }
         }
     }
 }
Exemple #22
0
 protected void Lnk_Click(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "Edit")
     {
         Page.Response.Redirect("ADZone.aspx?ZoneId=" + e.CommandArgument.ToString());
     }
     if (e.CommandName == "Del")
     {
         string Id = e.CommandArgument.ToString();
         if (B_ADZone.ADZone_Remove(Id))
         {
             Response.Write("<script>alert('删除成功!')</script>");
         }
         RepNodeBind();
     }
     if (e.CommandName == "AddAdv")
     {
         Page.Response.Redirect("Advertisement.aspx?ZoneId=" + e.CommandArgument.ToString());
     }
     if (e.CommandName == "Copy")
     {
         string Id = e.CommandArgument.ToString();
         if (B_ADZone.ADZone_Copy(DataConverter.CLng(Id)))
         {
             Response.Write("<script>alert('复制成功!')</script>");
         }
         RepNodeBind();
     }
     if (e.CommandName == "Clear")
     {
         string Id = e.CommandArgument.ToString();
         B_ADZone.ADZone_Clear(DataConverter.CLng(Id));
         Response.Write("<script>alert('清除成功!')</script>");
         RepNodeBind();
     }
     if (e.CommandName == "SetAct")
     {
         string Id = e.CommandArgument.ToString();
         if (!B_ADZone.getAdzoneByZoneId(DataConverter.CLng(Id)).Active)
         {
             B_ADZone.ADZone_Active(DataConverter.CLng(Id));
         }
         else
         {
             B_ADZone.ADZone_Pause(Id);
         }
         RepNodeBind();
     }
     if (e.CommandName == "Refresh")
     {
         B_ADZone.CreateJS(e.CommandArgument.ToString());
         Response.Write("<script>alert('刷新JS成功!')</script>");
         RepNodeBind();
     }
     if (e.CommandName == "PreView")
     {
         Page.Response.Redirect("PreviewAD.aspx?ZoneID=" + e.CommandArgument.ToString() + "&Type=Zone");
     }
     if (e.CommandName == "JS")
     {
         Page.Response.Redirect("ShowJSCode.aspx?ZoneID=" + e.CommandArgument.ToString());
     }
 }
Exemple #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         B_Admin badmin = new B_Admin();
         badmin.CheckMulitLogin();
         if (!badmin.ChkPermissions("ADManage"))
         {
             function.WriteErrMsg("没有权限进行此项操作");
         }
         this.DropFixedPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropFloatPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropMovePosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         this.DropPopPosition.Attributes.Add("onchange", "ChangePositonShow(this)");
         foreach (ListItem lit in this.radlZonetype.Items)
         {
             lit.Attributes.Add("onclick", "ShowZoenTypePanel()");
         }
         foreach (ListItem li2 in this.RBLDefaultSetting.Items)
         {
             li2.Attributes.Add("onclick", "ShowZoenTypePanel()");
         }
         this.DropAdZoneSize.Attributes.Add("onchange", "Zone_SelectSize(this)");
         string zoneid = base.Request.QueryString["ZoneId"];
         if (string.IsNullOrEmpty(zoneid))
         {
             this.TxtZoneJSName.Text = this.GetJSFileName();
             zoneid = "0";
             this.HdnZoneId.Value = zoneid;
             this.Label1.Text     = "添加广告版位";
         }
         else
         {
             this.HdnZoneId.Value = zoneid;
             this.Label1.Text     = "修改广告版位";
             adzone = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(zoneid));
             this.TxtZoneName.Text           = adzone.ZoneName;
             this.TxtZoneJSName.Text         = adzone.ZoneJSName;
             this.TxtZoneIntro.Text          = adzone.ZoneIntro;
             this.TxtZoneHeight.Text         = adzone.ZoneHeight.ToString();
             this.TxtZoneWidth.Text          = adzone.ZoneWidth.ToString();
             this.radlZonetype.SelectedValue = adzone.ZoneType.ToString();
             if (!adzone.DefaultSetting)
             {
                 this.RBLDefaultSetting.SelectedValue = "0";
             }
             else
             {
                 this.RBLDefaultSetting.SelectedValue = "1";
             }
             InitShowPanel(adzone.ZoneType);
             InitSetting(adzone.ZoneSetting, adzone.ZoneType);
             this.RadlShowType.SelectedValue = adzone.ShowType.ToString();
             if (adzone.Active)
             {
                 this.ChkActive.Checked = true;
             }
             else
             {
                 this.ChkActive.Checked = false;
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["Did"] != null)
                {
                    string src = "";
                    chart = B_ADZone.getChartByChartID(DataConverter.CLng(Request.QueryString["Did"]));
                    if (chart.ChartType == "线状图")//曲线
                    {
                        src = "Line.aspx?Cid=" + Request.QueryString["Did"];
                    }
                    else if (chart.ChartType == "柱状图")//柱状
                    {
                        src = "colum.aspx?Cid=" + Request.QueryString["Did"];
                    }
                    else if (chart.ChartType == "饼状图")//饼状
                    {
                        src = "pie-basic.aspx?Cid=" + Request.QueryString["Did"];
                    }
                    Response.Write(chart.ChartWidth + "|" + chart.ChartHeight + "|" + src);
                    Response.End();
                }

                if (Request.QueryString["Datas"] == null)
                {
                    if (Request.QueryString["Cid"] == "0")
                    {
                        string[] wihi = Request.QueryString["wihi"] == null ? "300|200".Split('|') : Request.QueryString["wihi"].Split('|');
                        try
                        {
                            BiaoS.Width  = wihi[0];
                            BiaoS.Height = wihi[1];
                            BiaoS.Title  = "示例";
                            BiaoS.unit   = "";
                            BiaoS.X      = "['a',1],['b',2],['c',3]";
                        }
                        catch (Exception)
                        {
                            Response.Write("<font color='red'>数据错误!</font>");
                        }
                    }
                    else
                    {
                        chart = B_ADZone.getChartByChartID(DataConverter.CLng(Request.QueryString["Cid"]));
                        if (Request.QueryString["width"] == null || Request.QueryString["height"] == null)
                        {
                            BiaoS.Width  = chart.ChartWidth.ToString();
                            BiaoS.Height = chart.ChartHeight.ToString();
                        }
                        else
                        {
                            BiaoS.Width  = Request.QueryString["width"];
                            BiaoS.Height = Request.QueryString["height"];
                        }
                        BiaoS.Title = chart.ChartTitle;
                        BiaoS.unit  = chart.ChartUnit;
                        string[] Datas = chart.CharData.Split('|');
                        string[] y     = Datas[1].Split(',');
                        string   Xy    = "";
                        string[] x     = Datas[0].Split(',');
                        for (int i = 0; i < y.Length; i++)
                        {
                            Xy += "['" + y[i] + "'," + x[i] + "],";
                        }

                        BiaoS.Y = "";
                        BiaoS.X = Xy.TrimEnd(',');
                    }
                }
                else
                {
                    string[] Bases      = Request.QueryString["Bases"].Split('|');
                    string[] Coordinate = Request.QueryString["Datas"].Split('|');
                    BiaoS.Width  = Bases[0];
                    BiaoS.Height = Bases[1];
                    BiaoS.Title  = Bases[2];
                    BiaoS.unit   = Bases[3];
                    string[] y  = Coordinate[1].Split(',');
                    string   Xy = "";
                    string[] x  = Coordinate[0].Split(',');
                    for (int i = 0; i < y.Length; i++)
                    {
                        Xy += "['" + y[i] + "'," + x[i] + "],";
                    }

                    BiaoS.Y = "";
                    BiaoS.X = Xy.TrimEnd(',');
                }
            }
        }
Exemple #25
0
 public string GetJSFileName()
 {
     return(DateTime.Now.ToString("yyyyMM/") + B_ADZone.ADZone_MaxID() + ".js");
 }
Exemple #26
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            string adZoneIdList = this.GetAdZoneIdList();

            if (this.Page.IsValid)
            {
                M_Advertisement adv = new M_Advertisement();
                adv.UserId     = 0;
                adv.AdName     = DataSecurity.HtmlEncode(this.TxtADName.Text.Trim());
                adv.AdType     = DataConverter.CLng(this.RadlADType.SelectedValue);
                adv.Priority   = DataConverter.CLng(this.TxtPriority.Text.Trim());
                adv.Passed     = this.ChkPassed.Checked;
                adv.CountView  = this.ChkCountView.Checked;
                adv.Views      = DataConverter.CLng(this.TxtViews.Text.Trim());
                adv.CountClick = this.ChkCountClick.Checked;
                adv.Clicks     = DataConverter.CLng(this.TxtClicks.Text.Trim());
                //adv.ZoneID = adZoneIdList;
                adv.AdId        = DataConverter.CLng(this.HdnID.Value.Trim());
                adv.OverdueDate = DataConverter.CDate(this.txtOverdueDate.Text);
                adv.Setting     = "";
                switch (adv.AdType)
                {
                case 1:
                {
                    adv.ImgUrl = this.txtpic.Text.Trim();
                    if (string.IsNullOrEmpty(adv.ImgUrl))
                    {
                        function.WriteErrMsg("图片广告的图片地址不能为空!");
                    }
                    adv.ImgHeight = DataConverter.CLng(this.TxtImgHeight.Text.Trim());
                    adv.ImgWidth  = DataConverter.CLng(this.TxtImgWidth.Text.Trim());
                    string str2 = this.TxtLinkUrl.Text.Trim();
                    adv.LinkUrl    = str2;
                    adv.LinkTarget = DataConverter.CLng(this.RadlLinkTarget.SelectedValue);
                    adv.LinkAlt    = this.TxtLinkAlt.Text.Trim();
                    adv.ADIntro    = this.TxtADIntro.Text.Trim();
                    break;
                }

                case 2:
                    adv.ImgUrl = this.txtFlashPath.Text.Trim();
                    if (string.IsNullOrEmpty(adv.ImgUrl))
                    {
                        function.WriteErrMsg("动画广告的Flash地址不能为空");
                    }
                    adv.ImgHeight  = DataConverter.CLng(this.TxtFlashHeight.Text.Trim());
                    adv.ImgWidth   = DataConverter.CLng(this.TxtFlashWidth.Text.Trim());
                    adv.FlashWmode = DataConverter.CLng(this.RadlFlashMode.SelectedValue);
                    break;

                case 3:
                    adv.ADIntro = this.TxtADText.Text.Trim();
                    break;

                case 4:
                    adv.ADIntro = this.TxtADCode.Text.Trim();
                    break;

                case 5:
                    adv.ADIntro = this.TxtWebFileUrl.Text.Trim();
                    break;
                }
                bool flag = false;
                if (adv.AdId > 0)
                {
                    flag = B_Advertisement.Advertisement_Update(adv);
                }
                else
                {
                    adv.AdId = B_Advertisement.MaxID();
                    flag     = B_Advertisement.Advertisement_Add(adv);
                }
                if (flag)
                {
                    int zid = 0;
                    if (!string.IsNullOrEmpty(adZoneIdList))
                    {
                        string[] arr = adZoneIdList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        for (int s = 0; s < arr.Length; s++)
                        {
                            zid = DataConverter.CLng(arr[s]);
                            if (!B_Advertisement.IsExistZoneAdv(zid, adv.AdId))
                            {
                                B_Advertisement.Add_Zone_Advertisement(zid, adv.AdId);
                            }
                        }
                        B_ADZone.CreateJS(adZoneIdList);
                    }
                    Response.Write("<script>alert('广告信息保存成功!');window.document.location.href='ADManage.aspx'</script>");
                }
                else
                {
                    Response.Write("<script>alert('广告信息保存失败!');</script>");
                }
            }
        }
Exemple #27
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            string adZoneIdList = LstZoneName.SelectedValue;

            if (this.Page.IsValid)
            {
                int             adid = DataConverter.CLng(this.HdnID.Value.Trim());
                M_Advertisement adv  = new M_Advertisement();
                adv.UserID     = 0;
                adv.ADName     = Server.HtmlEncode(this.TxtADName.Text.Trim());
                adv.ADType     = DataConverter.CLng(this.RadlADType.SelectedValue);
                adv.Priority   = DataConverter.CLng(this.TxtPriority.Text.Trim());
                adv.Passed     = ChkPasses.Checked;
                adv.CountView  = this.ChkCountView.Checked;
                adv.Views      = DataConverter.CLng(this.TxtViews.Text.Trim());
                adv.CountClick = this.ChkCountClick.Checked;
                adv.Clicks     = DataConverter.CLng(this.TxtClicks.Text.Trim());
                //adv.ZoneID = adZoneIdList;
                adv.ADID        = adid;
                adv.OverdueDate = DataConverter.CDate(this.txtOverdueDate.Text);
                adv.Setting     = "";
                adv.Price       = DataConverter.CDecimal(this.Price.Text);
                adv.ADBuy       = this.ADBuy.Checked ? 1 : 0;
                switch (adv.ADType)
                {
                case 1:
                {
                    adv.ImgUrl = this.txtpic.Text.Trim();
                    if (string.IsNullOrEmpty(adv.ImgUrl))
                    {
                        function.WriteErrMsg("图片广告的图片地址不能为空!");
                    }
                    adv.ImgHeight = DataConverter.CLng(this.TxtImgHeight.Text.Trim());
                    adv.ImgWidth  = DataConverter.CLng(this.TxtImgWidth.Text.Trim());
                    string str2 = (this.TxtLinkUrl.Text.Trim() == "http://") ? "" : this.TxtLinkUrl.Text.Trim();
                    adv.LinkUrl    = str2;
                    adv.LinkTarget = DataConverter.CLng(this.RadlLinkTarget.SelectedValue);
                    adv.LinkAlt    = this.TxtLinkAlt.Text.Trim();
                    adv.ADIntro    = this.TxtADIntro.Text.Trim();
                    adv.ImgUrl1    = this.txtpic1.Text.Trim();
                    adv.ImgHeight1 = DataConverter.CLng(this.TxtImgHeight1.Text.Trim());
                    adv.ImgWidth1  = DataConverter.CLng(this.TxtImgWidth1.Text.Trim());
                    string str3 = (this.TxtLinkUrl1.Text.Trim() == "http://") ? "" : this.TxtLinkUrl1.Text.Trim();
                    adv.LinkUrl1    = str3;
                    adv.LinkTarget1 = DataConverter.CLng(this.RadlLinkTarget1.SelectedValue);
                    adv.LinkAlt1    = this.TxtLinkAlt1.Text.Trim();
                    adv.ADIntro1    = this.TxtADIntro1.Text.Trim();
                    break;
                }

                case 2:
                    adv.ImgUrl = this.txtFlashPath.Text.Trim();
                    if (string.IsNullOrEmpty(adv.ImgUrl))
                    {
                        function.WriteErrMsg("动画广告的Flash地址不能为空");
                    }
                    adv.ImgHeight   = DataConverter.CLng(this.TxtFlashHeight.Text.Trim());
                    adv.ImgWidth    = DataConverter.CLng(this.TxtFlashWidth.Text.Trim());
                    adv.FlashWmode  = DataConverter.CLng(this.RadlFlashMode.SelectedValue);
                    adv.ImgUrl1     = this.txtFlashPath1.Text.Trim();
                    adv.ImgHeight1  = DataConverter.CLng(this.TxtFlashHeight1.Text.Trim());
                    adv.ImgWidth1   = DataConverter.CLng(this.TxtFlashWidth1.Text.Trim());
                    adv.FlashWmode1 = DataConverter.CLng(this.RadlFlashMode1.SelectedValue);
                    break;

                case 3:
                    adv.ADIntro  = this.TxtADText.Text.Trim();
                    adv.ADIntro1 = this.TxtADText1.Text.Trim();
                    break;

                case 4:
                    adv.ADIntro  = this.TxtADCode.Text.Trim();
                    adv.ADIntro1 = this.TxtADCode1.Text.Trim();
                    break;

                case 5:
                    adv.ADIntro  = this.TxtWebFileUrl.Text.Trim();
                    adv.ADIntro1 = this.TxtWebFileUrl1.Text.Trim();
                    break;
                }
                bool flag = false;
                if (adv.ADID > 0)
                {
                    flag = B_Advertisement.Advertisement_Update(adv);
                }
                else
                {
                    adv.ADID = B_Advertisement.MaxID();
                    flag     = B_Advertisement.Advertisement_Add(adv);
                    adv.ADID = B_Advertisement.MaxID() - 1;
                }
                if (flag)
                {
                    int zid = 0;
                    B_ADZone.Delete_ADZone_Ad(adv.ADID.ToString());
                    if (!string.IsNullOrEmpty(adZoneIdList))
                    {
                        if (adZoneIdList.IndexOf(',') > -1)
                        {
                            string[] arr = adZoneIdList.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            for (int s = 0; s < arr.Length; s++)
                            {
                                zid = DataConverter.CLng(arr[s]);
                                if (!B_Advertisement.IsExistZoneAdv(zid, adv.ADID))
                                {
                                    B_Advertisement.Add_Zone_Advertisement(zid, adv.ADID);
                                }
                            }
                            B_ADZone.CreateJS(adZoneIdList);
                        }
                        else
                        {
                            zid = DataConverter.CLng(adZoneIdList);
                            bool isadd = false;
                            if (!B_Advertisement.IsExistZoneAdv(zid, adv.ADID))
                            {
                                isadd = B_Advertisement.Add_Zone_Advertisement(zid, adv.ADID);
                            }
                            B_ADZone.CreateJS(adZoneIdList);
                        }
                    }
                    function.WriteSuccessMsg("广告信息保存成功!", "ADManage.aspx");
                }
                else
                {
                    function.WriteErrMsg("保存失败!");
                }
            }
        }
Exemple #28
0
        protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string Id = e.CommandArgument.ToString();

            switch (e.CommandName)
            {
            case "Del":
                M_Adzone Old      = B_ADZone.getAdzoneByZoneId(DataConverter.CLng(Id));
                string   jssource = Old.ZoneJSName;
                jssource = VirtualPathUtility.AppendTrailingSlash(Request.PhysicalApplicationPath + "/" + SiteConfig.SiteOption.AdvertisementDir) + jssource;
                if (B_ADZone.ADZone_Remove(Id))
                {
                    FileSystemObject.Delete(jssource, FsoMethod.File);
                    function.Script(Page, "alert('删除成功!');");
                }
                break;

            case "Copy":
                int NewID = B_ADZone.ADZone_Copy(DataConverter.CLng(Id));
                if (NewID > 0)
                {
                    M_Adzone mzone      = B_ADZone.getAdzoneByZoneId(NewID);
                    string   ZoneJSName = mzone.ZoneJSName;
                    ZoneJSName = ZoneJSName.Split(new string[] { "/" }, StringSplitOptions.None)[0].ToString();
                    if (ZoneJSName.Length == 5)
                    {
                        mzone.ZoneJSName = mzone.ZoneJSName.Insert(4, "0");
                    }
                    B_ADZone.ADZone_Update(mzone);
                    B_ADZone.CreateJS(NewID.ToString());
                    function.Script(Page, "alert('复制成功!" + NewID.ToString() + "');");
                }
                break;

            case "Clear":
                if (B_ADZone.ADZone_Clear(DataConverter.CLng(Id)))
                {
                    function.Script(Page, "alert('清除成功!');");
                }
                break;

            case "SetAct":
                if (!B_ADZone.getAdzoneByZoneId(DataConverter.CLng(Id)).Active)
                {
                    B_ADZone.ADZone_Active(DataConverter.CLng(Id));
                }
                else
                {
                    B_ADZone.ADZone_Pause(Id);
                }
                B_ADZone.CreateJS(Id);
                break;

            case "Refresh":
                B_ADZone.CreateJS(e.CommandArgument.ToString());
                function.WriteSuccessMsg("刷新版位成功");
                break;

            case "PreView":
                Page.Response.Redirect("PreviewAD.aspx?ZoneID=" + e.CommandArgument.ToString() + "&Type=Zone");
                break;

            case "JS":
                Page.Response.Redirect("ShowJSCode.aspx?ZoneID=" + e.CommandArgument.ToString());
                break;
            }
            DataBind();
        }
Exemple #29
0
 private string GetJSFileName()
 {
     return(DateTime.Today.Year.ToString() + DateTime.Today.Month.ToString().PadLeft(2, '0') + "/" + B_ADZone.ADZone_MaxID().ToString() + ".js");
 }
Exemple #30
0
        public string SetZoomName(string id)
        {
            string ZoomName = B_ADZone.getAdzoneByZoneId(Convert.ToInt32(id)).ZoneName;

            return(ZoomName);
        }