private void SetWXShare(CountDownInfo countDown, ProductModel product) { this.hdAppId.Value = base.site.WeixinAppId; Task.Factory.StartNew(delegate { try { string jsApiTicket = base.GetJsApiTicket(true); string text = WAPTemplatedWebControl.GenerateNonceStr(); string text2 = WAPTemplatedWebControl.GenerateTimeStamp(); string absoluteUri = this.Page.Request.Url.AbsoluteUri; this.hdTimestamp.Value = text2; this.hdNonceStr.Value = text; this.hdSignature.Value = base.GetSignature(jsApiTicket, text, text2, absoluteUri); } catch { } }); this.hdDesc.Value = (string.IsNullOrEmpty(countDown.ShareDetails) ? product.ShortDescription : countDown.ShareDetails); string local = string.IsNullOrEmpty(countDown.ShareIcon) ? ((product.ImgUrlList.Count == 0) ? SettingsManager.GetMasterSettings().DefaultProductImage : product.ImgUrlList[0]) : Globals.FullPath(countDown.ShareIcon); this.hdImgUrl.Value = Globals.FullPath(local); this.hdTitle.Value = (string.IsNullOrEmpty(countDown.ShareTitle) ? product.ProductName : countDown.ShareTitle); this.hdLink.Value = Globals.FullPath(this.Page.Request.Url.ToString()); }
private void LoadCountDown(CountDownInfo countDownInfo) { this.txtPrice.Text = countDownInfo.CountDownPrice.ToString("f2"); this.txtContent.Text = Globals.HtmlDecode(countDownInfo.Content); this.calendarEndDate.SelectedDate = new DateTime?(countDownInfo.EndDate); this.dropGroupBuyProduct.SelectedValue = new int?(countDownInfo.ProductId); }
private DataGridViewModel <Dictionary <string, object> > GetDataList(CountDownQuery query) { DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >(); if (query != null) { DbQueryResult countDownList = PromoteHelper.GetCountDownList(query); dataGridViewModel.rows = DataHelper.DataTableToDictionary(countDownList.Data); dataGridViewModel.total = countDownList.TotalRecords; foreach (Dictionary <string, object> row in dataGridViewModel.rows) { CountDownInfo countDownInfo = row.ToObject <CountDownInfo>(); int num = 0; if (countDownInfo.StartDate > DateTime.Now) { num = 1; } else if (countDownInfo.EndDate < DateTime.Now) { num = 2; } row.Add("State", num); } } return(dataGridViewModel); }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(base.Request.QueryString["CountDownId"], out this.countDownId)) { base.GotoResourceNotFound(); } else { this.btnUpdateCountDown.Click += new EventHandler(this.btnUpdateGroupBuy_Click); if (!base.IsPostBack) { this.dropGroupBuyProduct.DataBind(); this.dropCategories.DataBind(); this.HourDropDownList1.DataBind(); this.drophours.DataBind(); CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId); if (countDownInfo == null) { base.GotoResourceNotFound(); } else { this.LoadCountDown(countDownInfo); } } } }
private void LoadCountDown(CountDownInfo countDownInfo) { txtPrice.Text = countDownInfo.CountDownPrice.ToString("f2"); txtContent.Text = countDownInfo.Content; calendarEndDate.SelectedDate = new DateTime?(countDownInfo.EndDate); dropGroupBuyProduct.SelectedValue = new int?(countDownInfo.ProductId); }
protected void Page_Load(object sender, EventArgs e) { if (!int.TryParse(this.Page.Request.QueryString["countDownId"], out this.countDownId)) { base.GotoResourceNotFound(); } else if (SettingsManager.GetMasterSettings().OpenMultStore) { CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, 0); List <StoreBase> activityStores = StoreActivityHelper.GetActivityStores(countDownInfo.CountDownId, 2, countDownInfo.StoreType); this.ddlStores.DataSource = activityStores; this.ddlStores.DataBind(); this.ddlStores.Items.Insert(0, new ListItem { Text = "请选择", Value = "-1" }); this.pnlStoreDetail.Visible = true; this.ltStoreNames.Text = string.Format("已参加活动门店({0}家):{1}", activityStores.Count, (from t in activityStores select t.StoreName).Aggregate((string t, string n) => t + "、" + n)); this.hidOpenMultStore.Value = "1"; } else { this.hidOpenMultStore.Value = "0"; this.pnlStoreDetail.Visible = false; } }
private void Update() { if (m_CountDownInfoList.Count > 0) { float deltaTime = Time.deltaTime; for (int i = m_CountDownInfoList.Count - 1; i >= 0; i--) { CountDownInfo item = m_CountDownInfoList[i]; item.CountDown -= deltaTime; if (item.CountDown <= item.NextCountDown) { if (item.UpdateNotify != null && !item.IsObsolete) { item.UpdateNotify(item.NextCountDown); } if (item.CountDown <= 0 || item.IsObsolete) { item.UpdateNotify = null; m_CountDownInfoList.RemoveAt(i); } else { item.NextCountDown -= item.NotifyInterval; if (item.NextCountDown < 0) { item.NextCountDown = 0; } } } } } }
public static ShoppingCartInfo GetCountDownShoppingCart(string productSkuId, int buyAmount) { ShoppingCartInfo info = new ShoppingCartInfo(); Member user = HiContext.Current.User as Member; ShoppingCartItemInfo info2 = ShoppingProvider.Instance().GetCartItemInfo(user, productSkuId, buyAmount); if (info2 == null) { return(null); } CountDownInfo countDownInfo = ProductBrowser.GetCountDownInfo(info2.ProductId); if (countDownInfo == null) { return(null); } ShoppingCartItemInfo info4 = new ShoppingCartItemInfo(); info4.SkuId = info2.SkuId; info4.ProductId = info2.ProductId; info4.SKU = info2.SKU; info4.Name = info2.Name; info4.MemberPrice = info4.AdjustedPrice = countDownInfo.CountDownPrice; info4.SkuContent = info2.SkuContent; info4.Quantity = info4.ShippQuantity = buyAmount; info4.Weight = info2.Weight; info4.ThumbnailUrl40 = info2.ThumbnailUrl40; info4.ThumbnailUrl60 = info2.ThumbnailUrl60; info4.ThumbnailUrl100 = info2.ThumbnailUrl100; info.LineItems.Add(productSkuId, info4); return(info); }
private void SetOver(HttpContext context) { int?intParam = base.GetIntParam(context, "CountDownId", true); if (!intParam.HasValue) { throw new HidistroAshxException("错误的活动编号"); } CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(intParam.Value, 0); if (countDownInfo == null) { throw new HidistroAshxException("错误的活动编号"); } if (countDownInfo.StartDate > DateTime.Now) { throw new HidistroAshxException("该活动尚未开始"); } if (countDownInfo.EndDate < DateTime.Now) { throw new HidistroAshxException("该活动已经结束"); } PromoteHelper.SetOverCountDown(intParam.Value); base.ReturnSuccessResult(context, "活动提前结束成功", 0, true); }
protected override void AttachChildControls() { this.countDownId = this.Page.Request.QueryString["countDownId"].ToInt(0); this.storeId = this.Page.Request.QueryString["StoreId"].ToInt(0); CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, this.storeId); if (countDownInfo == null) { this.ShowWapMessage("抢购信息不存在", "default.aspx"); } 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 { this.FindControls(); this.SetControlsValue(countDownInfo); PageTitle.AddSiteNameTitle("限时抢购商品详情"); } }
private void CountDownBusiness() { if (this.CountDownId > 0) { CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.CountDownId, 0); if (countDownInfo != null) { HtmlInputHidden htmlInputHidden = this.hidden_SKUSubmitOrderCountDownId; int num = this.CountDownId; htmlInputHidden.Value = num.ToString(); List <CountDownSkuInfo> countDownSkuInfo = countDownInfo.CountDownSkuInfo; if (countDownSkuInfo.Count > 0) { this.hidden_SKUSubmitOrderCountDownMinPrice.Value = (from t in countDownSkuInfo orderby t.SalePrice select t).FirstOrDefault().SalePrice.F2ToString("f2"); CountDownSkuInfo countDownSkuInfo2 = (from t in countDownSkuInfo orderby t.TotalCount - t.BoughtCount descending select t).FirstOrDefault(); int num2 = 0; int num3 = countDownSkuInfo2.ActivityTotal - countDownSkuInfo2.BoughtCount; num2 = ((countDownSkuInfo2.TotalCount <= num3) ? countDownSkuInfo2.TotalCount : num3); this.hidden_SKUSubmitOrderCountDownStock.Value = ((num2 > 0) ? num2.ToString() : "0"); Label label = this.lblSKUSubmitOrderStockNow; num = countDownSkuInfo.Min((CountDownSkuInfo t) => t.TotalCount); label.Text = num.ToString(); } Literal literal = this.litMaxCount; num = countDownInfo.MaxCount; literal.Text = num.ToString(); } } }
private OrderInfo GetOrderInfo(ShoppingCartInfo shoppingCartInfo) { OrderInfo orderInfo = ShoppingProcessor.ConvertShoppingCartToOrder(shoppingCartInfo, this.isGroupBuy, this.isCountDown, this.isSignBuy); if (orderInfo == null) { return(null); } if (this.chkTax.Checked) { orderInfo.Tax = (orderInfo.GetTotal() * decimal.Parse(this.litTaxRate.Text)) / 100M; if (this.isBundling) { BundlingInfo bundlingInfo = ProductBrowser.GetBundlingInfo(this.bundlingid); orderInfo.Tax = (bundlingInfo.Price * decimal.Parse(this.litTaxRate.Text)) / 100M; } } orderInfo.InvoiceTitle = this.txtInvoiceTitle.Text; if (this.isGroupBuy) { GroupBuyInfo productGroupBuyInfo = ProductBrowser.GetProductGroupBuyInfo(shoppingCartInfo.LineItems[this.productSku].ProductId); orderInfo.GroupBuyId = productGroupBuyInfo.GroupBuyId; orderInfo.NeedPrice = productGroupBuyInfo.NeedPrice; } if (this.isCountDown) { CountDownInfo countDownInfo = ProductBrowser.GetCountDownInfo(this.shoppingCart.LineItems[this.productSku].ProductId); orderInfo.CountDownBuyId = countDownInfo.CountDownId; } if (this.isBundling) { BundlingInfo info5 = ProductBrowser.GetBundlingInfo(this.bundlingid); orderInfo.BundlingID = info5.BundlingID; orderInfo.BundlingPrice = info5.Price; orderInfo.Points = this.shoppingCart.GetPoint(info5.Price); } orderInfo.OrderId = this.GenerateOrderId(); orderInfo.OrderDate = DateTime.Now; IUser user = HiContext.Current.User; orderInfo.UserId = user.UserId; orderInfo.Username = user.Username; if (!user.IsAnonymous) { Member member = user as Member; orderInfo.EmailAddress = member.Email; orderInfo.RealName = member.RealName; orderInfo.QQ = member.QQ; orderInfo.Wangwang = member.Wangwang; orderInfo.MSN = member.MSN; } orderInfo.Remark = Globals.HtmlEncode(this.txtMessage.Text); orderInfo.OrderStatus = OrderStatus.WaitBuyerPay; orderInfo.RefundStatus = RefundStatus.None; this.FillOrderCoupon(orderInfo); this.FillOrderShippingMode(orderInfo, shoppingCartInfo); this.FillOrderPaymentMode(orderInfo); return(orderInfo); }
void LoadProductGroupBuyInfo(CountDownInfo countDownInfo) { this.lblCurrentSalePrice.Money = countDownInfo.CountDownPrice; this.litContent.Text = countDownInfo.Content; this.lblTotalPrice.Value = new decimal?(countDownInfo.CountDownPrice); this.lblEndTime.Time = countDownInfo.EndDate; this.litRemainTime.Text = "待实现"; }
public static void EditCountDown(CountDownInfo countDownInfo, IEnumerable <CountDownSkuInfo> countDownSkus) { if (PromoteHelper.ProcessStoreType(countDownInfo)) { StoreActivityHelper.SaveStoreActivity(countDownInfo.StoreIds, countDownInfo.CountDownId, 2); } new CountDownDao().EditCountDown(countDownInfo, countDownSkus); }
protected void btnUpdateGroupBuy_Click(object sender, EventArgs e) { CountDownInfo countDownInfo = new CountDownInfo(); countDownInfo.CountDownId = countDownId; string str = string.Empty; if (dropGroupBuyProduct.SelectedValue > 0) { if ((SubsitePromoteHelper.GetCountDownInfo(countDownId).ProductId != dropGroupBuyProduct.SelectedValue.Value) && SubsitePromoteHelper.ProductCountDownExist(dropGroupBuyProduct.SelectedValue.Value)) { ShowMsg("已经存在此商品的限时抢购活动", false); return; } countDownInfo.ProductId = dropGroupBuyProduct.SelectedValue.Value; } else { str = str + Formatter.FormatErrorMessage("请选择限时抢购商品"); } if (!calendarEndDate.SelectedDate.HasValue) { str = str + Formatter.FormatErrorMessage("请选择结束日期"); } else { countDownInfo.EndDate = calendarEndDate.SelectedDate.Value; } if (!string.IsNullOrEmpty(txtPrice.Text)) { decimal num; if (decimal.TryParse(txtPrice.Text.Trim(), out num)) { countDownInfo.CountDownPrice = num; } else { str = str + Formatter.FormatErrorMessage("价格填写格式不正确"); } } if (!string.IsNullOrEmpty(str)) { ShowMsg(str, false); } else { countDownInfo.Content = txtContent.Text; if (SubsitePromoteHelper.UpdateCountDown(countDownInfo)) { ShowMsg("编辑限时抢购活动成功", true); } else { ShowMsg("编辑限时抢购活动失败", true); } } }
private void btnUpdateGroupBuy_Click(object sender, EventArgs e) { CountDownInfo info2 = new CountDownInfo(); info2.CountDownId = this.countDownId; CountDownInfo countDownInfo = info2; string str = string.Empty; if (this.dropGroupBuyProduct.SelectedValue > 0) { if ((PromoteHelper.GetCountDownInfo(this.countDownId).ProductId != this.dropGroupBuyProduct.SelectedValue.Value) && PromoteHelper.ProductCountDownExist(this.dropGroupBuyProduct.SelectedValue.Value)) { this.ShowMsg("已经存在此商品的限时抢购活动", false); return; } countDownInfo.ProductId = this.dropGroupBuyProduct.SelectedValue.Value; } else { str = str + Formatter.FormatErrorMessage("请选择限时抢购商品"); } if (!this.calendarEndDate.SelectedDate.HasValue) { str = str + Formatter.FormatErrorMessage("请选择结束日期"); } else { countDownInfo.EndDate = this.calendarEndDate.SelectedDate.Value; } if (!string.IsNullOrEmpty(this.txtPrice.Text)) { decimal num; if (decimal.TryParse(this.txtPrice.Text.Trim(), out num)) { countDownInfo.CountDownPrice = num; } else { str = str + Formatter.FormatErrorMessage("价格填写格式不正确"); } } if (!string.IsNullOrEmpty(str)) { this.ShowMsg(str, false); } else { countDownInfo.Content = Globals.HtmlEncode(this.txtContent.Text); if (PromoteHelper.UpdateCountDown(countDownInfo)) { this.ShowMsg("编辑限时抢购活动成功", true); } else { this.ShowMsg("编辑限时抢购活动失败", true); } } }
/// <summary> /// 移除key倒计时 /// </summary> /// <param name="keyName"></param> public void RemoveCountDown(string keyName) { CountDownInfo findItem = m_CountDownInfoList.Find((temp) => temp.KeyName == keyName); if (findItem != null) { findItem.IsObsolete = true; findItem.UpdateNotify = null; } }
private void LoadProductGroupBuyInfo(CountDownInfo countDownInfo) { this.lblCurrentSalePrice.Money = countDownInfo.CountDownPrice; this.litContent.Text = countDownInfo.Content; this.lblTotalPrice.Value = new decimal?(countDownInfo.CountDownPrice); this.lblStartTime.Time = countDownInfo.StartDate; this.lblEndTime.Time = countDownInfo.EndDate; this.litRemainTime.Text = ""; this.litmaxcount.Text = Convert.ToString(countDownInfo.MaxCount); }
private void LoadCountDown(CountDownInfo countDownInfo) { this.txtPrice.Text = countDownInfo.CountDownPrice.ToString("f2"); this.txtContent.Text = Globals.HtmlDecode(countDownInfo.Content); this.calendarEndDate.SelectedDate = new DateTime?(countDownInfo.EndDate.Date); this.HourDropDownList1.SelectedValue = new int?(countDownInfo.EndDate.Hour); this.calendarStartDate.SelectedDate = new DateTime?(countDownInfo.StartDate.Date); this.txtMaxCount.Text = Convert.ToString(countDownInfo.MaxCount); this.drophours.SelectedValue = new int?(countDownInfo.StartDate.Hour); this.dropGroupBuyProduct.SelectedValue = new int?(countDownInfo.ProductId); }
private void LoadCountDownBuyInfo(CountDownInfo countDownInfo) { decimal countDownSalePrice = PromoteHelper.GetCountDownSalePrice(this.countDownId); this.lblCurrentSalePrice.Money = countDownSalePrice; this.litContent.Text = countDownInfo.Content; this.lblTotalPrice.Value = countDownSalePrice; this.lblStartTime.Time = countDownInfo.StartDate; this.lblEndTime.Time = countDownInfo.EndDate; this.litRemainTime.Text = ""; this.litmaxcount.Text = Convert.ToString(countDownInfo.MaxCount); }
public bool AddCountDown(CountDownInfo countDownInfo) { DbCommand sqlStringCommand = this.database.GetSqlStringCommand("DECLARE @DisplaySequence AS INT SELECT @DisplaySequence = (CASE WHEN MAX(DisplaySequence) IS NULL THEN 1 ELSE MAX(DisplaySequence) + 1 END) FROM Hishop_CountDown;INSERT INTO Hishop_CountDown(ProductId,CountDownPrice,StartDate,EndDate,Content,DisplaySequence,MaxCount ) VALUES(@ProductId,@CountDownPrice,@StartDate,@EndDate,@Content,@DisplaySequence,@MaxCount );"); this.database.AddInParameter(sqlStringCommand, "ProductId", DbType.Int32, countDownInfo.ProductId); this.database.AddInParameter(sqlStringCommand, "CountDownPrice", DbType.Currency, countDownInfo.CountDownPrice); this.database.AddInParameter(sqlStringCommand, "StartDate", DbType.DateTime, countDownInfo.StartDate); this.database.AddInParameter(sqlStringCommand, "EndDate", DbType.DateTime, countDownInfo.EndDate); this.database.AddInParameter(sqlStringCommand, "Content", DbType.String, countDownInfo.Content); this.database.AddInParameter(sqlStringCommand, "MaxCount", DbType.Int32, countDownInfo.MaxCount); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
protected override void Render(HtmlTextWriter writer) { if (string.IsNullOrEmpty(base.Text)) { base.Text = "我要咨询"; } int num = RouteConfig.GetParameter(this.Page, "countDownId", false).ToInt(0); int num2 = RouteConfig.GetParameter(this.Page, "groupBuyId", false).ToInt(0); int num3 = RouteConfig.GetParameter(this.Page, "PreSaleId", false).ToInt(0); if (num > 0) { CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(num, 0); if (countDownInfo != null) { base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new { countDownInfo.ProductId }); } } else if (num2 > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(num2); if (groupBuy != null) { base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new { groupBuy.ProductId }); } } else if (num3 > 0) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(num3); if (productPreSaleInfo != null) { base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new { productPreSaleInfo.ProductId }); } } else { base.NavigateUrl = base.GetRouteUrl("ProductConsultations", new { ProductId = RouteConfig.GetParameter(this.Page, "productId", false) }); } base.Render(writer); }
protected override void AttachChildControls() { this.countDownId = this.Page.Request.QueryString["countDownId"].ToInt(0); CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, 0); if (countDownInfo == null) { base.GotoResourceNotFound("抢购信息不存在"); } this.FindControls(); this.SetControlsValue(countDownInfo); PageTitle.AddSiteNameTitle("限时抢购商品详情"); }
public void EditCountDown(CountDownInfo countDownInfo, IEnumerable <CountDownSkuInfo> countDownSkus) { if (this.Update(countDownInfo, null) && countDownSkus.Count() != 0) { DbCommand sqlStringCommand = base.database.GetSqlStringCommand("DELETE FROM Hishop_CountDownSku WHERE CountDownId=@CountDownId"); base.database.AddInParameter(sqlStringCommand, "CountDownId", DbType.Int32, countDownInfo.CountDownId); base.database.ExecuteNonQuery(sqlStringCommand); foreach (CountDownSkuInfo countDownSku in countDownSkus) { this.Add(countDownSku, null); } } }
public static void AddCountDown(CountDownInfo countDownInfo, IEnumerable <CountDownSkuInfo> countDownSkus) { bool flag = PromoteHelper.ProcessStoreType(countDownInfo); CountDownDao countDownDao = new CountDownDao(); countDownInfo.DisplaySequence = countDownDao.GetMaxDisplaySequence <CountDownInfo>(); int num = new CountDownDao().AddCountDown(countDownInfo, countDownSkus); if (num > 0 & flag) { StoreActivityHelper.SaveStoreActivity(countDownInfo.StoreIds, num, 2); } }
public bool UpdateCountDown(CountDownInfo countDownInfo) { DbCommand sqlStringCommand = this.database.GetSqlStringCommand("UPDATE Hishop_CountDown SET ProductId=@ProductId,CountDownPrice=@CountDownPrice,StartDate=@StartDate,EndDate=@EndDate,Content=@Content,MaxCount=@MaxCount WHERE CountDownId=@CountDownId"); this.database.AddInParameter(sqlStringCommand, "CountDownId", DbType.Int32, countDownInfo.CountDownId); this.database.AddInParameter(sqlStringCommand, "ProductId", DbType.Int32, countDownInfo.ProductId); this.database.AddInParameter(sqlStringCommand, "CountDownPrice", DbType.Currency, countDownInfo.CountDownPrice); this.database.AddInParameter(sqlStringCommand, "StartDate", DbType.DateTime, countDownInfo.StartDate); this.database.AddInParameter(sqlStringCommand, "EndDate", DbType.DateTime, countDownInfo.EndDate); this.database.AddInParameter(sqlStringCommand, "Content", DbType.String, countDownInfo.Content); this.database.AddInParameter(sqlStringCommand, "MaxCount", DbType.Int32, countDownInfo.MaxCount); return(this.database.ExecuteNonQuery(sqlStringCommand) > 0); }
private void HasActivitiesToJumpUrl() { string text = string.Empty; CountDownInfo countDownInfo = PromoteHelper.ActiveCountDownByProductId(this.productId, 0); GroupBuyInfo groupBuyInfo = PromoteHelper.ActiveGroupBuyByProductId(this.productId); if (countDownInfo != null) { text = "/{0}/CountDownProductsDetails.aspx?countDownId=" + countDownInfo.CountDownId; } else if (groupBuyInfo != null) { text = "/{0}/GroupBuyProductDetails.aspx?groupBuyId=" + groupBuyInfo.GroupBuyId; } else { ProductPreSaleInfo productPreSaleInfoByProductId = ProductPreSaleHelper.GetProductPreSaleInfoByProductId(this.productId); if (productPreSaleInfoByProductId != null) { text = "/{0}/PreSaleproductdetails.aspx?PreSaleId=" + productPreSaleInfoByProductId.PreSaleId; } else { int activityStartsImmediatelyAboutCountDown = PromoteHelper.GetActivityStartsImmediatelyAboutCountDown(this.productId); if (activityStartsImmediatelyAboutCountDown > 0) { this.aCountDownUrl.Text = "该商品即将参与抢购活动, 去看看"; this.aCountDownUrl.NavigateUrl = this.FillStringURL("/{0}/CountDownProductsDetails.aspx?countDownId=" + activityStartsImmediatelyAboutCountDown); this.aCountDownUrl.Style.Add("color", "red"); this.aCountDownUrl.Visible = true; this.divCountDownUrl.Visible = true; } else { int activityStartsImmediatelyAboutGroupBuy = PromoteHelper.GetActivityStartsImmediatelyAboutGroupBuy(this.productId); if (activityStartsImmediatelyAboutGroupBuy > 0) { this.aCountDownUrl.Text = "该商品即将参与团购活动, 去看看"; this.aCountDownUrl.NavigateUrl = this.FillStringURL("/{0}//GroupBuyProductDetails.aspx?groupBuyId=" + activityStartsImmediatelyAboutGroupBuy); this.aCountDownUrl.Style.Add("color", "red"); this.aCountDownUrl.Visible = true; this.divCountDownUrl.Visible = true; } } } } if (!string.IsNullOrEmpty(text)) { this.Page.Response.Redirect(this.FillStringURL(text)); } }
/// <summary> /// /// </summary> /// <param name="countDown"></param> /// <param name="keyName"></param> /// <param name="notifyInterval">更新的最小频率为 0.1s 每次</param> public void StartCountDown(float countDown, string keyName, System.Action <float> updateCallBack, float notifyInterval = 1) { if (notifyInterval < 0.1f) { notifyInterval = 0.1f; } CountDownInfo item = new CountDownInfo(); item.CountDown = item.NextCountDown = countDown; item.NotifyInterval = notifyInterval; item.KeyName = keyName; item.UpdateNotify = updateCallBack; m_CountDownInfoList.Add(item); }
protected override void AttachChildControls() { this.countDownId = this.Page.Request.QueryString["countDownId"].ToInt(0); int storeId = this.Page.Request.QueryString["StoreId"].ToInt(0); CountDownInfo countDownInfo = PromoteHelper.GetCountDownInfo(this.countDownId, storeId); if (countDownInfo == null) { this.ShowWapMessage("抢购信息不存在", "default.aspx"); } this.FindControls(); this.SetControlsValue(countDownInfo); PageTitle.AddSiteNameTitle("限时抢购商品详情"); }
public override CountDownInfo CountDownBuy(int CountDownId) { CountDownInfo info = null; DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Hishop_CountDown WHERE CountDownId=@CountDownId;"); this.database.AddInParameter(sqlStringCommand, "CountDownId", DbType.Int32, CountDownId); using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand)) { if (reader.Read()) { info = DataMapper.PopulateCountDown(reader); } } return(info); }