internal static StoreActivityEntityList ProcessActivity(Dictionary <int, List <StoreActivityEntity> > activitityDic, int storeId) { StoreActivityEntityList storeActivityEntityList = new StoreActivityEntityList(); if (!activitityDic.ContainsKey(storeId) && !activitityDic.ContainsKey(-1)) { return(storeActivityEntityList); } List <StoreActivityEntity> list = activitityDic.ContainsKey(storeId) ? activitityDic[storeId] : new List <StoreActivityEntity>(); if (activitityDic.ContainsKey(-1)) { list.InsertRange(0, activitityDic[-1]); } storeActivityEntityList.FullAmountReduceList = (from t in list where t.PromoteType == 12 || t.PromoteType == 13 || t.PromoteType == 14 || t.PromoteType == 4 select t into a orderby a.StartDate select a).ToList(); storeActivityEntityList.ActivityCount += ((storeActivityEntityList.FullAmountReduceList.Count > 0) ? 1 : 0); storeActivityEntityList.FullAmountSentFreightList = (from t in list where t.PromoteType == 17 select t into a orderby a.StartDate select a).ToList(); storeActivityEntityList.ActivityCount += ((storeActivityEntityList.FullAmountSentFreightList.Count > 0) ? 1 : 0); storeActivityEntityList.FullAmountSentGiftList = (from t in list where t.PromoteType == 15 || t.PromoteType == 16 select t into a orderby a.StartDate select a).ToList(); storeActivityEntityList.ActivityCount += ((storeActivityEntityList.FullAmountSentGiftList.Count > 0) ? 1 : 0); return(storeActivityEntityList); }
private void BindPromotionInfo() { StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(0, 0); if (storeActivityEntity.FullAmountReduceList.Count > 0) { HtmlGenericControl htmlGenericControl = this.liOrderPromotions; HtmlGenericControl htmlGenericControl2 = this.liOrderPromotions2; bool visible = htmlGenericControl2.Visible = true; htmlGenericControl.Visible = visible; string empty = string.Empty; empty = (from t in storeActivityEntity.FullAmountReduceList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); Literal literal = this.ltlOrderPromotion2; Literal literal2 = this.ltlOrderPromotion; string text3 = literal.Text = (literal2.Text = empty); } if (storeActivityEntity.FullAmountSentFreightList.Count > 0) { HtmlGenericControl htmlGenericControl3 = this.liOrderPromotions_free2; HtmlGenericControl htmlGenericControl4 = this.liOrderPromotions_free; bool visible = htmlGenericControl4.Visible = true; htmlGenericControl3.Visible = visible; string empty2 = string.Empty; empty2 += (from t in storeActivityEntity.FullAmountSentFreightList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); Literal literal3 = this.ltlOrderPromotion_free2; Literal literal4 = this.ltlOrderPromotion_free; string text3 = literal3.Text = (literal4.Text = empty2); } string text6 = this.BindProductSendGifts(); if (storeActivityEntity.FullAmountSentGiftList.Count > 0 || !string.IsNullOrEmpty(text6)) { if (storeActivityEntity.FullAmountSentGiftList.Count > 0) { string text7 = (from t in storeActivityEntity.FullAmountSentGiftList select t.ActivityName).Aggregate((string t, string n) => t + ", " + n); HtmlGenericControl htmlGenericControl5 = this.liProductSendGifts; HtmlGenericControl htmlGenericControl6 = this.liProductSendGifts2; bool visible = htmlGenericControl6.Visible = true; htmlGenericControl5.Visible = visible; Literal literal5 = this.ltlProductSendGifts; Literal literal6 = this.ltlProductSendGifts2; string text3 = literal5.Text = (literal6.Text = text7); } if (!string.IsNullOrEmpty(text6)) { HtmlGenericControl htmlGenericControl7 = this.liProductSendGifts; HtmlGenericControl htmlGenericControl8 = this.liProductSendGifts2; bool visible = htmlGenericControl8.Visible = true; htmlGenericControl7.Visible = visible; Literal literal7 = this.ltlProductSendGifts; literal7.Text = literal7.Text + "</em>" + text6; Literal literal8 = this.ltlProductSendGifts2; literal8.Text = literal8.Text + "</em>" + text6; } } }
private void GetActivity(HttpContext context) { int storeId = context.Request["storeId"].ToInt(0); StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(storeId, 0); string s = JsonConvert.SerializeObject(storeActivityEntity); context.Response.ContentType = "text/json"; context.Response.Write(s); }
private void GetPromotions() { int num = this.context.Request.QueryString["productId"].ToInt(0); int storeId = this.context.Request.QueryString["storeId"].ToInt(0); StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(storeId, 0); string s = JsonConvert.SerializeObject(storeActivityEntity); this.context.Response.ContentType = "text/json"; this.context.Response.Write(s); }
private void BindPromotionInfo() { StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(0, this.productId); if (storeActivityEntity.FullAmountReduceList.Count > 0) { this.liOrderPromotions.Visible = true; this.liOrderPromotions2.Visible = true; string empty = string.Empty; empty = (from t in storeActivityEntity.FullAmountReduceList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); Literal literal = this.ltlOrderPromotion2; Literal literal2 = this.ltlOrderPromotion; string text3 = literal.Text = (literal2.Text = empty); } if (storeActivityEntity.FullAmountSentFreightList.Count > 0) { this.liOrderPromotions_free.Visible = true; this.liOrderPromotions_free2.Visible = true; string empty2 = string.Empty; empty2 += (from t in storeActivityEntity.FullAmountSentFreightList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); Literal literal3 = this.ltlOrderPromotion_free2; Literal literal4 = this.ltlOrderPromotion_free; string text3 = literal3.Text = (literal4.Text = empty2); } string text6 = this.BindProductSendGifts(); if (storeActivityEntity.FullAmountSentGiftList.Count > 0 || !string.IsNullOrEmpty(text6)) { if (storeActivityEntity.FullAmountSentGiftList.Count > 0) { string text7 = (from t in storeActivityEntity.FullAmountSentGiftList select t.ActivityName).Aggregate((string t, string n) => t + ", " + n); this.liProductSendGifts2.Visible = true; this.liProductSendGifts.Visible = true; Literal literal5 = this.ltlProductSendGifts; Literal literal6 = this.ltlProductSendGifts2; string text3 = literal5.Text = (literal6.Text = text7); } if (!string.IsNullOrEmpty(text6)) { this.liProductSendGifts2.Visible = true; this.liProductSendGifts.Visible = true; Literal literal7 = this.ltlProductSendGifts; literal7.Text = literal7.Text + (string.IsNullOrEmpty(this.ltlProductSendGifts.Text) ? "" : ",") + text6; Literal literal8 = this.ltlProductSendGifts2; literal8.Text = literal8.Text + (string.IsNullOrEmpty(this.ltlProductSendGifts2.Text) ? "" : ",") + text6; } } }
private void BindOrderPromotions() { string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.productId); StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(0, 0); if (storeActivityEntity.FullAmountReduceList.Count > 0) { HtmlGenericControl htmlGenericControl = this.divOrderPromotions; Literal literal = this.ltlOrderPromotion; bool visible = literal.Visible = true; htmlGenericControl.Visible = visible; string text = (from t in storeActivityEntity.FullAmountReduceList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); this.ltlOrderPromotion.Text = text; } string productPromotionsInfo = this.GetProductPromotionsInfo(); if (!string.IsNullOrEmpty(productPromotionsInfo)) { this.ltlPromotionSendGifts.Text = productPromotionsInfo; HtmlGenericControl htmlGenericControl2 = this.divOrderPromotions4; Literal literal2 = this.ltlPromotionSendGifts; bool visible = literal2.Visible = true; htmlGenericControl2.Visible = visible; } if (storeActivityEntity.FullAmountSentGiftList.Count > 0 && storeActivityEntity.FullAmountSentGiftList.Count > 0) { string text2 = (from t in storeActivityEntity.FullAmountSentGiftList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); HtmlGenericControl htmlGenericControl3 = this.divOrderPromotions2; Literal literal3 = this.ltlProductSendGifts; bool visible = literal3.Visible = true; htmlGenericControl3.Visible = visible; this.ltlProductSendGifts.Text = text2; } if (storeActivityEntity.FullAmountSentFreightList.Count > 0) { HtmlGenericControl htmlGenericControl4 = this.divOrderPromotions3; Literal literal4 = this.ltlOrderPromotion_free; bool visible = literal4.Visible = true; htmlGenericControl4.Visible = visible; string text3 = (from t in storeActivityEntity.FullAmountSentFreightList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); this.ltlOrderPromotion_free.Text = text3; } }
protected override void AttachChildControls() { base.CheckOpenMultStore(); this.storeLogo = (HtmlImage)this.FindControl("storeLogo"); this.litAddress = (Literal)this.FindControl("litAddress"); this.litStoreName = (Literal)this.FindControl("litStoreName"); this.litStoreName2 = (Literal)this.FindControl("litStoreName2"); this.litOpenDate = (Literal)this.FindControl("litOpenDate"); this.litStoreDelive = (Literal)this.FindControl("litStoreDelive"); this.litActivityList = (Literal)this.FindControl("litActivityList"); this.litActivityCount = (Literal)this.FindControl("litActivityCount"); this.hidLatitude = (HtmlInputHidden)this.FindControl("hidLatitude"); this.hidLongitude = (HtmlInputHidden)this.FindControl("hidLongitude"); this.hidStoreName = (HtmlInputHidden)this.FindControl("hidStoreName"); this.hidIsOpenData = (HtmlInputHidden)this.FindControl("hidIsOpenData"); this.hdQQMapKey = (HtmlInputHidden)this.FindControl("hdQQMapKey"); this.rp_markting = (Repeater)this.FindControl("rp_markting"); int.TryParse(this.Page.Request.QueryString["storeId"], out this.storeId); int num = this.Page.Request.QueryString["storeSource"].ToInt(0); string cookie = WebHelper.GetCookie("UserCoordinateCookie", "Coordinate"); this.hidIsReloadPosition = (HtmlInputHidden)this.FindControl("hidIsReloadPosition"); this.aTel = (HtmlAnchor)this.FindControl("aTel"); this.litStoreTel = (Literal)this.FindControl("litStoreTel"); this.hdAppId = (HtmlInputHidden)this.FindControl("hdAppId"); this.hdTitle = (HtmlInputHidden)this.FindControl("hdTitle"); this.hdDesc = (HtmlInputHidden)this.FindControl("hdDesc"); this.hdImgUrl = (HtmlInputHidden)this.FindControl("hdImgUrl"); this.hdLink = (HtmlInputHidden)this.FindControl("hdLink"); this.hdAppId.Value = HiContext.Current.SiteSettings.WeixinAppId; SiteSettings masterSettings = SettingsManager.GetMasterSettings(); if (!masterSettings.OpenMultStore) { this.Page.Response.Redirect("Default.aspx"); } else if (masterSettings.Store_PositionRouteTo == 2.ToString() && num != 3 && num != 2 && num != 1 && num != 4) { this.Page.Response.Redirect("StoreList?from"); } this.hdQQMapKey.Value = (string.IsNullOrEmpty(masterSettings.QQMapAPIKey) ? "SYJBZ-DSLR3-IWX3Q-3XNTM-ELURH-23FTP" : masterSettings.QQMapAPIKey); string cookie2 = WebHelper.GetCookie("UserCoordinateTimeCookie"); if (this.storeId > 0 && !string.IsNullOrWhiteSpace(cookie) && !string.IsNullOrEmpty(cookie2)) { StoresInfo storeById = StoresHelper.GetStoreById(this.storeId); if (storeById != null && storeById.StoreId > 0) { this.hdTitle.Value = storeById.StoreName; this.hdDesc.Value = storeById.StoreName; string storeImages = storeById.StoreImages; string local = string.IsNullOrEmpty(storeImages) ? SettingsManager.GetMasterSettings().LogoUrl : storeImages; this.hdImgUrl.Value = Globals.FullPath(local); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); MemberInfo user = HiContext.Current.User; if (user.UserId != 0 && user.IsReferral() && string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralUserId"])) { string text = HttpContext.Current.Request.Url.ToString(); text = ((text.IndexOf("?") <= -1) ? (text + "?ReferralUserId=" + HiContext.Current.UserId) : (text + "&ReferralUserId=" + HiContext.Current.UserId)); this.Page.Response.Redirect(text); } else { string cookie3 = WebHelper.GetCookie("UserCoordinateCookie"); this.litAddress.Text = HttpUtility.UrlDecode(WebHelper.GetCookie("UserCoordinateCookie", "Address")); this.storeLogo.Src = storeById.StoreImages; this.litStoreName.SetWhenIsNotNull("<a href=\"StoreAbout?StoreId=" + storeById.StoreId + "\">" + storeById.StoreName + "</a>"); this.litStoreName2.SetWhenIsNotNull("<a href=\"StoreAbout?StoreId=" + storeById.StoreId + "\">" + storeById.StoreName + "</a>"); string text2 = (storeById.OpenEndDate < storeById.OpenStartDate) ? "次日" : ""; Literal literal = this.litOpenDate; DateTime dateTime = storeById.OpenStartDate; string arg = dateTime.ToString("HH:mm"); string arg2 = text2; dateTime = storeById.OpenEndDate; literal.Text = string.Format("{0} 至 {1}{2}", arg, arg2, dateTime.ToString("HH:mm")); HtmlInputHidden htmlInputHidden = this.hidLatitude; double? nullable = storeById.Latitude; htmlInputHidden.Value = nullable.ToString(); HtmlInputHidden htmlInputHidden2 = this.hidLongitude; nullable = storeById.Longitude; htmlInputHidden2.Value = nullable.ToString(); this.hidStoreName.Value = storeById.StoreName.ToString(); this.aTel.HRef = "tel://" + storeById.Tel; this.litStoreTel.Text = storeById.Tel; if (!base.site.Store_IsOrderInClosingTime) { dateTime = DateTime.Now; string str = dateTime.ToString("yyyy-MM-dd"); dateTime = storeById.OpenStartDate; DateTime value = (str + " " + dateTime.ToString("HH:mm")).ToDateTime().Value; dateTime = DateTime.Now; string str2 = dateTime.ToString("yyyy-MM-dd"); dateTime = storeById.OpenEndDate; DateTime dateTime2 = (str2 + " " + dateTime.ToString("HH:mm")).ToDateTime().Value; if (dateTime2 <= value) { dateTime2 = dateTime2.AddDays(1.0); } this.hidIsOpenData.Value = "true"; if (DateTime.Now < value || DateTime.Now > dateTime2) { this.hidIsOpenData.Value = "false"; } } if (storeById.IsStoreDelive) { decimal?minOrderPrice = storeById.MinOrderPrice; int num2; if (minOrderPrice.GetValueOrDefault() > default(decimal) && minOrderPrice.HasValue) { Literal literal2 = this.litStoreDelive; num2 = storeById.MinOrderPrice.ToInt(0); literal2.Text = $"¥{num2.ToString()}起送,"; } minOrderPrice = storeById.StoreFreight; if (minOrderPrice.GetValueOrDefault() > default(decimal) && minOrderPrice.HasValue) { Literal literal3 = this.litStoreDelive; string text3 = literal3.Text; num2 = storeById.StoreFreight.ToInt(0); literal3.Text = text3 + $"配送费¥{num2.ToString()}"; } else { Literal literal4 = this.litStoreDelive; literal4.Text += "免配送费"; } } StoreActivityEntityList storeActivity = StoresHelper.GetStoreActivity(this.storeId); if (storeActivity != null) { StringBuilder stringBuilder = new StringBuilder(); if (storeActivity.FullAmountReduceList.Count > 0) { stringBuilder.AppendFormat("<div class=\"jian\"><i class=\"tag tag_green\">减</i><span>"); int num3 = 0; while (num3 < storeActivity.FullAmountReduceList.Count) { if (num3 < 2) { stringBuilder.AppendFormat("{0};", storeActivity.FullAmountReduceList[num3].ActivityName); num3++; continue; } stringBuilder.AppendFormat("{0}{1}", storeActivity.FullAmountReduceList[num3].ActivityName, (storeActivity.FullAmountReduceList.Count > 3) ? "等" : ""); break; } if (stringBuilder.ToString().EndsWith(";")) { stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(';'), 1); } stringBuilder.AppendFormat("</span></div>"); } if (storeActivity.FullAmountSentFreightList.Count > 0) { stringBuilder.AppendFormat("<div class=\"mian\"><i class=\"tag tag_yellow\">免</i><span>"); int num4 = 0; while (num4 < storeActivity.FullAmountSentFreightList.Count) { if (num4 < 2) { stringBuilder.AppendFormat("{0};", storeActivity.FullAmountSentFreightList[num4].ActivityName); num4++; continue; } stringBuilder.AppendFormat("{0}{1}", storeActivity.FullAmountSentFreightList[num4].ActivityName, (storeActivity.FullAmountSentFreightList.Count > 3) ? "等" : ""); break; } if (stringBuilder.ToString().EndsWith(";")) { stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(';'), 1); } stringBuilder.AppendFormat("</span></div>"); } if (storeActivity.FullAmountSentGiftList.Count > 0) { stringBuilder.AppendFormat("<div class=\"song\"><i class=\"tag tag_blue\">送</i><span>"); int num5 = 0; while (num5 < storeActivity.FullAmountSentGiftList.Count) { if (num5 < 2) { stringBuilder.AppendFormat("{0};", storeActivity.FullAmountSentGiftList[num5].ActivityName); num5++; continue; } stringBuilder.AppendFormat("{0}{1}", storeActivity.FullAmountSentGiftList[num5].ActivityName, (storeActivity.FullAmountSentGiftList.Count > 3) ? "等" : ""); break; } if (stringBuilder.ToString().EndsWith(";")) { stringBuilder.Remove(stringBuilder.ToString().LastIndexOf(';'), 1); } stringBuilder.AppendFormat("</span></div>"); } this.litActivityList.Text = stringBuilder.ToString(); if (storeActivity.ActivityCount > 1) { this.litActivityCount.Text = $"<div id=\"huod-b\"><a href=\"javascript:;\">{storeActivity.ActivityCount}个活动</a><i></i></div>"; } } if (this.rp_markting != null) { List <StoreMarktingInfo> storeMarktingInfoList = StoreMarktingHelper.GetStoreMarktingInfoList(); foreach (StoreMarktingInfo item in storeMarktingInfoList) { item.StoreId = this.storeId; item.RedirectTo = this.RedirectToFullPath(item.RedirectTo); } this.rp_markting.DataSource = storeMarktingInfoList; this.rp_markting.DataBind(); } PageTitle.AddSiteNameTitle(storeById.StoreName); } } } else { this.hidIsReloadPosition.Value = "1"; } }
private void BindOrderPromotions() { string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.productId); StoreActivityEntityList storeActivityEntity = PromoteHelper.GetStoreActivityEntity(0, this.productId); if (storeActivityEntity.FullAmountReduceList.Count > 0) { HtmlGenericControl htmlGenericControl = this.divOrderPromotions; Literal literal = this.ltlOrderPromotion; bool visible = literal.Visible = true; htmlGenericControl.Visible = visible; string text = (from t in storeActivityEntity.FullAmountReduceList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); this.ltlOrderPromotion.Text = text; } string productPromotionsInfo = this.GetProductPromotionsInfo(); if (storeActivityEntity.FullAmountSentGiftList.Count > 0 || !string.IsNullOrEmpty(productPromotionsInfo)) { if (storeActivityEntity.FullAmountSentGiftList.Count > 0) { string text2 = (from t in storeActivityEntity.FullAmountSentGiftList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); HtmlGenericControl htmlGenericControl2 = this.divOrderPromotions2; Literal literal2 = this.ltlProductSendGifts; bool visible = literal2.Visible = true; htmlGenericControl2.Visible = visible; this.ltlProductSendGifts.Text = text2; } if (!string.IsNullOrEmpty(productPromotionsInfo)) { HtmlGenericControl htmlGenericControl3 = this.divOrderPromotions2; Literal literal3 = this.ltlProductSendGifts; bool visible = literal3.Visible = true; htmlGenericControl3.Visible = visible; Literal literal4 = this.ltlProductSendGifts; literal4.Text = literal4.Text + (string.IsNullOrEmpty(this.ltlProductSendGifts.Text) ? "" : ",") + productPromotionsInfo; } } if (storeActivityEntity.FullAmountSentFreightList.Count > 0) { HtmlGenericControl htmlGenericControl4 = this.divOrderPromotions3; Literal literal5 = this.ltlOrderPromotion_free; bool visible = literal5.Visible = true; htmlGenericControl4.Visible = visible; string text3 = (from t in storeActivityEntity.FullAmountSentFreightList select t.ActivityName).Aggregate((string t, string n) => t + "," + n); this.ltlOrderPromotion_free.Text = text3; } if (!string.IsNullOrEmpty(phonePriceByProductId) && (this.sitesettings.OpenAliho == 1 || this.sitesettings.OpenMobbile == 1 || this.sitesettings.OpenVstore == 1 || this.sitesettings.OpenWap == 1)) { this.divPhonePrice.Visible = true; string s = phonePriceByProductId.Split(',')[0]; string[] array = this.lblBuyPrice.Text.Split('-'); decimal num = decimal.Parse(array[0].Trim()) - decimal.Parse(s); this.litPhonePrice.Text = ((num > decimal.Zero) ? num : decimal.Zero).F2ToString("f2"); this.litPhonePriceEndDate.Text = phonePriceByProductId.Split(',')[1]; } else { this.divPhonePrice.Visible = false; } }