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);
        }
        private void SetControlsValue(CountDownInfo countDownInfo)
        {
            this.skuSubmitOrder.CountDownId   = countDownInfo.CountDownId;
            this.skuSubmitOrder.CountDownInfo = countDownInfo;
            this.skuSubmitOrder.OrderBusiness = 2;
            HtmlInputHidden htmlInputHidden = this.hdCountDownId;
            int             num             = countDownInfo.CountDownId;

            htmlInputHidden.Value    = num.ToString();
            this.hiddenIsLogin.Value = HiContext.Current.UserId.ToString();
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            this.hidRecommend.Value = (masterSettings.Store_IsRecommend ? "1" : "0");
            StoreProductQuery storeProductQuery = new StoreProductQuery
            {
                ProductId   = countDownInfo.ProductId,
                StoreId     = this.storeId,
                CountDownId = this.countDownId
            };
            string cookie = WebHelper.GetCookie("UserCoordinateCookie", "NewCoordinate");

            if (!string.IsNullOrEmpty(cookie))
            {
                string[] array = cookie.Split(',');
                storeProductQuery.Position        = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0));
                storeProductQuery.Position.CityId = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0);
                storeProductQuery.Position.AreaId = WebHelper.GetCookie("UserCoordinateCookie", "RegionId").ToInt(0);
                StoreEntityQuery storeEntityQuery = new StoreEntityQuery();
                storeEntityQuery.Position     = new PositionInfo(array[0].ToDouble(0), array[1].ToDouble(0));
                storeEntityQuery.RegionId     = WebHelper.GetCookie("UserCoordinateCookie", "CityRegionId").ToInt(0);
                storeEntityQuery.FullAreaPath = WebHelper.GetCookie("UserCoordinateCookie", "FullRegionPath");
                this.hidLanLng.Value          = JsonConvert.SerializeObject(storeEntityQuery);
            }
            else
            {
                storeProductQuery.Position        = new PositionInfo(0.0, 0.0);
                storeProductQuery.Position.CityId = 0;
                storeProductQuery.Position.AreaId = 0;
            }
            this.hidStoreId.Value = this.storeId.ToString();
            HtmlInputHidden htmlInputHidden2 = this.hidStoreType;

            num = countDownInfo.StoreType;
            htmlInputHidden2.Value = num.ToString();
            ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery);

            if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete)
            {
                this.ShowWapMessage("抢购商品已不存在", "Default.aspx");
            }
            else
            {
                if (!storeProduct.SaleStatus.Equals(ProductSaleStatus.OnSale))
                {
                    this.hidden_IsOver.Value = "pullOff";
                }
                this.litShortDescription.Text    = storeProduct.ShortDescription;
                this.divShortDescription.Visible = !string.IsNullOrEmpty(storeProduct.ShortDescription);
                if (!countDownInfo.IsJoin)
                {
                    this.hidden_IsOver.Value = "nojoin";
                }
                else if (countDownInfo.StartDate > DateTime.Now)
                {
                    this.hidden_IsOver.Value = "AboutToBegin";
                }
                else if (countDownInfo.EndDate < DateTime.Now)
                {
                    this.hidden_IsOver.Value = "over";
                }
                else if (!countDownInfo.IsRunning)
                {
                    this.hidden_IsOver.Value = "true";
                }
                if (storeProduct.SaleStatus != ProductSaleStatus.OnSale)
                {
                    this.ShowWapMessage("此商品已下架", "Default.aspx");
                }
                if (this.expandAttr != null)
                {
                    this.expandAttr.ProductId = storeProduct.ProductId;
                }
                this.skuSubmitOrder.ProductInfo = storeProduct;
                this.litProdcutName.SetWhenIsNotNull(storeProduct.ProductName);
                Literal control = this.litminCount;
                num = countDownInfo.MaxCount;
                control.SetWhenIsNotNull(num.ToString());
                storeProduct.ImgUrlList.ForEach(delegate(string i)
                {
                    Literal literal4 = this.litPdImgSlides;
                    literal4.Text   += $"<img src=\"{i}\" />";
                });
                if (this.litDescription != null && !string.IsNullOrWhiteSpace(storeProduct.Description))
                {
                    Regex regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                    this.litDescription.Text = regex.Replace(storeProduct.Description, "").Replace("src", "data-url");
                }
                this.litprice.SetWhenIsNotNull(PromoteHelper.GetCountDownSalePrice(this.countDownId).F2ToString("f2"));
                this.litLeftSeconds.SetWhenIsNotNull(Math.Ceiling((countDownInfo.EndDate - DateTime.Now).TotalSeconds).ToString());
                this.litcontent.SetWhenIsNotNull(countDownInfo.Content);
                HtmlInputControl control2 = this.litGroupBuyId;
                num = countDownInfo.CountDownId;
                control2.SetWhenIsNotNull(num.ToString());
                if (storeProduct.MarketPrice > decimal.Zero)
                {
                    this.salePrice.SetWhenIsNotNull(storeProduct.MarketPrice.F2ToString("f2"));
                }
                else
                {
                    this.salePrice.Text = storeProduct.MaxSalePrice.F2ToString("f2");
                }
                HtmlInputControl control3 = this.txtProductId;
                num = countDownInfo.ProductId;
                control3.SetWhenIsNotNull(num.ToString());
                Literal control4 = this.litConsultationsCount;
                num = storeProduct.ConsultationCount;
                control4.SetWhenIsNotNull(num.ToString());
                Literal control5 = this.litReviewsCount;
                num = storeProduct.ReviewCount;
                control5.SetWhenIsNotNull(num.ToString());
                this.litGroupbuyDescription.SetWhenIsNotNull(countDownInfo.Content);
                Literal control6 = this.litMaxCount;
                num = countDownInfo.MaxCount;
                control6.SetWhenIsNotNull(num.ToString());
                this.nowTime = (HtmlInputHidden)this.FindControl("nowTime");
                HtmlInputHidden control7 = this.nowTime;
                DateTime        dateTime = DateTime.Now;
                control7.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo));
                HtmlInputHidden control8 = this.startTime;
                dateTime = countDownInfo.StartDate;
                control8.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss"));
                HtmlInputHidden control9 = this.endTime;
                dateTime = countDownInfo.EndDate;
                control9.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss"));
                HtmlInputHidden control10 = this.groupBuyMaxCount;
                num = countDownInfo.MaxCount;
                control10.SetWhenIsNotNull(num.ToString());
                if (storeProduct.StoreInfo.IsInServiceArea)
                {
                    this.ltlStoreName      = (Literal)this.FindControl("ltlStoreName");
                    this.ltlStoreName.Text = storeProduct.StoreInfo.StoreName;
                    this.ltlDistance       = (Literal)this.FindControl("ltlDistance");
                    this.ltlDistance.Text  = storeProduct.StoreInfo.Distance;
                    this.ltlDelivery       = (Literal)this.FindControl("ltlDelivery");
                    this.ltlDelivery.Text  = storeProduct.StoreInfo.Delivery.DeliveryList.Aggregate(string.Empty, (string t, string n) => "<li>" + t + "</li><li>" + n + "</li>");
                    this.ltlDeliveryDetail = (Literal)this.FindControl("ltlDeliveryDetail");
                    if (storeProduct.StoreInfo.Delivery.IsStoreDelive)
                    {
                        if (storeProduct.StoreInfo.Delivery.MinOrderPrice > decimal.Zero)
                        {
                            Literal literal = this.ltlDeliveryDetail;
                            num          = storeProduct.StoreInfo.Delivery.MinOrderPrice.ToInt(0);
                            literal.Text = $"¥<em>{num.ToString()}</em>起送";
                            if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero)
                            {
                                Literal literal2 = this.ltlDeliveryDetail;
                                string  text     = literal2.Text;
                                num           = storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0);
                                literal2.Text = text + $",配送费¥<em>{num.ToString()}</em>";
                            }
                            else
                            {
                                Literal literal3 = this.ltlDeliveryDetail;
                                literal3.Text += string.Format(",免配送费");
                            }
                        }
                        else if (storeProduct.StoreInfo.Delivery.StoreFreight > decimal.Zero)
                        {
                            this.ltlDeliveryDetail.Text = $"配送费¥<em>{storeProduct.StoreInfo.Delivery.StoreFreight.ToInt(0)}</em>";
                        }
                        else
                        {
                            this.ltlDeliveryDetail.Text = string.Format("免配送费");
                        }
                    }
                    this.ltlStoreAddress      = (Literal)this.FindControl("ltlStoreAddress");
                    this.ltlStoreAddress.Text = storeProduct.StoreInfo.AddressSimply;
                    this.hidLngLat.Value      = $"{storeProduct.StoreInfo.Position.Longitude},{storeProduct.StoreInfo.Position.Latitude}";
                    this.hidStoreName.Value   = storeProduct.StoreInfo.StoreName;
                    this.hidQQMapKey.Value    = masterSettings.QQMapAPIKey;
                }
                if (storeProduct.ExStatus == DetailException.Nomal)
                {
                    this.hidNoData.Value = "0";
                }
                else
                {
                    this.hidNoData.Value = "1";
                }
                this.litUnit.SetWhenIsNotNull(string.IsNullOrEmpty(storeProduct.Unit) ? "件" : storeProduct.Unit);
                this.SetWXShare(countDownInfo, storeProduct);
                this.ProcessException(storeProduct);
            }
        }
        private void SetControlsValue(CountDownInfo countDownInfo)
        {
            this.skuSubmitOrder.CountDownId   = countDownInfo.CountDownId;
            this.skuSubmitOrder.OrderBusiness = 2;
            HtmlInputHidden htmlInputHidden = this.hdCountDownId;
            int             num             = countDownInfo.CountDownId;

            htmlInputHidden.Value    = num.ToString();
            this.hiddenIsLogin.Value = HiContext.Current.UserId.ToString();
            SiteSettings      masterSettings    = SettingsManager.GetMasterSettings();
            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(countDownInfo.ProductId, null, masterSettings.OpenMultStore, 0);

            if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                base.GotoResourceNotFound("抢购商品已不存在");
            }
            else
            {
                if (productBrowseInfo.Product == null)
                {
                    this.hidden_IsOver.Value = "pullOff";
                }
                else if (!productBrowseInfo.Product.SaleStatus.Equals(ProductSaleStatus.OnSale))
                {
                    this.hidden_IsOver.Value = "pullOff";
                }
                if (countDownInfo.StartDate > DateTime.Now)
                {
                    this.hidden_IsOver.Value = "AboutToBegin";
                }
                else if (countDownInfo.EndDate < DateTime.Now)
                {
                    this.hidden_IsOver.Value = "over";
                }
                else if (!countDownInfo.IsRunning)
                {
                    this.hidden_IsOver.Value = "true";
                }
                if (productBrowseInfo.Product.SaleStatus != ProductSaleStatus.OnSale)
                {
                    base.GotoResourceNotFound("此商品已下架");
                }
                if (this.rptProductImages != null)
                {
                    string            locationUrl = "javascript:;";
                    List <SlideImage> list        = new List <SlideImage>
                    {
                        new SlideImage(productBrowseInfo.Product.ImageUrl1, locationUrl),
                        new SlideImage(productBrowseInfo.Product.ImageUrl2, locationUrl),
                        new SlideImage(productBrowseInfo.Product.ImageUrl3, locationUrl),
                        new SlideImage(productBrowseInfo.Product.ImageUrl4, locationUrl),
                        new SlideImage(productBrowseInfo.Product.ImageUrl5, locationUrl)
                    };
                    IEnumerable <SlideImage> source = from item in list
                                                      where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                      select item;
                    if (source.Count() == 0)
                    {
                        list.Add(new SlideImage(masterSettings.DefaultProductImage, locationUrl));
                    }
                    this.rptProductImages.DataSource = from item in list
                                                       where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                       select item;
                    this.rptProductImages.DataBind();
                }
                this.skuSubmitOrder.ProductInfo = productBrowseInfo.Product;
                this.litProdcutName.SetWhenIsNotNull(productBrowseInfo.Product.ProductName);
                Literal control = this.litminCount;
                num = countDownInfo.MaxCount;
                control.SetWhenIsNotNull(num.ToString());
                this.litShortDescription.SetWhenIsNotNull(productBrowseInfo.Product.ShortDescription);
                if (this.litDescription != null)
                {
                    string text  = "";
                    Regex  regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                    if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.MobbileDescription))
                    {
                        text = regex.Replace(productBrowseInfo.Product.MobbileDescription, "");
                    }
                    else if (!string.IsNullOrWhiteSpace(productBrowseInfo.Product.Description))
                    {
                        text = regex.Replace(productBrowseInfo.Product.Description, "");
                    }
                    text = text.Replace("src", "data-url");
                    this.litDescription.Text = text;
                }
                this.litprice.SetWhenIsNotNull(PromoteHelper.GetCountDownSalePrice(this.countDownId).F2ToString("f2"));
                this.litLeftSeconds.SetWhenIsNotNull(Math.Ceiling((countDownInfo.EndDate - DateTime.Now).TotalSeconds).ToString());
                this.litcontent.SetWhenIsNotNull(countDownInfo.Content);
                HtmlInputControl control2 = this.litGroupBuyId;
                num = countDownInfo.CountDownId;
                control2.SetWhenIsNotNull(num.ToString());
                if (productBrowseInfo.Product.MarketPrice.HasValue && productBrowseInfo.Product.MarketPrice.Value > decimal.Zero)
                {
                    this.salePrice.SetWhenIsNotNull(productBrowseInfo.Product.MarketPrice.Value.F2ToString("f2"));
                }
                else
                {
                    this.salePrice.SetWhenIsNotNull(productBrowseInfo.Product.Skus.Max((KeyValuePair <string, SKUItem> c) => c.Value.SalePrice).F2ToString("f2"));
                }
                HtmlInputControl control3 = this.txtProductId;
                num = countDownInfo.ProductId;
                control3.SetWhenIsNotNull(num.ToString());
                Literal control4 = this.litConsultationsCount;
                num = productBrowseInfo.ConsultationCount;
                control4.SetWhenIsNotNull(num.ToString());
                Literal control5 = this.litReviewsCount;
                num = productBrowseInfo.ReviewCount;
                control5.SetWhenIsNotNull(num.ToString());
                this.litGroupbuyDescription.SetWhenIsNotNull(countDownInfo.Content);
                Literal control6 = this.litMaxCount;
                num = countDownInfo.MaxCount;
                control6.SetWhenIsNotNull(num.ToString());
                this.nowTime = (HtmlInputHidden)this.FindControl("nowTime");
                HtmlInputHidden control7 = this.nowTime;
                DateTime        dateTime = DateTime.Now;
                control7.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo));
                HtmlInputHidden control8 = this.startTime;
                dateTime = countDownInfo.StartDate;
                control8.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss"));
                HtmlInputHidden control9 = this.endTime;
                dateTime = countDownInfo.EndDate;
                control9.SetWhenIsNotNull(dateTime.ToString("yyyy/MM/dd HH:mm:ss"));
                HtmlInputHidden control10 = this.groupBuyMaxCount;
                num = countDownInfo.MaxCount;
                control10.SetWhenIsNotNull(num.ToString());
                HtmlInputHidden control11 = this.skuStock;
                num = productBrowseInfo.Product.DefaultSku.Stock;
                control11.SetWhenIsNotNull(num.ToString());
                this.litUnit.SetWhenIsNotNull(string.IsNullOrEmpty(productBrowseInfo.Product.Unit) ? "件" : productBrowseInfo.Product.Unit);
            }
        }