protected override void AttachChildControls() { string text = System.Web.HttpContext.Current.Request.QueryString.Get("m"); string text2 = System.Web.HttpContext.Current.Request.QueryString.Get("type"); this.ltGetTotal = (System.Web.UI.WebControls.Literal) this.FindControl("ltGetTotal"); this.ltOrderAmountCanUse = (System.Web.UI.WebControls.Literal) this.FindControl("ltOrderAmountCanUse"); this.ltExpiryTime = (System.Web.UI.WebControls.Literal) this.FindControl("ltExpiryTime"); this.ltRedPagerActivityName = (System.Web.UI.WebControls.Literal) this.FindControl("ltRedPagerActivityName"); this.ltRedPagerActivityNameForOrders = (System.Web.UI.WebControls.Literal) this.FindControl("ltRedPagerActivityNameForOrders"); this.ltRedPagerLimit = (System.Web.UI.WebControls.Literal) this.FindControl("ltRedPagerLimit"); this.ltErrorMessage = (System.Web.UI.WebControls.Literal) this.FindControl("ltErrorMessage"); this.divNoLogin = (System.Web.UI.WebControls.Panel) this.FindControl("divNoLogin"); this.divNoNum = (System.Web.UI.WebControls.Panel) this.FindControl("divNoNum"); this.divSuccess = (System.Web.UI.WebControls.Panel) this.FindControl("divSuccess"); this.divError = (System.Web.UI.WebControls.Panel) this.FindControl("divError"); this.hdCondition = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hdCondition"); this.hlinkLogin = (System.Web.UI.WebControls.HyperLink) this.FindControl("hlinkLogin"); if (text2 == "1" || text2 == "5") { int num = 0; int.TryParse(text, out num); if (num > 0) { int id = 0; int.TryParse(System.Web.HttpContext.Current.Request["id"], out id); ShareActivityInfo act = ShareActHelper.GetAct(id); if (act != null) { CouponInfo coupon = CouponHelper.GetCoupon(act.CouponId); this.ltGetTotal.Text = coupon.CouponValue.ToString("F2").Replace(".00", ""); this.ltOrderAmountCanUse.Text = coupon.ConditionValue.ToString("F2").Replace(".00", ""); this.hdCondition.SetWhenIsNotNull(coupon.ConditionValue.ToString("F2").Replace(".00", "")); this.ltExpiryTime.Text = coupon.EndDate.ToString("yyyy-MM-dd"); if (text2 == "5") { this.ltRedPagerActivityName.Text = "该券已经到你的钱包了</div><div class='get-red-explain'><a href='/Vshop/MyCouponLists.aspx'>点击查看</a>"; } else { this.ltRedPagerActivityName.Text = (coupon.CouponName ?? ""); } if (coupon.IsAllProduct) { this.ltRedPagerLimit.Text = "该券可用于任意商品的抵扣"; } else { string couponProductIds = CouponHelper.GetCouponProductIds(act.CouponId); this.ltRedPagerLimit.Text = "该券可用于部分商品的抵扣</div><div class='get-red-explain'><a href='/ProductList.aspx?pIds='" + couponProductIds + ">查看商品</a>"; } this.divSuccess.Visible = true; } } PageTitle.AddSiteNameTitle("成功获取优惠券"); } else { string text3 = text2; if (text3 != null) { if (!(text3 == "-1")) { if (!(text3 == "-2")) { if (!(text3 == "-4")) { if (text3 == "-3") { this.divNoNum.Visible = true; } } else { this.divNoLogin.Visible = true; } } else { this.ltErrorMessage.Text = text; this.divError.Visible = true; } } else { int id = 0; int.TryParse(System.Web.HttpContext.Current.Request["id"], out id); ShareActivityInfo act = ShareActHelper.GetAct(id); if (act != null) { CouponInfo coupon = CouponHelper.GetCoupon(act.CouponId); if (coupon != null) { this.ltRedPagerActivityNameForOrders.Text = coupon.CouponName; string s = string.Concat(new object[] { Globals.GetWebUrlStart(), "/Vshop/GetRedPager.aspx?id=", id.ToString(), "&userid=", Globals.GetCurrentMemberUserId(), "&ReferralId=", Globals.GetCurrentDistributorId() }); this.hlinkLogin.NavigateUrl = "/UserLogining.aspx?returnUrl=" + System.Web.HttpContext.Current.Server.UrlEncode(s); this.divNoLogin.Visible = true; } else { System.Web.HttpContext.Current.Response.Redirect("/default.aspx"); System.Web.HttpContext.Current.Response.End(); } } else { System.Web.HttpContext.Current.Response.Redirect("/default.aspx"); System.Web.HttpContext.Current.Response.End(); } } } PageTitle.AddSiteNameTitle("获取优惠券"); } }
protected override void AttachChildControls() { this.lbCouponValue = (HiLiteral)this.FindControl("lbCouponValue"); this.lbCouponTj = (HiLiteral)this.FindControl("lbCouponTj"); this.lbBeginTime = (HiLiteral)this.FindControl("lbBeginTime"); this.lbEndTime = (HiLiteral)this.FindControl("lbEndTime"); this.lbCounponValue1 = (HiLiteral)this.FindControl("lbCounponValue1"); this.lbCouponTj1 = (HiLiteral)this.FindControl("lbCouponTj1"); this.lbLeftCount = (HiLiteral)this.FindControl("lbLeftCount"); this.lbCouponUseCount = (HiLiteral)this.FindControl("lbCouponUseCount"); this.lbCouponUsedShopBook = (HiLiteral)this.FindControl("lbCouponUsedShopBook"); this.lbCouponDateTime = (HiLiteral)this.FindControl("lbCouponDateTime"); this.lbCouponName = (HiLiteral)this.FindControl("lbCouponName"); this.hideImgUrl = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideImgUrl"); this.hideDesc = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideDesc"); CouponInfo coupon = CouponHelper.GetCoupon(this.couponId); if (coupon != null) { System.Uri url = System.Web.HttpContext.Current.Request.Url; string str = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString())); this.hideImgUrl.Value = str + "/Utility/pics/coupon.png"; this.hideDesc.Value = "面值:" + coupon.CouponValue.ToString("n0") + "元,活动时间:" + string.Format("{0:yyyy-MM-dd}~{1:yyyy-MM-dd}", coupon.BeginDate, coupon.EndDate); this.htmlTitle = coupon.CouponName; this.lbCouponValue.Text = coupon.CouponValue.ToString("n0"); this.lbCounponValue1.Text = coupon.CouponValue.ToString("n0"); this.lbBeginTime.Text = coupon.BeginDate.ToString("yyyy-MM-dd HH:mm:ss"); this.lbEndTime.Text = coupon.EndDate.ToString("yyyy-MM-dd HH:mm:ss"); this.lbLeftCount.Text = (coupon.StockNum - coupon.ReceiveNum).ToString(); this.lbCouponUseCount.Text = coupon.maxReceivNum.ToString(); this.lbCouponName.Text = coupon.CouponName; if (coupon.IsAllProduct) { this.lbCouponUsedShopBook.Text = "适应任意商品"; } else { this.lbCouponUsedShopBook.Text = string.Format("部分商品参与<a href=\"../productList.aspx?pIds={0}\">查看活动商品</a>", CouponHelper.GetCouponProductIds(coupon.CouponId)); } string text; if (coupon.ConditionValue > 0m) { text = string.Format("订单满{0:n0}", coupon.ConditionValue); } else { text = "直"; } text = string.Format("{0}减{1:n0}", text, coupon.CouponValue); this.lbCouponTj.Text = text; this.lbCouponTj1.Text = text; this.lbCouponDateTime.Text = string.Format("{0:yyyy-MM-dd}~{1:yyyy-MM-dd}", coupon.BeginDate, coupon.EndDate); } else { base.GotoResourceNotFound(""); } PageTitle.AddSiteNameTitle(this.htmlTitle); }
protected override void AttachChildControls() { string s = HttpContext.Current.Request.QueryString.Get("m"); string str2 = HttpContext.Current.Request.QueryString.Get("type"); this.ltGetTotal = (Literal)this.FindControl("ltGetTotal"); this.ltOrderAmountCanUse = (Literal)this.FindControl("ltOrderAmountCanUse"); this.ltExpiryTime = (Literal)this.FindControl("ltExpiryTime"); this.ltRedPagerActivityName = (Literal)this.FindControl("ltRedPagerActivityName"); this.ltRedPagerActivityNameForOrders = (Literal)this.FindControl("ltRedPagerActivityNameForOrders"); this.ltRedPagerLimit = (Literal)this.FindControl("ltRedPagerLimit"); this.ltErrorMessage = (Literal)this.FindControl("ltErrorMessage"); this.divNoLogin = (Panel)this.FindControl("divNoLogin"); this.divNoNum = (Panel)this.FindControl("divNoNum"); this.divSuccess = (Panel)this.FindControl("divSuccess"); this.divError = (Panel)this.FindControl("divError"); this.hdCondition = (HtmlInputHidden)this.FindControl("hdCondition"); this.hlinkLogin = (HyperLink)this.FindControl("hlinkLogin"); switch (str2) { case "1": case "5": { int result = 0; int.TryParse(s, out result); if (result > 0) { int num2 = 0; int.TryParse(HttpContext.Current.Request["id"], out num2); ShareActivityInfo act = ShareActHelper.GetAct(num2); if (act != null) { CouponInfo coupon = CouponHelper.GetCoupon(act.CouponId); this.ltGetTotal.Text = coupon.CouponValue.ToString("F2").Replace(".00", ""); this.ltOrderAmountCanUse.Text = coupon.ConditionValue.ToString("F2").Replace(".00", ""); this.hdCondition.SetWhenIsNotNull(coupon.ConditionValue.ToString("F2").Replace(".00", "")); this.ltExpiryTime.Text = coupon.EndDate.ToString("yyyy-MM-dd"); if (str2 == "5") { this.ltRedPagerActivityName.Text = "该券已经到你的钱包了</div><div class='get-red-explain'><a href='/Vshop/MyCouponLists.aspx'>点击查看</a>"; } else { this.ltRedPagerActivityName.Text = coupon.CouponName ?? ""; } if (coupon.IsAllProduct) { this.ltRedPagerLimit.Text = "该券可用于任意商品的抵扣"; } else { string couponProductIds = CouponHelper.GetCouponProductIds(act.CouponId); this.ltRedPagerLimit.Text = "该券可用于部分商品的抵扣</div><div class='get-red-explain'><a href='/ProductList.aspx?pIds='" + couponProductIds + ">查看商品</a>"; } this.divSuccess.Visible = true; } } PageTitle.AddSiteNameTitle("成功获取优惠券"); return; } default: { string str5 = str2; if (str5 != null) { if (!(str5 == "-1")) { if (str5 == "-2") { this.ltErrorMessage.Text = s; this.divError.Visible = true; break; } if (str5 == "-4") { this.divNoLogin.Visible = true; break; } if (str5 == "-3") { this.divNoNum.Visible = true; break; } } else { int num3 = 0; int.TryParse(HttpContext.Current.Request["id"], out num3); ShareActivityInfo info3 = ShareActHelper.GetAct(num3); if (info3 != null) { CouponInfo info4 = CouponHelper.GetCoupon(info3.CouponId); this.ltRedPagerActivityNameForOrders.Text = info4.CouponName; string str4 = string.Concat(new object[] { "http://", Globals.DomainName, Globals.ApplicationPath, "/Vshop/GetRedPager.aspx?id=", num3.ToString(), "&userid=", Globals.GetCurrentMemberUserId() }); this.hlinkLogin.NavigateUrl = "/Vshop/UserLogin.aspx?returnUrl=" + HttpContext.Current.Server.UrlEncode(str4 + "&" + this.getopenid()); this.divNoLogin.Visible = true; } else { HttpContext.Current.Response.Redirect("/Vshop/"); HttpContext.Current.Response.End(); } } } break; } } PageTitle.AddSiteNameTitle("获取优惠券"); }
protected override void AttachChildControls() { this.lbCouponValue = (HiLiteral)this.FindControl("lbCouponValue"); this.lbCouponTj = (HiLiteral)this.FindControl("lbCouponTj"); this.lbBeginTime = (HiLiteral)this.FindControl("lbBeginTime"); this.lbEndTime = (HiLiteral)this.FindControl("lbEndTime"); this.lbCounponValue1 = (HiLiteral)this.FindControl("lbCounponValue1"); this.lbCouponTj1 = (HiLiteral)this.FindControl("lbCouponTj1"); this.lbLeftCount = (HiLiteral)this.FindControl("lbLeftCount"); this.lbCouponUseCount = (HiLiteral)this.FindControl("lbCouponUseCount"); this.lbCouponUsedShopBook = (HiLiteral)this.FindControl("lbCouponUsedShopBook"); this.lbCouponDateTime = (HiLiteral)this.FindControl("lbCouponDateTime"); this.lbCouponName = (HiLiteral)this.FindControl("lbCouponName"); CouponInfo coupon = CouponHelper.GetCoupon(this.couponId); if (coupon != null) { this.htmlTitle = coupon.CouponName; this.lbCouponValue.Text = coupon.CouponValue.ToString("n0"); this.lbCounponValue1.Text = coupon.CouponValue.ToString("n0"); this.lbBeginTime.Text = coupon.BeginDate.ToString("yyyy-MM-dd HH:mm:ss"); this.lbEndTime.Text = coupon.EndDate.ToString("yyyy-MM-dd HH:mm:ss"); this.lbLeftCount.Text = (coupon.StockNum - coupon.ReceiveNum).ToString(); this.lbCouponUseCount.Text = coupon.maxReceivNum.ToString(); this.lbCouponName.Text = coupon.CouponName; if (coupon.IsAllProduct) { this.lbCouponUsedShopBook.Text = "适应任意商品"; } else { this.lbCouponUsedShopBook.Text = string.Format("部分商品参与<a href=\"../productList.aspx?pIds={0}\">查看活动商品</a>", CouponHelper.GetCouponProductIds(coupon.CouponId)); } string str = ""; if (coupon.ConditionValue > 0M) { str = string.Format("订单满{0:n0}", coupon.ConditionValue); } else { str = "直"; } str = string.Format("{0}减{1:n0}", str, coupon.CouponValue); this.lbCouponTj.Text = str; this.lbCouponTj1.Text = str; this.lbCouponDateTime.Text = string.Format("{0:yyyy-MM-dd}~{1:yyyy-MM-dd}", coupon.BeginDate, coupon.EndDate); } else { base.GotoResourceNotFound(""); } PageTitle.AddSiteNameTitle(this.htmlTitle); }