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() { 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); }
protected override void AttachChildControls() { string value = this.Page.Request.QueryString["type"]; string msg = this.Page.Request.QueryString["errorMsg"]; ErrorType errorType = ErrorType.前台404; if (!string.IsNullOrWhiteSpace(value)) { try { errorType = (ErrorType)System.Enum.Parse(typeof(ErrorType), value); } catch (System.Exception) { errorType = ErrorType.前台其它错误; } } this.litImgIndex = (HiLiteral)this.FindControl("litImgIndex"); this.litDescription = (HiLiteral)this.FindControl("litDescription"); switch (errorType) { case ErrorType.前台404: this.litDescription.Text = "糟糕...这个页面打不开了"; this.litImgIndex.Text = "1"; break; case ErrorType.前台商品下架: this.litDescription.Text = "哎呀...这个商品已经下架了"; this.litImgIndex.Text = "2"; break; default: this.litDescription.Text = "很抱歉!我们正在修复中……"; this.litImgIndex.Text = "1"; break; } if (!string.IsNullOrEmpty(msg)) { this.litDescription.Text = msg; } PageTitle.AddSiteNameTitle("出错了"); }
protected override void AttachChildControls() { VoteInfo vote = VoteHelper.GetVote(this.voteId); this.imgVoteItem = (HiImage)this.FindControl("imgVoteItem"); this.lVoteTitle = (HiLiteral)this.FindControl("lVoteTitle"); this.lVoteDescription = (HiLiteral)this.FindControl("lVoteDescription"); this.lVoteCount = (HiLiteral)this.FindControl("lVoteCount"); this.rptVoteItem = (VshopTemplatedRepeater)this.FindControl("rptVoteItem"); this.lVoteDate = (HiLiteral)this.FindControl("lVoteDate"); this.lVoteType = (HiLiteral)this.FindControl("lVoteType"); if (vote != null) { this.htmlTitle = vote.VoteName; this.lVoteTitle.Text = vote.VoteName; this.imgVoteItem.ImageUrl = vote.ImageUrl; this.lVoteDescription.Text = vote.Description; this.lVoteCount.Text = vote.VoteAttends.ToString(); this.lVoteDate.Text = string.Format("{0:yyyy-MM-dd HH:mm:ss} 至 {1:yyyy-MM-dd HH:mm:ss} ", vote.StartDate, vote.EndDate); if (vote.IsMultiCheck) { this.lVoteType.Text = "多选"; this.rptVoteItem.TemplateFile = "/Tags/Skin-Common-BeginVoteItemCheckBox.ascx"; } else { this.lVoteType.Text = "单选"; this.rptVoteItem.TemplateFile = "/Tags/Skin-Common-BeginVoteItem.ascx"; } this.rptVoteItem.DataSource = vote.VoteItems; this.rptVoteItem.DataBind(); } else { base.GotoResourceNotFound(""); } PageTitle.AddSiteNameTitle(this.htmlTitle); }