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(); } }
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 (!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>"; } } }
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>"); }
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()); } }
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(); }
public string SetZoomName(string id) { string ZoomName = B_ADZone.getAdzoneByZoneId(Convert.ToInt32(id)).ZoneName; return(ZoomName); }
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; } } } }
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; } } } }