protected void Egv_RowCommand(object sender, GridViewCommandEventArgs e) { string Id = e.CommandArgument.ToString(); switch (e.CommandName) { case "Del": if (B_Advertisement.Advertisement_Delete(Convert.ToInt32(Id))) { function.WriteSuccessMsg("删除成功!", "ADManage.aspx"); } break; case "Copy": if (B_Advertisement.Advertisement_Copy(DataConverter.CLng(Id))) { function.WriteSuccessMsg("复制成功!", "ADManage.aspx"); } break; case "Pass": if (!B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(Id)).Passed) { B_Advertisement.Advertisement_SetPassed(Id); } else { B_Advertisement.Advertisement_CancelPassed(Id); } break; } DataBind(); }
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)); }
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; } } } }
protected string getimg(string id) { int sid = DataConverter.CLng(id); string ddd = B_Advertisement.Advertisement_GetAdvertisementByid(sid).ADName; string tempstr = @"ShowADPreview('<a href=\'/idc/ target=\'_blank\' title=\'" + ddd + @"\'><img src=\'"; string tempstr2 = @"\' border=\'0\'></a>')"; string imgurl = B_Advertisement.Advertisement_GetAdvertisementByid(sid).ImgUrl; imageurl = "<img src=\'/" + SiteConfig.SiteOption.UploadDir + "/" + imgurl + "\' width=\'200\' height=\'120\' border=\'0\' />"; if (imgurl != "") { return(tempstr + B_Advertisement.Advertisement_GetAdvertisementByid(sid).ImgUrl + tempstr2); } else { return(""); } }
protected void Page_Load(object sender, EventArgs e) { M_Advertisement advertisementById = B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(base.Request.QueryString["AdId"])); if (!advertisementById.IsNull) { this.LabAdShow.Text = B_Advertisement.GetAdContent(advertisementById); if (advertisementById.CountClick) { advertisementById.Clicks++; } if (advertisementById.CountView) { advertisementById.Views++; } B_Advertisement.Advertisement_Update(advertisementById); } }
protected void Page_Load(object sender, EventArgs e) { string strB = base.Request.QueryString["Action"]; M_Advertisement advertisementById = B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(base.Request.QueryString["AdId"])); if (!advertisementById.IsNull) { if (advertisementById.CountView) { advertisementById.Views++; } if (advertisementById.CountClick) { advertisementById.Clicks++; } B_Advertisement.Advertisement_Update(advertisementById); if ((string.Compare("Click", strB, true) == 0) && !string.IsNullOrEmpty(advertisementById.LinkUrl)) { Response.Write("<script language='javascript' type='text/javascript'>window.location='" + advertisementById.LinkUrl + "';</script>"); } } }
protected void Lnk_Click(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Edit") { Page.Response.Redirect("Advertisement.aspx?ADId=" + e.CommandArgument.ToString()); } if (e.CommandName == "Del") { string Id = e.CommandArgument.ToString(); if (B_Advertisement.Advertisement_Delete(Id)) { Response.Write("<script>alert('删除成功!')</script>"); } this.RepNodeBind(); } if (e.CommandName == "Copy") { string Id = e.CommandArgument.ToString(); if (B_Advertisement.Advertisement_Copy(DataConverter.CLng(Id))) { Response.Write("<script>alert('复制成功!')</script>"); } this.RepNodeBind(); } if (e.CommandName == "Pass") { string Id = e.CommandArgument.ToString(); if (!B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(Id)).Passed) { B_Advertisement.Advertisement_SetPassed(Id); } else { B_Advertisement.Advertisement_CancelPassed(Id); } this.RepNodeBind(); } }
private void ShowAd() { M_Advertisement advertisementById = B_Advertisement.Advertisement_GetAdvertisementByid(DataConverter.CLng(base.Request.QueryString["AdId"])); this.ShowJS.InnerHtml = B_Advertisement.GetAdContent(advertisementById); }