public string GetPrizeName(int PrizeType, int PrizeValue) { switch (PrizeType) { case 2: { CouponInfo coupon = CouponHelper.GetCoupon(PrizeValue); if (coupon != null) { return(coupon.Price.F2ToString("f2") + "元优惠券"); } return(PrizeValue + "元优惠券"); } case 3: { GiftInfo giftDetails = GiftHelper.GetGiftDetails(PrizeValue); if (giftDetails != null) { return(giftDetails.Name); } return("礼品"); } default: return(PrizeValue + "积分"); } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; try { if (Globals.GetCurrentManagerUserId() <= 0) { context.Response.Write("{\"type\":\"error\",\"data\":\"请先登录\"}"); context.Response.End(); } CouponInfo coupon = CouponHelper.GetCoupon(int.Parse(context.Request["id"].ToString())); var type = new { type = "success", time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), data = coupon }; IsoDateTimeConverter converter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" }; string s = JsonConvert.SerializeObject(type, Formatting.Indented, new JsonConverter[] { converter }); context.Response.Write(s); } catch (Exception exception) { context.Response.Write("{\"type\":\"error\",\"data\":\"" + exception.Message + "\"}"); } }
public static string GetPrizeFullName(PrizeResultViewInfo item) { switch (item.PrizeType) { case PrizeType.赠送积分: return(string.Format("{0} 积分", item.GivePoint)); case PrizeType.赠送优惠券: { CouponInfo coupon = CouponHelper.GetCoupon(int.Parse(item.GiveCouponId)); if (coupon == null) { return("优惠券" + item.GiveCouponId + "[已删除]"); } return(coupon.CouponName); } case PrizeType.赠送商品: { ProductInfo productBaseInfo = ProductHelper.GetProductBaseInfo(int.Parse(item.GiveShopBookId)); if (productBaseInfo == null) { return("赠送商品[已删除]"); } return(productBaseInfo.ProductName); } } return(""); }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(Page.Request.QueryString["couponId"], out couponId)) { base.GotoResourceNotFound(); } else { btnEditCoupons.Click += new EventHandler(btnEditCoupons_Click); if (!Page.IsPostBack) { CouponInfo coupon = CouponHelper.GetCoupon(couponId); if (coupon == null) { base.GotoResourceNotFound(); } else { Globals.EntityCoding(coupon, false); lblEditCouponId.Text = coupon.CouponId.ToString(); txtCouponName.Text = coupon.Name; if (coupon.Amount.HasValue) { txtAmount.Text = string.Format("{0:F2}", coupon.Amount); } txtDiscountValue.Text = coupon.DiscountValue.ToString("F2"); calendarEndDate.SelectedDate = new DateTime?(coupon.ClosingTime); txtNeedPoint.Text = coupon.NeedPoint.ToString(); } } } }
public string GetPrizeType(PrizeTypes PrizeType, int PrizeValue) { string result = string.Empty; switch (PrizeType) { case PrizeTypes.Integral: result = PrizeValue + "积分; "; break; case PrizeTypes.Coupou: { CouponInfo coupon = CouponHelper.GetCoupon(PrizeValue); result = ((coupon == null) ? " " : ((!(coupon.ClosingTime > coupon.StartTime)) ? (coupon.Price + "元优惠券<font style='color:red;'>(已失效)</font>; ") : (coupon.Price + "元优惠券; "))); break; } case PrizeTypes.Gift: { GiftInfo giftDetails = GiftHelper.GetGiftDetails(PrizeValue); result = ((giftDetails == null) ? " " : (giftDetails.Name + "; ")); break; } } return(result); }
private void GetCouponInfo(System.Web.HttpContext context) { context.Response.ContentType = "application/json"; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("{"); int couponId = 0; if (!int.TryParse(context.Request["id"], out couponId)) { stringBuilder.Append("\"Status\":\"0\"}"); context.Response.Write(stringBuilder.ToString()); } CouponInfo coupon = CouponHelper.GetCoupon(couponId); if (coupon == null) { stringBuilder.Append("\"Status\":\"1\"}"); context.Response.Write(stringBuilder.ToString()); return; } var value = new { Status = 2, Count = coupon.StockNum - coupon.ReceiveNum, BeginTime = coupon.BeginDate, EndTime = coupon.EndDate }; IsoDateTimeConverter isoDateTimeConverter = new IsoDateTimeConverter(); isoDateTimeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; context.Response.Write(JsonConvert.SerializeObject(value, Formatting.Indented, new JsonConverter[] { isoDateTimeConverter })); }
public void ProcessRequest(System.Web.HttpContext context) { context.Response.ContentType = "text/plain"; try { int couponId = int.Parse(context.Request["id"].ToString()); CouponInfo coupon = CouponHelper.GetCoupon(couponId); var value = new { type = "success", time = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), data = coupon }; string s = JsonConvert.SerializeObject(value, Formatting.Indented, new JsonConverter[] { new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" } }); context.Response.Write(s); } catch (System.Exception ex) { context.Response.Write("{\"type\":\"error\",\"data\":\"" + ex.Message + "\"}"); } }
protected override void AttachChildControls() { this.uimg = (Image)this.FindControl("uimg"); this.btnlq = (Button)this.FindControl("btnlq"); this.txtID = (HtmlInputHidden)this.FindControl("txtID"); this.txtBgImg = (HtmlInputHidden)this.FindControl("txtBgImg"); this.litMoney = (Literal)this.FindControl("litMoney"); this.btnlq.Click += new EventHandler(this.btnlq_Click); if (this.Page.Request.QueryString["ID"] != null) { int ID = Convert.ToInt32(this.Page.Request.QueryString["ID"]); if (ID != 0) { CouponsActShare cas = CouponHelper.GetCouponsActShare(ID); CouponsAct ca = CouponHelper.GetCouponsAct(cas.CouponsActID); this.txtBgImg.Value = ca.BgImg; this.txtID.Value = cas.ID + ""; this.uimg.ImageUrl = cas.UserImg; CouponInfo c = CouponHelper.GetCoupon(ca.CouponsID); this.litMoney.Text = c.DiscountValue.ToString("0.00"); } } else { } }
private void GetCouponInfo(HttpContext context) { context.Response.ContentType = "application/json"; StringBuilder builder = new StringBuilder("{"); int result = 0; if (!int.TryParse(context.Request["id"], out result)) { builder.Append("\"Status\":\"0\"}"); context.Response.Write(builder.ToString()); } CouponInfo coupon = CouponHelper.GetCoupon(result); if (coupon == null) { builder.Append("\"Status\":\"1\"}"); context.Response.Write(builder.ToString()); } else { var type = new { Status = 2, Count = coupon.StockNum - coupon.ReceiveNum, BeginTime = coupon.BeginDate, EndTime = coupon.EndDate }; IsoDateTimeConverter converter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" }; context.Response.Write(JsonConvert.SerializeObject(type, Formatting.Indented, new JsonConverter[] { converter })); } }
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); }
public void GetSelectProductType(System.Web.HttpContext context) { context.Response.ContentType = "application/json"; StringBuilder stringBuilder = new StringBuilder(); int couponId; if (!int.TryParse(context.Request["couponId"].ToString(), out couponId)) { context.Response.Write("{\"success\":false,\"msg\":\"异常操作\"}"); return; } else { CouponInfo coupon = CouponHelper.GetCoupon(couponId); IList <CouponsSendTypeItem> listSendTypeItem = CouponHelper.GetCouponsSendTypeItems(coupon.CouponId); IList <int> productTypeIds = new List <int>(); foreach (CouponsSendTypeItem item in listSendTypeItem) { productTypeIds.Add(item.BindId); } IList <CategoryInfo> categorylist = CatalogHelper.GetCategoryByIds(productTypeIds); if (categorylist != null) { int i = 0; stringBuilder.Append("["); foreach (CategoryInfo category in categorylist) { stringBuilder.Append("{"); stringBuilder.AppendFormat("\"id\":{0},", category.CategoryId); stringBuilder.AppendFormat("\"pId\":{0},", category.ParentCategoryId); stringBuilder.AppendFormat("\"name\":\"{0}\"", category.Name); stringBuilder.Append("}"); if (i < categorylist.Count - 1) { stringBuilder.Append(","); } i++; } stringBuilder.Append("]"); context.Response.Write(stringBuilder.ToString()); } } }
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() { PageTitle.AddSiteNameTitle("关注公众号领取优惠券"); this.litPrompt = (Literal)this.FindControl("litPrompt"); this.buy = (HyperLink)this.FindControl("Buy"); this.CouponID = this.Context.Request["cid"].ToInt(0); if (!this.Page.IsPostBack) { CouponInfo coupon = CouponHelper.GetCoupon(this.CouponID); this.litPrompt.Text = coupon.CouponName; this.SendSendCouponToUsers(coupon.CouponId); } }
public void GetCouponById(System.Web.HttpContext context) { context.Response.ContentType = "application/json"; StringBuilder stringBuilder = new StringBuilder(); int couponId; if (!int.TryParse(context.Request["couponId"].ToString(), out couponId)) { context.Response.Write("{\"success\":false,\"msg\":\"异常操作\"}"); return; } else { CouponInfo coupon = CouponHelper.GetCoupon(couponId); if (coupon == null) { context.Response.Write("{\"success\":false,\"msg\":\"异常操作\"}"); return; } if (coupon.ClosingTime.CompareTo(System.DateTime.Now) < 0) { context.Response.Write("{\"success\":false,\"msg\":\"该优惠券已经结束!\"}"); return; } Globals.EntityCoding(coupon, false); stringBuilder.Append("{"); stringBuilder.AppendFormat("\"Name\":\"{0}\",", coupon.Name); stringBuilder.AppendFormat("\"StartTime\":\"{0}\",", coupon.StartTime.ToString("yyyyMMdd")); stringBuilder.AppendFormat("\"ClosingTime\":\"{0}\",", coupon.ClosingTime.ToString("yyyyMMdd")); if (coupon.Amount.HasValue) { stringBuilder.AppendFormat("\"Amount\":\"{0}\",", string.Format("{0:F2}", coupon.Amount)); } stringBuilder.AppendFormat("\"DiscountValue\":\"{0}\",", coupon.DiscountValue.ToString("F2")); stringBuilder.AppendFormat("\"NeedPoint\":\"{0}\",", coupon.NeedPoint.ToString()); stringBuilder.AppendFormat("\"UseType\":{0},", coupon.UseType); if (!string.IsNullOrEmpty(coupon.SendTypeItem)) { stringBuilder.AppendFormat("\"SendTypeItem\":\"{0}\",", coupon.SendTypeItem); } stringBuilder.AppendFormat("\"SendType\":{0}", coupon.SendType); stringBuilder.Append("}"); context.Response.Write(stringBuilder.ToString()); } }
public static string GetPrizeFullName(PrizeResultViewInfo item) { string couponName; switch (item.PrizeType) { case PrizeType.赠送积分: { couponName = string.Format("{0} 积分", item.GivePoint); break; } case PrizeType.赠送优惠券: { CouponInfo coupon = CouponHelper.GetCoupon(int.Parse(item.GiveCouponId)); if (coupon == null) { couponName = string.Concat("优惠券", item.GiveCouponId, "[已删除]"); break; } else { couponName = coupon.CouponName; break; } } case PrizeType.赠送商品: { ProductInfo productBaseInfo = ProductHelper.GetProductBaseInfo(int.Parse(item.GiveShopBookId)); if (productBaseInfo == null) { couponName = "赠送商品[已删除]"; break; } else { couponName = productBaseInfo.ProductName; break; } } default: { couponName = ""; break; } } return(couponName); }
private void grdCoupondsList_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e) { int couponId = (int)this.grdCoupondsList.DataKeys[e.RowIndex].Value; CouponInfo coupon = CouponHelper.GetCoupon(couponId); if (coupon == null) { this.ShowMsg("没有找到这张优惠券,该优惠券可能已被删除!", false); return; } CouponHelper.setCouponFinished(couponId, !CouponsList.bFininshed); this.BindData(); if (!CouponsList.bFininshed) { this.ShowMsg("该优惠券已结束!", true); return; } this.ShowMsg("该优惠券已启用!", true); }
protected override void AttachChildControls() { PageTitle.AddSiteNameTitle("关注有礼优惠券"); this.lblAmount = (Label)this.FindControl("lblAmount"); this.lblDiscountValue = (Label)this.FindControl("lblDiscountValue"); this.startTime = (Literal)this.FindControl("startTime"); this.closingTime = (Literal)this.FindControl("closingTime"); this.shakeCoupon = (HtmlGenericControl)this.FindControl("shakeCoupon"); this.notCoupon = (HtmlGenericControl)this.FindControl("notCoupon"); this.aToGet = (HtmlAnchor)this.FindControl("aToGet"); this.CouponID = this.Context.Request["cid"].ToInt(0); if (!this.Page.IsPostBack) { CouponInfo coupon = CouponHelper.GetCoupon(this.CouponID); if (coupon != null && coupon.ClosingTime > DateTime.Now) { this.shakeCoupon.Visible = true; this.aToGet.HRef = "ShakeGetCouponsForAttention.aspx?cid=" + this.CouponID; this.lblAmount.Text = coupon.OrderUseLimit.Value.F2ToString("f2"); this.lblAmount.Style.Add("color", "#AE0000"); this.lblDiscountValue.Text = coupon.Price.F2ToString("f2"); Literal literal = this.startTime; DateTime dateTime = coupon.StartTime; literal.Text = dateTime.ToString("yyyy-MM-dd"); Literal literal2 = this.closingTime; dateTime = coupon.ClosingTime; literal2.Text = dateTime.ToString("yyyy-MM-dd"); } else { this.notCoupon.Visible = true; this.aToGet.InnerHtml = "返回商城"; this.aToGet.HRef = "Default.aspx"; } } }
public void ProcessRequest(System.Web.HttpContext context) { context.Response.ContentType = "text/plain"; int num = 0; int.TryParse(context.Request.Params["act"], out num); string types = "0"; if (num > 0 && num < 4) { types = num.ToString(); } else if (num == 4) { types = "4,5"; } System.Data.DataTable activityTopics = ActivityHelper.GetActivityTopics(types); activityTopics.Columns.Add("hasImage"); activityTopics.Columns.Add("NewMemberGrades"); activityTopics.Columns.Add("Url"); activityTopics.Columns.Add("Limit"); activityTopics.Columns.Add("Discount"); activityTopics.Columns.Add("Description"); activityTopics.Columns.Add("Point"); activityTopics.Columns.Add("CouponMoeny"); activityTopics.Columns.Add("Product"); foreach (System.Data.DataRow dataRow in activityTopics.Rows) { int num2 = int.Parse(dataRow["Id"].ToString()); int num3 = int.Parse(dataRow["ActivityType"].ToString()); string a = dataRow["MemberGrades"].ToString(); string a2 = dataRow["DefualtGroup"].ToString(); string a3 = dataRow["CustomGroup"].ToString(); if (num3 == 2 || num3 == 4 || num3 == 5) { dataRow["hasImage"] = "none"; } else { dataRow["hasImage"] = "''"; } if (a == "0" || a2 == "0" || a3 == "0") { dataRow["NewMemberGrades"] = "全部会员"; } else { dataRow["NewMemberGrades"] = "部分会员"; } if (num3 == 1) { dataRow["Url"] = "/ExchangeList.aspx?id=" + num2; } else if (num3 == 2) { dataRow["Url"] = ""; ActivityInfo act = ActivityHelper.GetAct(num2); if (act != null) { dataRow["Limit"] = "每人参与" + act.attendTime.ToString() + "次"; int meetType = act.MeetType; System.Data.DataTable activities_Detail = ActivityHelper.GetActivities_Detail(num2); string text = string.Empty; string text2 = ""; if (act.attendType == 0) { foreach (System.Data.DataRow dataRow2 in activities_Detail.Rows) { if (meetType == 1) { text2 = text2 + "满" + dataRow2["MeetNumber"].ToString() + "件"; } else { text2 = text2 + "满" + dataRow2["MeetMoney"].ToString() + "元"; } if (decimal.Parse(dataRow2["ReductionMoney"].ToString()) != 0m) { text2 = text2 + ",减" + dataRow2["ReductionMoney"].ToString() + "元"; } if (bool.Parse(dataRow2["bFreeShipping"].ToString())) { text2 += ",免邮"; } if (int.Parse(dataRow2["Integral"].ToString()) != 0) { text2 = text2 + ",送" + dataRow2["Integral"].ToString() + "积分"; } if (int.Parse(dataRow2["CouponId"].ToString()) != 0) { text2 += ",送优惠券"; } } text += text2; } else { text = "多级优惠(每层级优惠不累积叠加)<br/>"; int num4 = 0; foreach (System.Data.DataRow dataRow3 in activities_Detail.Rows) { num4++; text2 = text2 + "层级" + num4.ToString() + ":"; if (meetType == 1) { text2 = text2 + "满" + dataRow3["MeetNumber"].ToString() + "件"; } else { text2 = text2 + "满" + dataRow3["MeetMoney"].ToString() + "元"; } if (decimal.Parse(dataRow3["ReductionMoney"].ToString()) != 0m) { text2 = text2 + ",减" + dataRow3["ReductionMoney"].ToString() + "元"; } if (bool.Parse(dataRow3["bFreeShipping"].ToString())) { text2 += ",免邮"; } if (int.Parse(dataRow3["Integral"].ToString()) != 0) { text2 = text2 + ",送" + dataRow3["Integral"].ToString() + "积分"; } if (int.Parse(dataRow3["CouponId"].ToString()) != 0) { text2 += ",送优惠券"; } text2 += "<br/>"; } text += text2; } dataRow["Discount"] = text; if (act.isAllProduct) { dataRow["Product"] = "全部商品"; } else { string text3 = string.Empty; System.Data.DataTable dataTable = ActivityHelper.QueryProducts(num2); foreach (System.Data.DataRow dataRow4 in dataTable.Rows) { if (dataRow4["status"].ToString() == "0") { text3 = text3 + dataRow4["ProductID"].ToString() + "_"; } } if (!string.IsNullOrEmpty(text3)) { dataRow["Url"] = "/ProductList.aspx?pIds=" + text3.TrimEnd(new char[] { '_' }); } dataRow["Product"] = "部分商品"; } } } else if (num3 == 3) { dataRow["Url"] = "/VShop/CouponDetails.aspx?CouponId=" + num2; CouponInfo coupon = CouponHelper.GetCoupon(num2); if (coupon != null) { dataRow["CouponMoeny"] = coupon.CouponValue.ToString(); if (coupon.ConditionValue > 0m) { dataRow["Limit"] = "满" + coupon.ConditionValue.ToString() + "元可用"; } else { dataRow["Limit"] = "不限制"; } } } else if (num3 == 4) { dataRow["Url"] = "/BeginVote.aspx?voteId=" + num2; VoteInfo vote = VoteHelper.GetVote((long)num2); if (vote != null) { dataRow["Description"] = vote.Description; } } else if (num3 == 5) { GameInfo modelByGameId = GameHelper.GetModelByGameId(num2); if (modelByGameId != null) { dataRow["Url"] = modelByGameId.GameUrl; dataRow["Limit"] = this.GetLimit(modelByGameId.LimitEveryDay, modelByGameId.MaximumDailyLimit); dataRow["Point"] = modelByGameId.NeedPoint.ToString(); dataRow["Description"] = modelByGameId.Description; } } } string s = JsonConvert.SerializeObject(activityTopics, Formatting.Indented, new JsonConverter[] { new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm" } }); context.Response.Write(s); }