Example #1
0
        public void BindData()
        {
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(this.supplierId);
            ManagerInfo  managerInfo  = ManagerHelper.FindManagerByStoreIdAndRoleId(this.supplierId, -2);

            if (supplierById == null || managerInfo == null)
            {
                base.Response.Redirect("SupplierList.aspx");
            }
            else
            {
                this.lblManageId.Text = managerInfo.ManagerId.ToString();
                Literal     literal     = this.lblUserName;
                Literal     literal2    = this.lblUserName2;
                string      text2       = literal.Text = (literal2.Text = managerInfo.UserName);
                TrimTextBox trimTextBox = this.txtSupplierName;
                Literal     literal3    = this.lblSupplierName;
                text2 = (trimTextBox.Text = (literal3.Text = supplierById.SupplierName));
                string text4 = "正常 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:void(0);\" onclick=\"updatesupperstate(2)\">冻结</a>";
                if (supplierById.Status != 1)
                {
                    text4 = "冻结 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:void(0);\" onclick=\"updatesupperstate(1)\">恢复</a>";
                }
                this.lblStatus.Text     = text4;
                this.hidOldImages.Value = supplierById.Picture;
                this.txtContactMan.Text = supplierById.ContactMan;
                this.txtTel.Text        = supplierById.Tel;
                this.dropRegion.SetSelectedRegionId(supplierById.RegionId);
                this.txtAddress.Text      = supplierById.Address;
                this.editDescription.Text = supplierById.Introduce;
            }
        }
Example #2
0
        public void BindData()
        {
            ManagerInfo  manager      = HiContext.Current.Manager;
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(manager.StoreId);

            this.lblUserName.Text = manager.UserName;
            if (string.IsNullOrEmpty(supplierById.TradePassword))
            {
                this.liTradePass_Empty.Visible = true;
                this.liTradePass_Old.Visible   = false;
                this.ltistradepass.Text        = "0";
                this.lipass0.Attributes.Add("class", "");
                this.divright0.Attributes.Add("style", "display:none");
                this.lipass1.Attributes.Add("class", "hover");
                this.divright1.Attributes.Add("style", "");
            }
            else
            {
                this.liTradePass_Empty.Visible = false;
                this.liTradePass_Old.Visible   = true;
                this.ltistradepass.Text        = "1";
                this.lipass0.Attributes.Add("class", "hover");
                this.divright0.Attributes.Add("style", "");
                this.lipass1.Attributes.Add("class", "");
                this.divright1.Attributes.Add("style", "display:none");
            }
        }
Example #3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string       address      = Globals.StripAllTags(this.txtAddress.Text);
            string       text         = this.txtTel.Text;
            string       text2        = this.txtContactMan.Text;
            ManagerInfo  manager      = HiContext.Current.Manager;
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(manager.StoreId);

            if (!this.dropRegion.GetSelectedRegionId().HasValue)
            {
                this.ShowMsg("请选择供应商所在区域!", false);
            }
            else if (text2.Length > 8 || text2.Length < 2)
            {
                this.ShowMsg("请输入联系人,联系人长度必须是2-8位!", false);
            }
            else if (text == "" || !DataHelper.IsTel(text))
            {
                this.ShowMsg("请输入正确的联系电话(手机或者固定电话)!", false);
            }
            else
            {
                supplierById.RegionId       = this.dropRegion.GetSelectedRegionId().Value;
                supplierById.Tel            = text;
                supplierById.Address        = address;
                supplierById.ContactMan     = text2;
                supplierById.WXOpenId       = Globals.StripAllTags(this.txtWxOpenId.Text);
                supplierById.FullRegionPath = RegionHelper.GetFullPath(supplierById.RegionId, true);
                supplierById.Introduce      = this.editDescription.Text;
                SupplierHelper.UpdateSupplier(supplierById);
                this.ShowMsg("保存成功", true);
            }
        }
Example #4
0
        public void ExportExcel(HttpContext context)
        {
            BalanceDetailSupplierQuery dataQuery = this.GetDataQuery(context);
            SupplierInfo  supplierById           = SupplierHelper.GetSupplierById(dataQuery.SupplierId.Value);
            DbQueryResult balanceDetails4Report  = BalanceHelper.GetBalanceDetails4Report(dataQuery);
            StringBuilder stringBuilder          = new StringBuilder(300);

            stringBuilder.Append("供应商");
            stringBuilder.Append(",时间");
            stringBuilder.Append(",提现帐户");
            stringBuilder.Append(",类型");
            stringBuilder.Append(",订单号");
            stringBuilder.Append(",收入");
            stringBuilder.Append(",支出");
            stringBuilder.Append(",账户余额");
            stringBuilder.Append(",备注\r\n");
            foreach (DataRow row in balanceDetails4Report.Data.Rows)
            {
                int requestId = row["OrderId"].ToInt(0);
                SupplierBalanceDrawRequestInfo balanceDrawRequestInfo = BalanceHelper.GetBalanceDrawRequestInfo(requestId);
                stringBuilder.Append(supplierById.SupplierName);
                stringBuilder.Append("," + row["TradeDate"]);
                if (balanceDrawRequestInfo != null)
                {
                    string text = "";
                    text = ((!balanceDrawRequestInfo.IsWeixin) ? ((!balanceDrawRequestInfo.IsAlipay) ? $"提现到银行卡(开户银行:{balanceDrawRequestInfo.BankName},银行开户名:{balanceDrawRequestInfo.AccountName},银行卡帐号:{balanceDrawRequestInfo.MerchantCode})" : ("提现到支付宝(支付宝帐号:" + balanceDrawRequestInfo.AlipayCode + ",支付宝姓名:" + balanceDrawRequestInfo.AlipayRealName + ")")) : "提现到微信");
                    stringBuilder.Append("," + text);
                }
                else
                {
                    stringBuilder.Append(",");
                }
                stringBuilder.Append("," + row["TradeTypeText"]);
                SupplierTradeTypes supplierTradeTypes = (SupplierTradeTypes)row["TradeType"].ToInt(0);
                if (supplierTradeTypes == SupplierTradeTypes.OrderBalance)
                {
                    stringBuilder.Append("," + row["OrderId"]);
                }
                else
                {
                    stringBuilder.Append(",");
                }
                stringBuilder.Append("," + row["Income"]);
                stringBuilder.Append("," + row["Expenses"]);
                stringBuilder.Append("," + row["Balance"]);
                stringBuilder.Append("," + row["Remark"] + "\r\n");
            }
            context.Response.Clear();
            context.Response.Buffer  = false;
            context.Response.Charset = "GB2312";
            context.Response.AppendHeader("Content-Disposition", "attachment;filename=BalanceDetail.csv");
            context.Response.ContentEncoding = Encoding.GetEncoding("GB2312");
            context.Response.ContentType     = "application/octet-stream";
            context.Response.Write(stringBuilder.ToString());
            context.Response.End();
        }
Example #5
0
        private void UpdateSupplier()
        {
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(this.supplierId);
            ManagerInfo  managerInfo  = ManagerHelper.FindManagerByStoreId(this.supplierId, SystemRoles.SupplierAdmin);

            if (managerInfo == null || supplierById == null)
            {
                base.Response.Redirect("SupplierList.aspx");
            }
            string supplierName = Globals.StripAllTags(this.txtSupplierName.Text.Trim());
            string text         = Globals.StripAllTags(this.txtAddress.Text);
            string text2        = this.txtTel.Text;
            string text3        = Globals.StripAllTags(this.txtContactMan.Text);

            if (SupplierHelper.ExistSupplierName(this.supplierId, supplierName))
            {
                this.ShowMsg("供应商名称已经存在,请重新输入!", false);
            }
            else if (!this.dropRegion.GetSelectedRegionId().HasValue)
            {
                this.ShowMsg("请选择供应商所在区域!", false);
            }
            else if (text3.Length > 8 || text3.Length < 2)
            {
                this.ShowMsg("请输入联系人,联系人长度必须是2-8位!", false);
            }
            else if (text.Length > 50 || text.Length < 2)
            {
                this.ShowMsg("请输入地址,长度必须为2-50个字符!", false);
            }
            else if (text2 == "" || !DataHelper.IsTel(text2))
            {
                this.ShowMsg("请输入正确的联系电话(手机或者固定电话)!", false);
            }
            else
            {
                int value = this.dropRegion.GetSelectedRegionId().Value;
                supplierById.SupplierName   = supplierName;
                supplierById.Picture        = this.UploadImage();
                supplierById.Tel            = text2;
                supplierById.Address        = text;
                supplierById.ContactMan     = text3;
                supplierById.RegionId       = value;
                supplierById.FullRegionPath = RegionHelper.GetFullPath(value, true);
                supplierById.Introduce      = this.editDescription.Text;
                SupplierHelper.UpdateSupplier(supplierById);
            }
        }
Example #6
0
        protected override void AttachChildControls()
        {
            this.litSupplierName  = (Literal)this.FindControl("litSupplierName");
            this.litSupplierAbout = (Literal)this.FindControl("litSupplierAbout");
            int          supplierid   = base.GetParameter("SupplierId").ToInt(0);
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierid);

            if (supplierById == null)
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.litSupplierName.SetWhenIsNotNull(supplierById.SupplierName);
                this.litSupplierAbout.SetWhenIsNotNull(supplierById.Introduce);
            }
        }
Example #7
0
        public void IsTradePassword(HttpContext context)
        {
            string text  = context.Request["txtoldTradePassword"];
            string text2 = "";

            if (string.IsNullOrEmpty(text))
            {
                text2 = "{\"success\":\"false\",\"msg\":\"参数错误!\"}";
                this.ResponseEnd(text2);
            }
            ManagerInfo  manager      = HiContext.Current.Manager;
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(manager.StoreId);
            string       strA         = Users.EncodePassword(text, supplierById.TradePasswordSalt);

            text2 = ((string.Compare(strA, supplierById.TradePassword) == 0) ? "{\"success\":\"true\",\"msg\":\"\"}" : "{\"success\":\"false\",\"msg\":\"输入的当前交易密码与原始交易密码不一致,请正确输入!\"}");
            this.ResponseEnd(text2);
        }
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("供应商介绍");
            this.litSupplierName  = (Literal)this.FindControl("litSupplierName");
            this.litSupplierAbout = (Literal)this.FindControl("litSupplierAbout");
            int          supplierid   = HttpContext.Current.Request.QueryString["SupplierId"].ToInt(0);
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierid);

            if (supplierById == null)
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.litSupplierName.SetWhenIsNotNull(supplierById.SupplierName);
                this.litSupplierAbout.SetWhenIsNotNull(supplierById.Introduce);
            }
        }
Example #9
0
        private void btnSaveTradePass_Click(object sender, EventArgs e)
        {
            ManagerInfo  manager      = HiContext.Current.Manager;
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(manager.StoreId);

            if (manager == null || supplierById == null)
            {
                this.ShowMsg("参数错误,请找管理员处理!", false);
            }
            else
            {
                if (!string.IsNullOrEmpty(supplierById.TradePassword))
                {
                    string strA = Users.EncodePassword(this.txtoldTradePassword.Text, supplierById.TradePasswordSalt);
                    if (string.Compare(strA, supplierById.TradePassword) != 0)
                    {
                        this.ShowMsg("输入的当前交易密码与原始交易密码不一致,请正确输入!", false);
                        return;
                    }
                }
                if (this.txtTradePassword.Text.Length < 6 || this.txtTradePassword.Text.Length > 20)
                {
                    this.ShowMsg("交易密码长度必须为6-20个字符!", false);
                }
                else if (string.Compare(this.txtTradePassword.Text, this.txtTradePasswordConfirm.Text) != 0)
                {
                    this.ShowMsg("请确保两次输入的密码相同", false);
                }
                else
                {
                    string text  = Globals.RndStr(128, true);
                    string text3 = supplierById.TradePassword = Users.EncodePassword(this.txtTradePassword.Text, text);
                    supplierById.TradePasswordSalt = text;
                    if (SupplierHelper.UpdateSupplier(supplierById))
                    {
                        this.ShowMsg("修改交易密码成功", true, "PassWordManage.aspx");
                    }
                    else
                    {
                        this.ShowMsg("修改交易密码失败", true);
                    }
                }
            }
        }
Example #10
0
        public void BindData()
        {
            ManagerInfo  manager      = HiContext.Current.Manager;
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(manager.StoreId);

            this.txtAddress.Text     = supplierById.Address;
            this.txtContactMan.Text  = supplierById.ContactMan;
            this.ltSupplierName.Text = supplierById.SupplierName;
            this.txtTel.Text         = supplierById.Tel;
            this.dropRegion.SetSelectedRegionId(supplierById.RegionId);
            this.txtWxOpenId.Text     = supplierById.WXOpenId;
            this.editDescription.Text = supplierById.Introduce;
            if (string.IsNullOrEmpty(supplierById.WXOpenId))
            {
                this.reGetOpenId.Style.Add("display", "none");
            }
            else
            {
                this.getOpenId.Style.Add("display", "none");
            }
        }
Example #11
0
        public void BindData()
        {
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(this.supplierId);
            ManagerInfo  managerInfo  = ManagerHelper.FindManagerByStoreIdAndRoleId(this.supplierId, -2);

            if (supplierById == null || managerInfo == null)
            {
                base.Response.Redirect("SuppliersList.aspx");
            }
            else
            {
                this.lblUserName.Text     = managerInfo.UserName;
                this.lblSupplierName.Text = supplierById.SupplierName;
                this.lblStatus.Text       = (supplierById.Status.Equals(1) ? "正常" : "<font color='red'>冻结</font>");
                this.lblContactMan.Text   = supplierById.ContactMan;
                this.lblTel.Text          = supplierById.Tel;
                this.lblAddress.Text      = RegionHelper.GetFullRegion(supplierById.RegionId, string.Empty, true, 0);
                Literal literal = this.lblAddress;
                literal.Text += supplierById.Address;
            }
        }
Example #12
0
        private void EmptySupplierTransactionPass(HttpContext context)
        {
            int    num   = context.Request["supplierId"].ToInt(0);
            string empty = string.Empty;

            if (num <= 0)
            {
                empty = "{\"success\":\"false\",\"msg\":\"参数错误,请勿操作!\"}";
                this.ResponseEnd(empty);
            }
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(num);

            if (supplierById == null || supplierById.SupplierId <= 0)
            {
                empty = "{\"success\":\"false\",\"msg\":\"供应商已不存在,请重新加载列表进行操作!!\"}";
                this.ResponseEnd(empty);
            }
            supplierById.TradePassword     = "";
            supplierById.TradePasswordSalt = "";
            empty = ((!SupplierHelper.UpdateSupplier(supplierById)) ? "{\"success\":\"false\",\"msg\":\"清空交易密码失败!!\"}" : "{\"success\":\"true\",\"msg\":\"清空成功,请去供应商后台重新设置交易密码!\"}");
            this.ResponseEnd(empty);
        }
Example #13
0
        private void EditSupplierStatus(HttpContext context)
        {
            int num  = context.Request["supplierId"].ToInt(0);
            int num2 = context.Request["statusvalue"].ToInt(0);

            num2 = ((num2 == 1) ? num2 : 2);
            string empty = string.Empty;

            if (num <= 0)
            {
                empty = "{\"success\":\"false\",\"msg\":\"参数错误,请勿操作!\"}";
                this.ResponseEnd(empty);
            }
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(num);

            if (supplierById == null || supplierById.SupplierId <= 0)
            {
                empty = "{\"success\":\"false\",\"msg\":\"供应商已不存在,请重新点击列表进行操作!!\"}";
                this.ResponseEnd(empty);
            }
            if (supplierById.Status.Equals(num2))
            {
                empty = "{\"success\":\"false\",\"msg\":\"编辑状态就是当前状态,不需要重新修改!!\"}";
                this.ResponseEnd(empty);
            }
            supplierById.Status = num2;
            if (num2 == 1)
            {
                empty = ((SupplierHelper.UpdateSupplier_Recover(num) <= 0) ? "{\"success\":\"false\",\"msg\":\"供应商状态“恢复”失败!\"}" : "{\"success\":\"true\",\"msg\":\"供应商状态“恢复”成功!\"}");
            }
            else
            {
                int num3 = SupplierHelper.UpdateSupplier_Frozen(num);
                empty = ((num3 <= 0) ? "{\"success\":\"false\",\"msg\":\"供应商状态“冻结”失败!\"}" : "{\"success\":\"true\",\"msg\":\"供应商状态“冻结”成功!\"}");
            }
            this.ResponseEnd(empty);
        }
Example #14
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(base.GetParameter("productId", false), out this.productId))
            {
                base.GotoResourceNotFound();
            }
            this.hidSupName              = (HtmlInputHidden)this.FindControl("hidSupName");
            this.litSupplierName         = (Literal)this.FindControl("litSupplierName");
            this.hiddenpid               = (HtmlInputHidden)this.FindControl("hiddenpid");
            this.hidCartQuantity         = (HtmlInputHidden)this.FindControl("txCartQuantity");
            this.hiddenpid.Value         = this.productId.ToString();
            this.common_Location         = (Common_Location)this.FindControl("common_Location");
            this.litProductName          = (Literal)this.FindControl("litProductName");
            this.lblStock                = (StockLabel)this.FindControl("lblStock");
            this.litUnit                 = (Literal)this.FindControl("litUnit");
            this.litSaleCounts           = (Literal)this.FindControl("litSaleCounts");
            this.lblMarkerPrice          = (FormatedMoneyLabel)this.FindControl("lblMarkerPrice");
            this.lblBuyPrice             = (Label)this.FindControl("lblBuyPrice");
            this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
            this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
            this.btnBuy                  = (BuyButton)this.FindControl("btnBuy");
            this.btnaddgouwu             = (AddCartButton)this.FindControl("btnaddgouwu");
            this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations");
            this.ltlSaleCount            = (Literal)this.FindControl("ltlSaleCount");
            this.ltlReviewCount          = (Literal)this.FindControl("ltlReviewCount");
            this.litReviewCount          = (Literal)this.FindControl("litReviewCount");
            this.ltlConsultation         = (Literal)this.FindControl("ltlConsultation");
            this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
            this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
            this.rptOnlineService        = (ThemedTemplatedRepeater)this.FindControl("rptOnlineService");
            this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
            this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
            this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.hidden_skus             = (HtmlInputHidden)this.FindControl("hidden_skus");
            this.hidden_skuItem          = (HtmlInputHidden)this.FindControl("hidden_skuItem");
            this.hidIsOpenMultiStore     = (HtmlInputHidden)this.FindControl("hidIsOpenMultiStore");
            this.aCountDownUrl           = (HyperLink)this.FindControl("aCountDownUrl");
            this.imgQrCode               = (Image)this.FindControl("imgQrCode");
            this.phonePriceQrCode        = (Image)this.FindControl("phonePriceQrCode");
            this.liCode                  = (HtmlGenericControl)this.FindControl("liCode");
            this.hidden_productId        = (HtmlInputHidden)this.FindControl("hidden_productId");
            this.hidHasStores            = (HtmlInputHidden)this.FindControl("hidHasStores");
            this.divGift                 = (HtmlGenericControl)this.FindControl("divGift");
            this.ltlGiftName             = (Literal)this.FindControl("ltlGiftName");
            this.ltlGiftNum              = (Literal)this.FindControl("ltlGiftNum");
            this.aBrand                  = (HtmlAnchor)this.FindControl("aBrand");
            this.imgBrand                = (HiImage)this.FindControl("imgBrand");
            this.imgpdorequest           = (HtmlImage)this.FindControl("imgpdorequest");
            this.imgTakeonstore          = (HtmlImage)this.FindControl("imgTakeonstore");
            this.imgCustomerService      = (HtmlImage)this.FindControl("imgCustomerService");
            this.ltlOrderPromotion       = (Literal)this.FindControl("ltlOrderPromotion");
            this.ltlOrderPromotion_free  = (Literal)this.FindControl("ltlOrderPromotion_free");
            this.divOrderPromotions      = (HtmlGenericControl)this.FindControl("divOrderPromotions");
            this.divOrderPromotions2     = (HtmlGenericControl)this.FindControl("divOrderPromotions2");
            this.divOrderPromotions3     = (HtmlGenericControl)this.FindControl("divOrderPromotions3");
            this.divPhonePrice           = (HtmlGenericControl)this.FindControl("divPhonePrice");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.litPhonePriceEndDate    = (Literal)this.FindControl("litPhonePriceEndDate");
            this.divCuxiao               = (HtmlGenericControl)this.FindControl("divCuxiao");
            this.ltlUnit                 = (Literal)this.FindControl("ltlUnit");
            this.divProductReferral      = (HtmlGenericControl)this.FindControl("divProductReferral");
            this.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.setDeliverRegion        = (Common_SetDeliveryRegion)this.FindControl("setDeliverRegion");
            this.hidShowCombinationBuy   = (HtmlInputHidden)this.FindControl("hidShowCombinationBuy");
            this.hidCombinationId        = (HtmlInputHidden)this.FindControl("hidCombinationId");
            this.imgMainPic              = (HtmlImage)this.FindControl("imgMainPic");
            this.divqq = (HtmlGenericControl)this.FindControl("divqq");
            HtmlAnchor htmlAnchor = (HtmlAnchor)this.FindControl("aMainName");

            this.lblMainPrice = (Label)this.FindControl("lblMainPrice");
            ThemedTemplatedRepeater themedTemplatedRepeater = (ThemedTemplatedRepeater)this.FindControl("rptOtherProducts");

            this.spdiscount            = (HtmlGenericControl)this.FindControl("spdiscount");
            this.aCountDownUrl.Visible = false;
            this.buyProduct            = (HtmlTableRow)this.FindControl("buyProduct");
            this.serviceProduct        = (HtmlTableRow)this.FindControl("serviceProduct");
            if (this.Page.IsPostBack)
            {
                return;
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (this.spdiscount != null && HiContext.Current.User.UserId > 0)
            {
                MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId);
                this.spdiscount.Visible   = true;
                this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>";
            }
            if (this.imgQrCode != null)
            {
                string text = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png";
                Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text, false, ImageFormats.Png);
                this.imgQrCode.ImageUrl = text;
            }
            if (this.phonePriceQrCode != null)
            {
                string text2 = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png";
                Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text2, false, ImageFormats.Png);
                this.phonePriceQrCode.ImageUrl = text2;
            }
            if (this.liCode != null && HiContext.Current.SiteSettings.OpenAliho == 0 && HiContext.Current.SiteSettings.OpenVstore == 0 && HiContext.Current.SiteSettings.OpenWap == 0 && HiContext.Current.SiteSettings.OpenMobbile == 0)
            {
                this.liCode.Visible = false;
            }
            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, this.sitesettings.OpenMultStore, 0);

            if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                this.Page.Response.Redirect("/ProductDelete.aspx");
                return;
            }
            if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
            {
                this.Page.Response.Redirect(base.GetRouteUrl("unproductdetails", new
                {
                    ProductId = this.productId
                }));
            }
            if (productBrowseInfo.Product.SupplierId > 0 && productBrowseInfo.Product.AuditStatus != ProductAuditStatus.Pass)
            {
                this.Page.Response.Redirect(base.GetRouteUrl("unproductdetailsaudit", new
                {
                    ProductId = this.productId
                }));
            }
            if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock)
            {
                this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                return;
            }
            this.setDeliverRegion.ShippingTemplateId = productBrowseInfo.Product.ShippingTemplateId;
            this.setDeliverRegion.Volume             = productBrowseInfo.Product.Weight;
            this.setDeliverRegion.Weight             = productBrowseInfo.Product.Weight;
            this.ActivityBusiness();
            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(productBrowseInfo.Product.ProductId);
            }
            IEnumerable value = from item in productBrowseInfo.Product.Skus
                                select item.Value;

            if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
            {
                this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
            }
            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            this.hidden_productId.Value = this.productId.ToString();
            this.LoadPageSearch(productBrowseInfo.Product);
            if (this.lbUserProductRefer != null && this.sitesettings.OpenReferral == 1 && this.sitesettings.ShowDeductInProductPage)
            {
                this.lbUserProductRefer.product = productBrowseInfo.Product;
            }
            HyperLink hyperLink = this.hpkProductConsultations;
            int       num       = productBrowseInfo.ConsultationCount;

            hyperLink.Text = "查看全部" + num.ToString() + "条咨询";
            Literal literal = this.ltlConsultation;

            num          = productBrowseInfo.ConsultationCount;
            literal.Text = num.ToString();
            Literal literal2 = this.ltlSaleCount;

            num           = productBrowseInfo.SaleCount;
            literal2.Text = num.ToString();
            Literal literal3 = this.ltlReviewCount;

            num           = productBrowseInfo.ReviewCount;
            literal3.Text = num.ToString();
            Literal literal4 = this.litReviewCount;

            num           = productBrowseInfo.ReviewCount;
            literal4.Text = num.ToString();
            this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={this.productId}";
            this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
            this.btnBuy.Stock  = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock);
            this.ltlUnit.Text  = productBrowseInfo.Product.Unit;
            this.divqq.Visible = (this.sitesettings.ServiceIsOpen == "1");
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!productBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0c9e;
                }
                decimal?subMemberDeduct = productBrowseInfo.Product.SubMemberDeduct;
                if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
                {
                    goto IL_0c9e;
                }
            }
            goto IL_0cd8;
IL_0cd9:
            int num2;

            if (num2 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            this.btnaddgouwu.Stock = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock);
            BrowsedProductQueue.EnQueue(this.productId);
            this.images.ImageInfo = productBrowseInfo.Product;
            if (productBrowseInfo.DbAttribute != null)
            {
                this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                this.rptExpandAttributes.DataBind();
            }
            if (productBrowseInfo.DbSKUs != null)
            {
                this.skuSelector.ProductId  = this.productId;
                this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
            }
            int supplierId = productBrowseInfo.Product.SupplierId;

            if (supplierId > 0)
            {
                SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId);
                if (!string.IsNullOrEmpty(supplierById.Picture))
                {
                    this.imgBrand.ImageUrl = supplierById.Picture;
                }
                else if (productBrowseInfo.Product.BrandId.HasValue)
                {
                    BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value);
                    if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Logo))
                    {
                        this.imgBrand.ImageUrl = brandCategory.Logo;
                        this.aBrand.HRef       = base.GetRouteUrl("branddetails", new
                        {
                            brandId = brandCategory.BrandId
                        });
                    }
                }
                else
                {
                    this.imgBrand.Visible = false;
                }
                this.litSupplierName.Text = "<a href=\"/SupplierAbout?SupplierId=" + supplierById.SupplierId + "\">" + supplierById.SupplierName + "</a>";
                this.hidSupName.Value     = supplierById.SupplierName;
            }
            else
            {
                this.litSupplierName.Visible = false;
                if (productBrowseInfo.Product.BrandId.HasValue)
                {
                    BrandCategoryInfo brandCategory2 = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value);
                    if (brandCategory2 != null && !string.IsNullOrEmpty(brandCategory2.Logo))
                    {
                        this.imgBrand.ImageUrl = brandCategory2.Logo;
                        this.aBrand.HRef       = base.GetRouteUrl("branddetails", new
                        {
                            brandId = brandCategory2.BrandId
                        });
                    }
                }
            }
            if (SalesHelper.IsSupportPodrequest() && productBrowseInfo.Product.SupplierId == 0)
            {
                this.imgpdorequest.Visible = true;
            }
            if (masterSettings.OpenMultStore)
            {
                if (StoresHelper.ProductInStoreAndIsAboveSelf(this.productId))
                {
                    this.imgTakeonstore.Visible = true;
                }
            }
            else if (masterSettings.IsOpenPickeupInStore && productBrowseInfo.Product.SupplierId == 0)
            {
                this.imgTakeonstore.Visible = true;
            }
            if (productBrowseInfo.DBConsultations != null)
            {
                this.consultations.DataSource = productBrowseInfo.DBConsultations;
                this.consultations.DataBind();
            }
            if (productBrowseInfo.DbCorrelatives != null)
            {
                this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
                this.correlative.DataBind();
            }
            this.BindOrderPromotions();
            if (!this.divOrderPromotions.Visible && !this.divOrderPromotions2.Visible && !this.divOrderPromotions3.Visible && !this.divPhonePrice.Visible)
            {
                this.divCuxiao.Style.Add("display", "none");
            }
            if (this.rptOnlineService != null)
            {
                IList <OnlineServiceInfo> allOnlineService  = OnlineServiceHelper.GetAllOnlineService(0, 1);
                IList <OnlineServiceInfo> allOnlineService2 = OnlineServiceHelper.GetAllOnlineService(0, 2);
                if (allOnlineService2 != null)
                {
                    foreach (OnlineServiceInfo item in allOnlineService2)
                    {
                        allOnlineService.Add(item);
                    }
                }
                this.rptOnlineService.DataSource = allOnlineService;
                this.rptOnlineService.DataBind();
            }
            if (productBrowseInfo.Product.Stock > 0)
            {
                CombinationBuyInfo combinationBuyByMainProductId = CombinationBuyHelper.GetCombinationBuyByMainProductId(this.productId);
                if (combinationBuyByMainProductId != null)
                {
                    List <CombinationBuyandProductUnionInfo> combinationProductListByProductId = CombinationBuyHelper.GetCombinationProductListByProductId(this.productId);
                    CombinationBuyandProductUnionInfo        combinationBuyandProductUnionInfo = combinationProductListByProductId.FirstOrDefault((CombinationBuyandProductUnionInfo c) => c.ProductId == this.productId);
                    if (combinationBuyandProductUnionInfo != null)
                    {
                        HtmlInputHidden htmlInputHidden = this.hidCombinationId;
                        num = combinationBuyandProductUnionInfo.CombinationId;
                        htmlInputHidden.Value = num.ToString();
                        string value2 = string.IsNullOrEmpty(combinationBuyandProductUnionInfo.ThumbnailUrl100) ? this.sitesettings.DefaultProductThumbnail3 : combinationBuyandProductUnionInfo.ThumbnailUrl100;
                        this.imgMainPic.Attributes["data-url"] = value2;
                        htmlAnchor.InnerText   = combinationBuyandProductUnionInfo.ProductName;
                        this.lblMainPrice.Text = combinationBuyandProductUnionInfo.MinCombinationPrice.F2ToString("f2");
                        this.lblMainPrice.Attributes["salePrice"] = combinationBuyandProductUnionInfo.MinSalePrice.F2ToString("f2");
                    }
                    combinationProductListByProductId.Remove(combinationBuyandProductUnionInfo);
                    if (combinationProductListByProductId != null && combinationProductListByProductId.Count > 0)
                    {
                        for (int i = 0; i < combinationProductListByProductId.Count; i++)
                        {
                            string thumbnailUrl = string.IsNullOrEmpty(combinationProductListByProductId[i].ThumbnailUrl100) ? this.sitesettings.DefaultProductThumbnail3 : combinationProductListByProductId[i].ThumbnailUrl100;
                            combinationProductListByProductId[i].ThumbnailUrl100 = thumbnailUrl;
                            combinationProductListByProductId[i].Index           = i + 1;
                        }
                        themedTemplatedRepeater.DataSource = combinationProductListByProductId;
                        themedTemplatedRepeater.DataBind();
                        this.hidShowCombinationBuy.Value = "1";
                    }
                }
            }
            return;

IL_0cd8:
            num2 = 1;
            goto IL_0cd9;
IL_0c9e:
            if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null)
            {
                num2 = (user.Referral.IsRepeled ? 1 : 0);
                goto IL_0cd9;
            }
            goto IL_0cd8;
        }
Example #15
0
        protected override void AttachChildControls()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                this.ShowWapMessage("错误的商品ID", "Default.aspx");
            }
            if (base.ClientType.Equals(ClientType.VShop))
            {
                FightGroupActivitiyModel fightGroupActivitiyModel = VShopHelper.GetFightGroupActivities(new FightGroupActivitiyQuery
                {
                    PageIndex = 1,
                    PageSize  = 1,
                    ProductId = this.productId,
                    Status    = EnumFightGroupActivitiyStatus.BeingCarried
                }).Models.FirstOrDefault();
                if (fightGroupActivitiyModel != null)
                {
                    this.Page.Response.Redirect("FightGroupActivityDetails.aspx?fightGroupActivityId=" + fightGroupActivitiyModel.FightGroupActivityId);
                }
            }
            this.hidStoreId            = (HtmlInputHidden)this.FindControl("hidStoreId");
            this.hidSupplier           = (HtmlInputHidden)this.FindControl("hidSupplier");
            this.litSupplierName       = (Literal)this.FindControl("litSupplierName");
            this.aCountDownUrl         = (HyperLink)this.FindControl("aCountDownUrl");
            this.aCountDownUrl.Visible = false;
            this.divCountDownUrl       = (HtmlGenericControl)this.FindControl("divCountDownUrl");
            this.hidCanTakeOnStore     = (HtmlInputHidden)this.FindControl("hidCanTakeOnStore");
            this.HasActivitiesToJumpUrl();
            this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations");
            this.rptProductImages        = (WapTemplatedRepeater)this.FindControl("rptProductImages");
            this.rptCouponList           = (WapTemplatedRepeater)this.FindControl("rptCouponList");
            this.rp_guest                = (WapTemplatedRepeater)this.FindControl("rp_guest");
            this.rp_com                  = (WapTemplatedRepeater)this.FindControl("rp_com");
            this.litProdcutName          = (Literal)this.FindControl("litProdcutName");
            this.litSalePrice            = (Literal)this.FindControl("litSalePrice");
            this.litMarketPrice          = (Literal)this.FindControl("litMarketPrice");
            this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.ltlcombinamaininfo      = (Literal)this.FindControl("ltlcombinamaininfo");
            this.skuSubmitOrder          = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder");
            this.skuStoreSubmitOrder     = (Common_SKUSubmitStoreOrder)this.FindControl("skuStoreSubmitOrder");
            this.expandAttr              = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount            = (Literal)this.FindControl("litSoldCount");
            this.litConsultationsCount   = (Literal)this.FindControl("litConsultationsCount");
            this.litReviewsCount         = (Literal)this.FindControl("litReviewsCount");
            this.litHasCollected         = (HtmlInputHidden)this.FindControl("litHasCollected");
            this.hidden_skus             = (HtmlInputHidden)this.FindControl("hidden_skus");
            this.ltlOrderPromotion       = (Literal)this.FindControl("ltlOrderPromotion");
            this.ltlOrderPromotion2      = (Literal)this.FindControl("ltlOrderPromotion2");
            this.ltlProductSendGifts2    = (Literal)this.FindControl("ltlProductSendGifts2");
            this.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.liOrderPromotions       = (HtmlGenericControl)this.FindControl("liOrderPromotions");
            this.liOrderPromotions2      = (HtmlGenericControl)this.FindControl("liOrderPromotions2");
            this.liProductSendGifts2     = (HtmlGenericControl)this.FindControl("liProductSendGifts2");
            this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2");
            this.liOrderPromotions_free  = (HtmlGenericControl)this.FindControl("liOrderPromotions_free");
            this.divActivities           = (HtmlGenericControl)this.FindControl("divActivities");
            this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2");
            this.ltlOrderPromotion_free  = (Literal)this.FindControl("ltlOrderPromotion_free");
            this.liProductSendGifts      = (HtmlGenericControl)this.FindControl("liProductSendGifts");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.divshiptoregion         = (HtmlGenericControl)this.FindControl("divshiptoregion");
            this.divwaplocateaddress     = (HtmlGenericControl)this.FindControl("divwaplocateaddress");
            this.promote                 = (ProductPromote)this.FindControl("ProductPromote");
            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.hidCombinaid            = (HtmlInputHidden)this.FindControl("hidCombinaid");
            this.divConsultationEmpty    = (HtmlGenericControl)this.FindControl("divConsultationEmpty");
            this.ulConsultations         = (HtmlGenericControl)this.FindControl("ulConsultations");
            this.divShortDescription     = (HtmlGenericControl)this.FindControl("divShortDescription");
            this.hidRegionId             = (HtmlInputHidden)this.FindControl("hidRegionId");
            this.divProductReferral      = (HtmlGenericControl)this.FindControl("divProductReferral");
            this.hidden_productId        = (HtmlInputHidden)this.FindControl("hidden_productId");
            this.hidCouponCount          = (HtmlInputHidden)this.FindControl("hidCouponCount");
            this.hidHasStores            = (HtmlInputHidden)this.FindControl("hidHasStores");
            this.divPodrequest           = (HtmlGenericControl)this.FindControl("divPodrequest");
            this.divGuest                = (HtmlGenericControl)this.FindControl("divGuest");
            this.divcombina              = (HtmlGenericControl)this.FindControl("divcombina");
            this.hidUnOnSale             = (HtmlInputHidden)this.FindControl("hidUnOnSale");
            this.hidUnAudit              = (HtmlInputHidden)this.FindControl("hidUnAudit");
            this.divPhonePrice           = (HtmlGenericControl)this.FindControl("divPhonePrice");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.spdiscount              = (HtmlGenericControl)this.FindControl("spdiscount");
            this.ulsupplier              = (HtmlGenericControl)this.FindControl("ulsupplier");
            this.divGouMai               = (HtmlGenericControl)this.FindControl("divGouMai");
            this.ltlBottomStatus         = (Literal)this.FindControl("ltlBottomStatus");
            this.hdAppId.Value           = masterSettings.WeixinAppId;
            this.hidStoreId.Value        = this.storeId.ToString();
            HtmlInputHidden htmlInputHidden = this.hidRegionId;
            int             num             = HiContext.Current.DeliveryScopRegionId;

            htmlInputHidden.Value = num.ToString();
            this.hidden_skuItem   = (HtmlInputHidden)this.FindControl("hidden_skuItem");
            this.hidCartQuantity  = (HtmlInputHidden)this.FindControl("txCartQuantity");
            this.lblStock         = (StockLabel)this.FindControl("lblStock");
            this.litUnit          = (Literal)this.FindControl("litUnit");
            this.lit_IsRefund     = (Literal)this.FindControl("lit_IsRefund");
            this.lit_IsOverRefund = (Literal)this.FindControl("lit_IsOverRefund");
            this.lit_RefundTime   = (Literal)this.FindControl("lit_RefundTime");
            ProductBrowseInfo wAPProductBrowseInfo = ProductBrowser.GetWAPProductBrowseInfo(this.productId, null, masterSettings.OpenMultStore, 0);
            StoreProductQuery storeProductQuery    = new StoreProductQuery
            {
                ProductId = this.productId,
                StoreId   = this.storeId
            };
            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);
            }
            else
            {
                storeProductQuery.Position        = new PositionInfo(0.0, 0.0);
                storeProductQuery.Position.CityId = 0;
                storeProductQuery.Position.AreaId = 0;
            }
            this.hidStoreId.Value = this.storeId.ToString();
            if (this.storeId > 0)
            {
                ProductModel storeProduct = ProductBrowser.GetStoreProduct(storeProductQuery);
                if (storeProduct == null || storeProduct.SaleStatus == ProductSaleStatus.Delete)
                {
                    this.Page.Response.Redirect("ProductDelete.aspx");
                    return;
                }
                if (storeProduct.SaleStatus == ProductSaleStatus.OnStock)
                {
                    base.GotoResourceNotFound("商品已经入库");
                }
                if (wAPProductBrowseInfo.Product.ProductType != 1.GetHashCode())
                {
                    HttpContext.Current.Response.Redirect("ProductDetail?productId=" + this.productId);
                }
                if (storeProduct.SaleStatus == ProductSaleStatus.UnSale)
                {
                    this.hidUnOnSale.Value = "1";
                }
                this.litSalePrice.Text = ((storeProduct.MinSalePrice == storeProduct.MaxSalePrice) ? storeProduct.MinSalePrice.F2ToString("f2") : (storeProduct.MinSalePrice.F2ToString("f2") + "~" + storeProduct.MaxSalePrice.F2ToString("f2")));
                this.skuStoreSubmitOrder.IsServiceProduct = true;
                this.skuStoreSubmitOrder.ProductInfo      = storeProduct;
                this.skuSubmitOrder.Visible = false;
            }
            else
            {
                if (wAPProductBrowseInfo.Product == null || wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
                {
                    this.Page.Response.Redirect("ProductDelete.aspx");
                    return;
                }
                if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock)
                {
                    base.GotoResourceNotFound("商品已经入库");
                }
                if (wAPProductBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
                {
                    this.hidUnOnSale.Value = "1";
                }
                this.litSalePrice.Text           = ((wAPProductBrowseInfo.Product.MinSalePrice == wAPProductBrowseInfo.Product.MaxSalePrice) ? wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") : (wAPProductBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~" + wAPProductBrowseInfo.Product.MaxSalePrice.F2ToString("f2")));
                this.skuSubmitOrder.ProductInfo  = wAPProductBrowseInfo.Product;
                this.skuStoreSubmitOrder.Visible = false;
            }
            if (masterSettings.OpenMultStore)
            {
                if (StoresHelper.ProductInStoreAndIsAboveSelf(this.productId))
                {
                    this.hidHasStores.Value      = "1";
                    this.hidCanTakeOnStore.Value = "1";
                }
            }
            else if (masterSettings.IsOpenPickeupInStore && wAPProductBrowseInfo.Product.SupplierId == 0)
            {
                this.hidCanTakeOnStore.Value = "1";
            }
            if (SalesHelper.IsSupportPodrequest() && wAPProductBrowseInfo.Product.SupplierId == 0)
            {
                this.divPodrequest.Visible = true;
            }
            HtmlInputHidden htmlInputHidden2 = this.hidUnAudit;

            num = (int)wAPProductBrowseInfo.Product.AuditStatus;
            htmlInputHidden2.Value = num.ToString();
            if (this.spdiscount != null && HiContext.Current.User.UserId > 0)
            {
                MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(HiContext.Current.User.GradeId);
                this.spdiscount.Visible   = true;
                this.spdiscount.InnerHtml = "<strong class='vip_price'><img src='/templates/pccommon/images/vip_price.png' />" + memberGrade.Name + "价</strong>";
            }
            this.lbUserProductRefer.product = wAPProductBrowseInfo.Product;
            this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(wAPProductBrowseInfo.Product.Title) ? wAPProductBrowseInfo.Product.ProductName : wAPProductBrowseInfo.Product.Title);
            this.hdDesc.Value  = Globals.StripAllTags(string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : wAPProductBrowseInfo.Product.ShortDescription);
            string oldValue = "/storage/master/product/images/";
            string newValue = "/storage/master/product/thumbs410/410_";

            if (!string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1))
            {
                wAPProductBrowseInfo.Product.ImageUrl1 = wAPProductBrowseInfo.Product.ImageUrl1.ToLower().Replace(oldValue, newValue);
            }
            string local = string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : wAPProductBrowseInfo.Product.ImageUrl1;

            this.hdImgUrl.Value = Globals.FullPath(local);
            this.hdLink.Value   = Globals.FullPath(HttpContext.Current.Request.Url.ToString());
            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId);
            }
            if (this.hidden_productId != null)
            {
                this.hidden_productId.Value = this.productId.ToString();
            }
            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || wAPProductBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!wAPProductBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0ed1;
                }
                decimal?subMemberDeduct = wAPProductBrowseInfo.Product.SubMemberDeduct;
                if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
                {
                    goto IL_0ed1;
                }
            }
            goto IL_0f0b;
IL_0ed1:
            int num2;

            if (HiContext.Current.SiteSettings.OpenReferral == 1 && HiContext.Current.SiteSettings.ShowDeductInProductPage && user.Referral != null)
            {
                num2 = (user.Referral.IsRepeled ? 1 : 0);
                goto IL_0f0c;
            }
            goto IL_0f0b;
IL_0f0b:
            num2 = 1;
            goto IL_0f0c;
IL_0f0c:
            if (num2 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            bool flag = true;

            if (this.rptProductImages != null)
            {
                string locationUrl = "javascript:;";
                if (string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ImageUrl5))
                {
                    wAPProductBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage;
                }
                DataTable         skus = ProductBrowser.GetSkus(this.productId);
                List <SlideImage> list = new List <SlideImage>();
                int supplierId         = wAPProductBrowseInfo.Product.SupplierId;
                if (supplierId > 0)
                {
                    SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId);
                    if (supplierById != null)
                    {
                        this.hidSupplier.Value    = "true";
                        this.litSupplierName.Text = supplierById.SupplierName;
                    }
                }
                else
                {
                    this.hidSupplier.Value = "false";
                    flag = false;
                    this.ulsupplier.Style.Add(HtmlTextWriterStyle.Display, "none");
                }
                list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl1, locationUrl));
                list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl2, locationUrl));
                list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl3, locationUrl));
                list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl4, locationUrl));
                list.Add(new SlideImage(wAPProductBrowseInfo.Product.ImageUrl5, locationUrl));
                this.rptProductImages.DataSource = from item in list
                                                   where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                   select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text = wAPProductBrowseInfo.Product.ProductName;
            if (wAPProductBrowseInfo.Product.MarketPrice.HasValue)
            {
                this.litMarketPrice.SetWhenIsNotNull(wAPProductBrowseInfo.Product.MarketPrice.GetValueOrDefault(decimal.Zero).F2ToString("f2"));
            }
            this.litShortDescription.Text    = wAPProductBrowseInfo.Product.ShortDescription;
            this.divShortDescription.Visible = !string.IsNullOrEmpty(wAPProductBrowseInfo.Product.ShortDescription);
            if (wAPProductBrowseInfo.Product.IsRefund)
            {
                this.lit_IsRefund.Text     = "<img src=\"/templates/common/images/service_gou.png\" /><span class=\"c-green\">随时退</span>";
                this.lit_IsOverRefund.Text = (wAPProductBrowseInfo.Product.IsOverRefund ? "" : "<img src=\"/templates/common/images/service_cha.png\" /><span class=\"c-orange\">过期不退</span>");
            }
            else
            {
                this.lit_IsRefund.Text = "<img src=\"/templates/common/images/service_cha.png\" /><span class=\"c-orange\">不可退</span>";
            }
            if (!wAPProductBrowseInfo.Product.IsValid)
            {
                if (wAPProductBrowseInfo.Product.ValidStartDate.HasValue && wAPProductBrowseInfo.Product.ValidEndDate.HasValue)
                {
                    Literal  literal = this.lit_RefundTime;
                    DateTime value   = wAPProductBrowseInfo.Product.ValidStartDate.Value;
                    string   arg     = value.ToString("yyyy/MM/dd");
                    value        = wAPProductBrowseInfo.Product.ValidEndDate.Value;
                    literal.Text = string.Format("{0}-{1}", arg, value.ToString("yyyy/MM/dd"));
                }
            }
            else
            {
                this.lit_RefundTime.Text = "长期有效";
            }
            if (this.litDescription != null)
            {
                string text  = "";
                Regex  regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.MobbileDescription))
                {
                    text = regex.Replace(wAPProductBrowseInfo.Product.MobbileDescription, "");
                }
                else if (!string.IsNullOrWhiteSpace(wAPProductBrowseInfo.Product.Description))
                {
                    text = regex.Replace(wAPProductBrowseInfo.Product.Description, "");
                }
                text = text.Replace("src", "data-url");
                text = text.Replace("vurl", "src");
                this.litDescription.Text = text;
            }
            Literal control = this.litSoldCount;

            num = wAPProductBrowseInfo.Product.ShowSaleCounts;
            control.SetWhenIsNotNull(num.ToString());
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            Literal control2 = this.litConsultationsCount;

            num = wAPProductBrowseInfo.ConsultationCount;
            control2.SetWhenIsNotNull(num.ToString());
            Literal control3 = this.litReviewsCount;

            num = wAPProductBrowseInfo.ReviewCount;
            control3.SetWhenIsNotNull(num.ToString());
            MemberInfo user2 = HiContext.Current.User;
            bool       flag2 = false;

            if (user2 != null)
            {
                flag2 = ProductBrowser.CheckHasCollect(user2.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag2 ? "1" : "0");
            this.BindCouponList();
            PageTitle.AddSiteNameTitle(wAPProductBrowseInfo.Product.ProductName);
            this.BindCombinaBuyInfo();
            this.BindPromotionInfo();
            DataTable dBConsultations = wAPProductBrowseInfo.DBConsultations;

            for (int i = 0; i < dBConsultations.Rows.Count; i++)
            {
                dBConsultations.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(dBConsultations.Rows[i]["UserName"].ToNullString());
            }
            this.rptProductConsultations.DataSource = dBConsultations;
            this.rptProductConsultations.DataBind();
            this.divConsultationEmpty.Visible = dBConsultations.IsNullOrEmpty();
            this.ulConsultations.Visible      = !dBConsultations.IsNullOrEmpty();
            string phonePriceByProductId = PromoteHelper.GetPhonePriceByProductId(this.productId);

            if (!string.IsNullOrEmpty(phonePriceByProductId))
            {
                this.divPhonePrice.Visible = true;
                decimal num3 = phonePriceByProductId.Split(',')[0].ToDecimal(0);
                this.litPhonePrice.Text = num3.F2ToString("f2");
                decimal num4 = wAPProductBrowseInfo.Product.MinSalePrice - num3;
                this.litSalePrice.Text = ((num4 > decimal.Zero) ? num4 : decimal.Zero).F2ToString("f2");
                this.lbUserProductRefer.MobileExclusive = num3;
            }
            if (flag || this.liOrderPromotions.Visible || this.liOrderPromotions_free2.Visible || this.liProductSendGifts.Visible || this.rptCouponList.Visible)
            {
                this.divActivities.Visible = true;
            }
            else
            {
                this.divActivities.Visible = false;
            }
            StoresInfo storeById = StoresHelper.GetStoreById(this.storeId);

            if (storeById != null)
            {
                this.ProcessException(storeById);
            }
        }
        protected override void AttachChildControls()
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            if (!int.TryParse(this.Page.Request.QueryString["PreSaleId"], out this.presaleId))
            {
                this.ShowWapMessage("错误的活动ID", "Default.aspx");
                return;
            }
            ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.presaleId);

            if (productPreSaleInfo == null)
            {
                this.ShowWapMessage("错误的活动ID", "Default.aspx");
                return;
            }
            if (productPreSaleInfo.PreSaleEndDate < DateTime.Now)
            {
                this.Page.Response.Redirect("ProductDetails.aspx?ProductId = " + productPreSaleInfo.ProductId);
                return;
            }
            this.productId               = productPreSaleInfo.ProductId;
            this.hidSupplier             = (HtmlInputHidden)this.FindControl("hidSupplier");
            this.litSupplierName         = (Literal)this.FindControl("litSupplierName");
            this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations");
            this.rptProductImages        = (WapTemplatedRepeater)this.FindControl("rptProductImages");
            this.rptCouponList           = (WapTemplatedRepeater)this.FindControl("rptCouponList");
            this.rp_guest                = (WapTemplatedRepeater)this.FindControl("rp_guest");
            this.rp_com                  = (WapTemplatedRepeater)this.FindControl("rp_com");
            this.litProdcutName          = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.ltlcombinamaininfo      = (Literal)this.FindControl("ltlcombinamaininfo");
            this.skuSubmitOrder          = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder");
            this.expandAttr              = (Common_ExpandAttributes)this.FindControl("ExpandAttributes");
            this.litSoldCount            = (Literal)this.FindControl("litSoldCount");
            this.litConsultationsCount   = (Literal)this.FindControl("litConsultationsCount");
            this.litReviewsCount         = (Literal)this.FindControl("litReviewsCount");
            this.litHasCollected         = (HtmlInputHidden)this.FindControl("litHasCollected");
            this.hidden_skus             = (HtmlInputHidden)this.FindControl("hidden_skus");
            this.ltlOrderPromotion       = (Literal)this.FindControl("ltlOrderPromotion");
            this.ltlOrderPromotion2      = (Literal)this.FindControl("ltlOrderPromotion2");
            this.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.ltlProductSendGifts2    = (Literal)this.FindControl("ltlProductSendGifts2");
            this.liOrderPromotions       = (HtmlGenericControl)this.FindControl("liOrderPromotions");
            this.liOrderPromotions2      = (HtmlGenericControl)this.FindControl("liOrderPromotions2");
            this.liProductSendGifts      = (HtmlGenericControl)this.FindControl("liProductSendGifts");
            this.liProductSendGifts2     = (HtmlGenericControl)this.FindControl("liProductSendGifts2");
            this.liOrderPromotions_free2 = (HtmlGenericControl)this.FindControl("liOrderPromotions_free2");
            this.liOrderPromotions_free  = (HtmlGenericControl)this.FindControl("liOrderPromotions_free");
            this.ltlOrderPromotion_free2 = (Literal)this.FindControl("ltlOrderPromotion_free2");
            this.ltlOrderPromotion_free  = (Literal)this.FindControl("ltlOrderPromotion_free");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.divshiptoregion         = (HtmlGenericControl)this.FindControl("divshiptoregion");
            this.divwaplocateaddress     = (HtmlGenericControl)this.FindControl("divwaplocateaddress");
            this.productFreight          = (ProductFreightLiteral)this.FindControl("productFreight");
            this.promote                 = (ProductPromote)this.FindControl("ProductPromote");
            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.hidCombinaid            = (HtmlInputHidden)this.FindControl("hidCombinaid");
            this.divConsultationEmpty    = (HtmlGenericControl)this.FindControl("divConsultationEmpty");
            this.ulConsultations         = (HtmlGenericControl)this.FindControl("ulConsultations");
            this.divShortDescription     = (HtmlGenericControl)this.FindControl("divShortDescription");
            this.hidRegionId             = (HtmlInputHidden)this.FindControl("hidRegionId");
            this.divProductReferral      = (HtmlGenericControl)this.FindControl("divProductReferral");
            this.hidden_productId        = (HtmlInputHidden)this.FindControl("hidden_productId");
            this.hidCouponCount          = (HtmlInputHidden)this.FindControl("hidCouponCount");
            this.hidHasStores            = (HtmlInputHidden)this.FindControl("hidHasStores");
            this.divPodrequest           = (HtmlGenericControl)this.FindControl("divPodrequest");
            this.divGuest                = (HtmlGenericControl)this.FindControl("divGuest");
            this.divcombina              = (HtmlGenericControl)this.FindControl("divcombina");
            this.hidUnOnSale             = (HtmlInputHidden)this.FindControl("hidUnOnSale");
            this.divPhonePrice           = (HtmlGenericControl)this.FindControl("divPhonePrice");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.litpresaleprice         = (Literal)this.FindControl("litpresaleprice");
            this.litsaleprice            = (Literal)this.FindControl("litsaleprice");
            this.litRetainage            = (Literal)this.FindControl("litRetainage");
            this.litDeliverGood          = (Literal)this.FindControl("litDeliverGood");
            this.hidEndDate              = (HtmlInputHidden)this.FindControl("hidEndDate");
            this.hidNowDate              = (HtmlInputHidden)this.FindControl("hidNowDate");
            this.hdAppId.Value           = masterSettings.WeixinAppId;
            HtmlInputHidden htmlInputHidden = this.hidRegionId;
            int             num             = HiContext.Current.DeliveryScopRegionId;

            htmlInputHidden.Value = num.ToString();
            this.hidden_skuItem   = (HtmlInputHidden)this.FindControl("hidden_skuItem");
            this.hidCartQuantity  = (HtmlInputHidden)this.FindControl("txCartQuantity");
            this.lblStock         = (StockLabel)this.FindControl("lblStock");
            this.litUnit          = (Literal)this.FindControl("litUnit");
            ProductBrowseInfo productPreSaleBrowseInfo = ProductBrowser.GetProductPreSaleBrowseInfo(this.productId, true);

            if (productPreSaleBrowseInfo.Product == null || productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                this.Page.Response.Redirect("ProductDelete.aspx");
                return;
            }
            if (productPreSaleBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
            {
                this.hidUnOnSale.Value = "1";
            }
            this.litpresaleprice.Text = ((productPreSaleInfo.DepositPercent == 0) ? productPreSaleInfo.Deposit.F2ToString("f2") : ((decimal)productPreSaleInfo.DepositPercent * productPreSaleBrowseInfo.Product.MinSalePrice / 100m).F2ToString("f2"));
            if (productPreSaleBrowseInfo.Product.MinSalePrice < productPreSaleBrowseInfo.Product.MaxSalePrice)
            {
                this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2") + "~ ¥" + productPreSaleBrowseInfo.Product.MaxSalePrice.F2ToString("f2");
            }
            else
            {
                this.litsaleprice.Text = "¥" + productPreSaleBrowseInfo.Product.MinSalePrice.F2ToString("f2");
            }
            Literal  literal  = this.litRetainage;
            DateTime dateTime = productPreSaleInfo.PaymentStartDate;
            string   str      = dateTime.ToString("yyyy/MM/dd");

            dateTime     = productPreSaleInfo.PaymentEndDate;
            literal.Text = str + "~" + dateTime.ToString("yyyy/MM/dd");
            Literal literal2 = this.litDeliverGood;
            object  text;

            if (!productPreSaleInfo.DeliveryDate.HasValue)
            {
                text = $"尾款支付后{productPreSaleInfo.DeliveryDays}天内发货";
            }
            else
            {
                dateTime = productPreSaleInfo.DeliveryDate.Value;
                text     = dateTime.ToString("yyyy年MM月dd日") + "发货";
            }
            literal2.Text = (string)text;
            HtmlInputHidden htmlInputHidden2 = this.hidNowDate;

            dateTime = DateTime.Now;
            htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            HtmlInputHidden htmlInputHidden3 = this.hidEndDate;

            dateTime = productPreSaleInfo.PreSaleEndDate;
            htmlInputHidden3.Value                 = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            this.skuSubmitOrder.ProductInfo        = productPreSaleBrowseInfo.Product;
            this.skuSubmitOrder.OrderBusiness      = 4;
            this.skuSubmitOrder.PreSaleId          = this.presaleId;
            this.skuSubmitOrder.productPreSaleInfo = productPreSaleInfo;
            this.lbUserProductRefer.product        = productPreSaleBrowseInfo.Product;
            this.productFreight.ShippingTemplateId = productPreSaleBrowseInfo.Product.ShippingTemplateId;
            this.productFreight.Volume             = productPreSaleBrowseInfo.Product.Weight;
            this.productFreight.Weight             = productPreSaleBrowseInfo.Product.Weight;
            this.hdTitle.Value = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.Title) ? productPreSaleBrowseInfo.Product.ProductName : productPreSaleBrowseInfo.Product.Title);
            this.hdDesc.Value  = Globals.StripAllTags(string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription) ? this.hdTitle.Value : productPreSaleBrowseInfo.Product.ShortDescription);
            string local = string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) ? SettingsManager.GetMasterSettings().DefaultProductImage : productPreSaleBrowseInfo.Product.ImageUrl1;

            this.hdImgUrl.Value = Globals.FullPath(local);
            this.hdLink.Value   = Globals.FullPath(HttpContext.Current.Request.Url.ToString());
            IEnumerable enumerable = from item in productPreSaleBrowseInfo.Product.Skus
                                     select item.Value;

            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(this.productId);
            }
            IEnumerable value = from item in productPreSaleBrowseInfo.Product.Skus
                                select item.Value;

            if (JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs) != null)
            {
                this.hidden_skuItem.Value = JsonConvert.SerializeObject(productPreSaleBrowseInfo.DbSKUs);
            }
            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            if (this.hidden_productId != null)
            {
                this.hidden_productId.Value = this.productId.ToString();
            }
            if (this.promote != null)
            {
                this.promote.ProductId = this.productId;
            }
            int supplierId = productPreSaleBrowseInfo.Product.SupplierId;

            if (supplierId > 0)
            {
                SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId);
                if (supplierById != null)
                {
                    this.hidSupplier.Value    = "true";
                    this.litSupplierName.Text = supplierById.SupplierName;
                }
            }
            else
            {
                this.hidSupplier.Value = "false";
            }
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!productPreSaleBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0c63;
                }
                decimal?subMemberDeduct = productPreSaleBrowseInfo.Product.SubMemberDeduct;
                if (!(subMemberDeduct.GetValueOrDefault() <= default(decimal)) || !subMemberDeduct.HasValue)
                {
                    goto IL_0c63;
                }
            }
            goto IL_0c89;
IL_0c89:
            int num2 = 1;

            goto IL_0c8a;
IL_0c8a:
            if (num2 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            if (this.rptProductImages != null)
            {
                string locationUrl = "javascript:;";
                if (string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl1) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl2) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl3) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl4) && string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ImageUrl5))
                {
                    productPreSaleBrowseInfo.Product.ImageUrl1 = masterSettings.DefaultProductImage;
                }
                List <SlideImage> list = new List <SlideImage>();
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl1, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl2, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl3, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl4, locationUrl));
                list.Add(new SlideImage(productPreSaleBrowseInfo.Product.ImageUrl5, locationUrl));
                this.rptProductImages.DataSource = from item in list
                                                   where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                   select item;
                this.rptProductImages.DataBind();
            }
            this.litProdcutName.Text         = productPreSaleBrowseInfo.Product.ProductName;
            this.litShortDescription.Text    = productPreSaleBrowseInfo.Product.ShortDescription;
            this.divShortDescription.Visible = !string.IsNullOrEmpty(productPreSaleBrowseInfo.Product.ShortDescription);
            if (this.litDescription != null)
            {
                string text2 = "";
                Regex  regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.MobbileDescription))
                {
                    text2 = regex.Replace(productPreSaleBrowseInfo.Product.MobbileDescription, "");
                }
                else if (!string.IsNullOrWhiteSpace(productPreSaleBrowseInfo.Product.Description))
                {
                    text2 = regex.Replace(productPreSaleBrowseInfo.Product.Description, "");
                }
                text2 = text2.Replace("src", "data-url");
                this.litDescription.Text = text2;
            }
            Literal control = this.litSoldCount;

            num = productPreSaleBrowseInfo.Product.ShowSaleCounts;
            control.SetWhenIsNotNull(num.ToString());
            if (this.expandAttr != null)
            {
                this.expandAttr.ProductId = this.productId;
            }
            Literal control2 = this.litConsultationsCount;

            num = productPreSaleBrowseInfo.ConsultationCount;
            control2.SetWhenIsNotNull(num.ToString());
            Literal control3 = this.litReviewsCount;

            num = productPreSaleBrowseInfo.ReviewCount;
            control3.SetWhenIsNotNull(num.ToString());
            MemberInfo user2 = HiContext.Current.User;
            bool       flag  = false;

            if (user2 != null)
            {
                flag = ProductBrowser.CheckHasCollect(user2.UserId, this.productId);
            }
            this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
            this.BindCouponList();
            PageTitle.AddSiteNameTitle(productPreSaleBrowseInfo.Product.ProductName);
            this.BindPromotionInfo();
            this.BindGuestProducts();
            DataTable dBConsultations = productPreSaleBrowseInfo.DBConsultations;

            for (int i = 0; i < dBConsultations.Rows.Count; i++)
            {
                dBConsultations.Rows[i]["UserName"] = DataHelper.GetHiddenUsername(dBConsultations.Rows[i]["UserName"].ToNullString());
            }
            this.rptProductConsultations.DataSource = dBConsultations;
            this.rptProductConsultations.DataBind();
            this.divConsultationEmpty.Visible = dBConsultations.IsNullOrEmpty();
            this.ulConsultations.Visible      = !dBConsultations.IsNullOrEmpty();
            return;

IL_0c63:
            if (HiContext.Current.SiteSettings.OpenReferral == 1)
            {
                num2 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0);
                goto IL_0c8a;
            }
            goto IL_0c89;
        }
        protected void btnDrawNext_Click(object sender, EventArgs e)
        {
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();
            decimal      num            = default(decimal);

            if (!decimal.TryParse(this.txtAmount.Text.Trim(), out num))
            {
                this.ShowMsg("提现金额输入错误,请重新输入提现金额", false);
            }
            else
            {
                SupplierInfo supplierById = SupplierHelper.GetSupplierById(HiContext.Current.Manager.StoreId);
                if (supplierById == null || num > supplierById.Balance)
                {
                    this.ShowMsg("余额不足,请重新输入提现金额", false);
                }
                else if (num < masterSettings.MinimumSingleShot || num < decimal.One)
                {
                    this.ShowMsg("请输入提现金额大于或者等于单次提现最小限额" + masterSettings.MinimumSingleShot + "元", false);
                }
                else if (string.IsNullOrEmpty(this.txtTradePassword.Text))
                {
                    this.ShowMsg("请输入交易密码", false);
                }
                else
                {
                    switch (SupplierHelper.ValidTradePassword(HiContext.Current.Manager.StoreId, this.txtTradePassword.Text))
                    {
                    case -1:
                        this.ShowMsg("请先设置交易密码!", false);
                        break;

                    case 0:
                        this.ShowMsg("交易密码不正确,请重新输入!", false);
                        break;

                    default:
                        if (!string.IsNullOrEmpty(this.txtRemark.Text) && this.txtRemark.Text.Length > 100)
                        {
                            this.ShowMsg("备注不能超过100个字", false);
                        }
                        else
                        {
                            SupplierBalanceDrawRequestInfo supplierBalanceDrawRequestInfo = new SupplierBalanceDrawRequestInfo();
                            supplierBalanceDrawRequestInfo.BankName       = this.txtBankName.Text.Trim();
                            supplierBalanceDrawRequestInfo.AccountName    = this.txtAccountName.Text.Trim();
                            supplierBalanceDrawRequestInfo.MerchantCode   = this.txtMerchantCode.Text.Trim();
                            supplierBalanceDrawRequestInfo.Amount         = num;
                            supplierBalanceDrawRequestInfo.Remark         = this.txtRemark.Text.Trim();
                            supplierBalanceDrawRequestInfo.SupplierId     = HiContext.Current.Manager.StoreId;
                            supplierBalanceDrawRequestInfo.IsAlipay       = this.IsAlipay.Checked;
                            supplierBalanceDrawRequestInfo.IsWeixin       = false;
                            supplierBalanceDrawRequestInfo.AlipayCode     = this.txtAlipayCode.Text.Trim();
                            supplierBalanceDrawRequestInfo.AlipayRealName = this.txtAlipayRealName.Text;
                            if (this.IsAlipay.Checked)
                            {
                                supplierBalanceDrawRequestInfo.BankName     = "0";
                                supplierBalanceDrawRequestInfo.AccountName  = "0";
                                supplierBalanceDrawRequestInfo.MerchantCode = "0";
                            }
                            else
                            {
                                supplierBalanceDrawRequestInfo.AlipayCode     = "0";
                                supplierBalanceDrawRequestInfo.AlipayRealName = "0";
                            }
                            this.Page.Response.Redirect($"RequestConfirm.aspx?bankName={Globals.UrlEncode(Globals.HtmlEncode(supplierBalanceDrawRequestInfo.BankName))}&accountName={Globals.UrlEncode(Globals.HtmlEncode(supplierBalanceDrawRequestInfo.AccountName))}&merchantCode={Globals.UrlEncode(Globals.HtmlEncode(supplierBalanceDrawRequestInfo.MerchantCode))}&amount={supplierBalanceDrawRequestInfo.Amount}&remark={Globals.UrlEncode(Globals.HtmlEncode(supplierBalanceDrawRequestInfo.Remark))}&isalipay={supplierBalanceDrawRequestInfo.IsAlipay}&alipaycode={Globals.UrlEncode(Globals.HtmlEncode(supplierBalanceDrawRequestInfo.AlipayCode))}&alipayrealname={Globals.UrlEncode(Globals.HtmlEncode(supplierBalanceDrawRequestInfo.AlipayRealName))}");
                        }
                        break;
                    }
                }
            }
        }
Example #18
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(base.GetParameter("PreSaleId", false), out this.preSaleId))
            {
                base.GotoResourceNotFound();
            }
            ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(this.preSaleId);

            if (productPreSaleInfo == null)
            {
                base.GotoResourceNotFound();
            }
            this.productId = productPreSaleInfo.ProductId;
            if (productPreSaleInfo.PreSaleEndDate < DateTime.Now)
            {
                this.Page.Response.Redirect("/ProductDetails.aspx?productId=" + this.productId);
                return;
            }
            this.hidSupName              = (HtmlInputHidden)this.FindControl("hidSupName");
            this.litSupplierName         = (Literal)this.FindControl("litSupplierName");
            this.hiddenpid               = (HtmlInputHidden)this.FindControl("hiddenpid");
            this.hidCartQuantity         = (HtmlInputHidden)this.FindControl("txCartQuantity");
            this.hiddenpid.Value         = this.productId.ToString();
            this.common_Location         = (Common_Location)this.FindControl("common_Location");
            this.litProductName          = (Literal)this.FindControl("litProductName");
            this.lblStock                = (StockLabel)this.FindControl("lblStock");
            this.litUnit                 = (Literal)this.FindControl("litUnit");
            this.litSaleCounts           = (Literal)this.FindControl("litSaleCounts");
            this.lblBuyPrice             = (Label)this.FindControl("lblBuyPrice");
            this.lblTotalPrice           = (TotalLabel)this.FindControl("lblTotalPrice");
            this.lblSku                  = (SkuLabel)this.FindControl("lblSku");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.litShortDescription     = (Literal)this.FindControl("litShortDescription");
            this.btnBuy                  = (BuyButton)this.FindControl("btnBuy");
            this.hpkProductConsultations = (HyperLink)this.FindControl("hpkProductConsultations");
            this.ltlSaleCount            = (Literal)this.FindControl("ltlSaleCount");
            this.ltlReviewCount          = (Literal)this.FindControl("ltlReviewCount");
            this.litReviewCount          = (Literal)this.FindControl("litReviewCount");
            this.ltlConsultation         = (Literal)this.FindControl("ltlConsultation");
            this.images                  = (Common_ProductImages)this.FindControl("common_ProductImages");
            this.rptExpandAttributes     = (ThemedTemplatedRepeater)this.FindControl("rptExpandAttributes");
            this.rptOnlineService        = (ThemedTemplatedRepeater)this.FindControl("rptOnlineService");
            this.skuSelector             = (SKUSelector)this.FindControl("SKUSelector");
            this.consultations           = (Common_ProductConsultations)this.FindControl("list_Common_ProductConsultations");
            this.correlative             = (Common_GoodsList_Correlative)this.FindControl("list_Common_GoodsList_Correlative");
            this.lbUserProductRefer      = (UserProductReferLabel)this.FindControl("lbUserProductRefer");
            this.hidden_skus             = (HtmlInputHidden)this.FindControl("hidden_skus");
            this.hidden_skuItem          = (HtmlInputHidden)this.FindControl("hidden_skuItem");
            this.hidIsOpenMultiStore     = (HtmlInputHidden)this.FindControl("hidIsOpenMultiStore");
            this.aCountDownUrl           = (HyperLink)this.FindControl("aCountDownUrl");
            this.imgQrCode               = (Image)this.FindControl("imgQrCode");
            this.hidden_productId        = (HtmlInputHidden)this.FindControl("hidden_productId");
            this.hidHasStores            = (HtmlInputHidden)this.FindControl("hidHasStores");
            this.divGift                 = (HtmlGenericControl)this.FindControl("divGift");
            this.ltlGiftName             = (Literal)this.FindControl("ltlGiftName");
            this.ltlGiftNum              = (Literal)this.FindControl("ltlGiftNum");
            this.aBrand                  = (HtmlAnchor)this.FindControl("aBrand");
            this.imgBrand                = (HiImage)this.FindControl("imgBrand");
            this.imgCustomerService      = (HtmlImage)this.FindControl("imgCustomerService");
            this.ltlOrderPromotion       = (Literal)this.FindControl("ltlOrderPromotion");
            this.divOrderPromotions      = (HtmlGenericControl)this.FindControl("divOrderPromotions");
            this.divOrderPromotions2     = (HtmlGenericControl)this.FindControl("divOrderPromotions2");
            this.divOrderPromotions4     = (HtmlGenericControl)this.FindControl("divOrderPromotions4");
            this.divOrderPromotions3     = (HtmlGenericControl)this.FindControl("divOrderPromotions3");
            this.ltlOrderPromotion_free  = (Literal)this.FindControl("ltlOrderPromotion_free");
            this.litPhonePrice           = (Literal)this.FindControl("litPhonePrice");
            this.litPhonePriceEndDate    = (Literal)this.FindControl("litPhonePriceEndDate");
            this.divCuxiao               = (HtmlGenericControl)this.FindControl("divCuxiao");
            this.ltlUnit                 = (Literal)this.FindControl("ltlUnit");
            this.divProductReferral      = (HtmlGenericControl)this.FindControl("divProductReferral");
            this.ltlProductSendGifts     = (Literal)this.FindControl("ltlProductSendGifts");
            this.ltlPromotionSendGifts   = (Literal)this.FindControl("ltlPromotionSendGifts");
            this.setDeliverRegion        = (Common_SetDeliveryRegion)this.FindControl("setDeliverRegion");
            this.divqq = (HtmlGenericControl)this.FindControl("divqq");
            this.lblPaymentStartDate    = (Label)this.FindControl("lblPaymentStartDate");
            this.lblPaymentEndDate      = (Label)this.FindControl("lblPaymentEndDate");
            this.lblDelivery            = (Label)this.FindControl("lblDelivery");
            this.lblDepositPercent      = (Label)this.FindControl("lblDepositPercent");
            this.lblDeposit             = (Label)this.FindControl("lblDeposit");
            this.lblFinalPaymentPercent = (Label)this.FindControl("lblFinalPaymentPercent");
            this.lblFinalPayment        = (Label)this.FindControl("lblFinalPayment");
            this.hidEndDate             = (HtmlInputHidden)this.FindControl("hidEndDate");
            this.hidNowDate             = (HtmlInputHidden)this.FindControl("hidNowDate");
            this.hidDepositPercent      = (HtmlInputHidden)this.FindControl("hidDepositPercent");
            this.hidDeposit             = (HtmlInputHidden)this.FindControl("hidDeposit");
            ThemedTemplatedRepeater themedTemplatedRepeater = (ThemedTemplatedRepeater)this.FindControl("rptOtherProducts");

            this.aCountDownUrl.Visible = false;
            if (this.Page.IsPostBack)
            {
                return;
            }
            if (this.imgQrCode != null)
            {
                string text = "/Storage/master/QRCode/" + HttpContext.Current.Request.Url.Host + "_" + this.productId + ".png";
                Globals.CreateQRCode(HttpContext.Current.Request.Url.ToString(), text, false, ImageFormats.Png);
                this.imgQrCode.ImageUrl = text;
            }
            ProductBrowseInfo productBrowseInfo = ProductBrowser.GetProductBrowseInfo(this.productId, null, this.sitesettings.OpenMultStore, -1);

            if (productBrowseInfo.Product == null || productBrowseInfo.Product.SaleStatus == ProductSaleStatus.Delete)
            {
                this.Page.Response.Redirect("/ProductDelete.aspx");
                return;
            }
            this.setDeliverRegion.ShippingTemplateId = productBrowseInfo.Product.ShippingTemplateId;
            this.setDeliverRegion.Volume             = productBrowseInfo.Product.Weight;
            this.setDeliverRegion.Weight             = productBrowseInfo.Product.Weight;
            this.ActivityBusiness();
            if (this.hidCartQuantity != null)
            {
                this.hidCartQuantity.Value = ShoppingCartProcessor.GetQuantity_Product(productBrowseInfo.Product.ProductId);
            }
            IEnumerable value = from item in productBrowseInfo.Product.Skus
                                select item.Value;

            if (JsonConvert.SerializeObject(productBrowseInfo.DbSKUs) != null)
            {
                this.hidden_skuItem.Value = JsonConvert.SerializeObject(productBrowseInfo.DbSKUs);
            }
            if (this.hidden_skus != null)
            {
                this.hidden_skus.Value = JsonConvert.SerializeObject(value);
            }
            if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.UnSale)
            {
                this.Page.Response.Redirect(base.GetRouteUrl("unproductdetails", new
                {
                    ProductId = this.productId
                }));
            }
            if (productBrowseInfo.Product.SaleStatus == ProductSaleStatus.OnStock)
            {
                this.Page.Response.Redirect("/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该商品已入库"));
                return;
            }
            this.hidden_productId.Value = this.productId.ToString();
            this.LoadPageSearch(productBrowseInfo.Product);
            if (this.lbUserProductRefer != null && this.sitesettings.OpenReferral == 1 && this.sitesettings.ShowDeductInProductPage)
            {
                this.lbUserProductRefer.product = productBrowseInfo.Product;
            }
            HyperLink hyperLink = this.hpkProductConsultations;
            int       num       = productBrowseInfo.ConsultationCount;

            hyperLink.Text = "查看全部" + num.ToString() + "条咨询";
            Literal literal = this.ltlConsultation;

            num          = productBrowseInfo.ConsultationCount;
            literal.Text = num.ToString();
            Literal literal2 = this.ltlSaleCount;

            num           = productBrowseInfo.SaleCount;
            literal2.Text = num.ToString();
            Literal literal3 = this.ltlReviewCount;

            num           = productBrowseInfo.ReviewCount;
            literal3.Text = num.ToString();
            Literal literal4 = this.litReviewCount;

            num           = productBrowseInfo.ReviewCount;
            literal4.Text = num.ToString();
            this.hpkProductConsultations.NavigateUrl = $"ProductConsultationsAndReplay.aspx?productId={this.productId}";
            this.LoadProductInfo(productBrowseInfo.Product, productBrowseInfo.BrandName);
            HtmlInputHidden htmlInputHidden = this.hidNowDate;
            DateTime        dateTime        = DateTime.Now;

            htmlInputHidden.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            HtmlInputHidden htmlInputHidden2 = this.hidEndDate;

            dateTime = productPreSaleInfo.PreSaleEndDate;
            htmlInputHidden2.Value = dateTime.ToString("yyyy-MM-dd HH:mm:ss");
            Label label = this.lblPaymentStartDate;

            dateTime   = productPreSaleInfo.PaymentStartDate;
            label.Text = dateTime.ToString("yyyy.MM.dd");
            Label label2 = this.lblPaymentEndDate;

            dateTime    = productPreSaleInfo.PaymentEndDate;
            label2.Text = dateTime.ToString("yyyy.MM.dd");
            Label  label3 = this.lblDelivery;
            object text2;

            if (productPreSaleInfo.DeliveryDays <= 0)
            {
                dateTime = productPreSaleInfo.DeliveryDate.Value;
                text2    = dateTime.ToString("yyyy.MM.dd") + "前发货";
            }
            else
            {
                text2 = "尾款支付后" + productPreSaleInfo.DeliveryDays + "天发货";
            }
            label3.Text = (string)text2;
            decimal d;

            if (productPreSaleInfo.DepositPercent > 0)
            {
                this.lblDepositPercent.Text      = "定金:" + productPreSaleInfo.DepositPercent + "%";
                this.lblFinalPaymentPercent.Text = "尾款:" + (100 - productPreSaleInfo.DepositPercent) + "%";
                decimal num2 = Math.Round(productBrowseInfo.Product.MinSalePrice * (decimal)productPreSaleInfo.DepositPercent / 100m, 2);
                this.lblDeposit.Text      = "¥" + num2;
                this.lblFinalPayment.Text = "¥" + Math.Round(productBrowseInfo.Product.MinSalePrice - num2, 2);
                HtmlInputHidden htmlInputHidden3 = this.hidDepositPercent;
                num = productPreSaleInfo.DepositPercent;
                htmlInputHidden3.Value = num.ToString();
            }
            else
            {
                this.lblDeposit.Text      = "定金:¥" + productPreSaleInfo.Deposit;
                this.lblFinalPayment.Text = "尾款:¥" + Math.Round(productBrowseInfo.Product.MinSalePrice - productPreSaleInfo.Deposit, 2);
                HtmlInputHidden htmlInputHidden4 = this.hidDeposit;
                d = productPreSaleInfo.Deposit;
                htmlInputHidden4.Value = d.ToString();
            }
            this.btnBuy.Stock  = (this.sitesettings.OpenMultStore ? productBrowseInfo.Product.DefaultSku.MaxStock : productBrowseInfo.Product.Stock);
            this.ltlUnit.Text  = productBrowseInfo.Product.Unit;
            this.divqq.Visible = (this.sitesettings.ServiceIsOpen == "1");
            MemberInfo user = HiContext.Current.User;

            if (user != null && user.IsReferral() && (!(this.sitesettings.SubMemberDeduct <= decimal.Zero) || productBrowseInfo.Product.SubMemberDeduct.HasValue))
            {
                if (!productBrowseInfo.Product.SubMemberDeduct.HasValue)
                {
                    goto IL_0d79;
                }
                decimal?subMemberDeduct = productBrowseInfo.Product.SubMemberDeduct;
                d = default(decimal);
                if (!(subMemberDeduct.GetValueOrDefault() <= d) || !subMemberDeduct.HasValue)
                {
                    goto IL_0d79;
                }
            }
            goto IL_0d9f;
IL_0da0:
            int num3;

            if (num3 != 0)
            {
                this.divProductReferral.Visible = false;
            }
            BrowsedProductQueue.EnQueue(this.productId);
            this.images.ImageInfo = productBrowseInfo.Product;
            if (productBrowseInfo.DbAttribute != null)
            {
                this.rptExpandAttributes.DataSource = productBrowseInfo.DbAttribute;
                this.rptExpandAttributes.DataBind();
            }
            if (productBrowseInfo.DbSKUs != null)
            {
                this.skuSelector.ProductId  = this.productId;
                this.skuSelector.DataSource = productBrowseInfo.DbSKUs;
            }
            if (productBrowseInfo.Product.BrandId.HasValue)
            {
                BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value);
                if (brandCategory != null && !string.IsNullOrEmpty(brandCategory.Logo))
                {
                    this.imgBrand.ImageUrl = brandCategory.Logo;
                    this.aBrand.HRef       = base.GetRouteUrl("branddetails", new
                    {
                        brandId = brandCategory.BrandId
                    });
                }
            }
            int supplierId = productBrowseInfo.Product.SupplierId;

            if (supplierId > 0)
            {
                SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId);
                if (!string.IsNullOrEmpty(supplierById.Picture))
                {
                    this.imgBrand.ImageUrl = supplierById.Picture;
                }
                else if (productBrowseInfo.Product.BrandId.HasValue)
                {
                    BrandCategoryInfo brandCategory2 = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value);
                    if (brandCategory2 != null && !string.IsNullOrEmpty(brandCategory2.Logo))
                    {
                        this.imgBrand.ImageUrl = brandCategory2.Logo;
                        this.aBrand.HRef       = base.GetRouteUrl("branddetails", new
                        {
                            brandId = brandCategory2.BrandId
                        });
                    }
                }
                else
                {
                    this.imgBrand.Visible = false;
                }
                this.litSupplierName.Text = supplierById.SupplierName;
                this.hidSupName.Value     = supplierById.SupplierName;
            }
            else
            {
                this.litSupplierName.Visible = false;
                if (productBrowseInfo.Product.BrandId.HasValue)
                {
                    BrandCategoryInfo brandCategory3 = CatalogHelper.GetBrandCategory(productBrowseInfo.Product.BrandId.Value);
                    if (brandCategory3 != null && !string.IsNullOrEmpty(brandCategory3.Logo))
                    {
                        this.imgBrand.ImageUrl = brandCategory3.Logo;
                        this.aBrand.HRef       = base.GetRouteUrl("branddetails", new
                        {
                            brandId = brandCategory3.BrandId
                        });
                    }
                }
            }
            if (productBrowseInfo.DBConsultations != null)
            {
                this.consultations.DataSource = productBrowseInfo.DBConsultations;
                this.consultations.DataBind();
            }
            if (productBrowseInfo.DbCorrelatives != null)
            {
                this.correlative.DataSource = productBrowseInfo.DbCorrelatives;
                this.correlative.DataBind();
            }
            this.BindOrderPromotions();
            if (!this.divOrderPromotions.Visible && !this.divOrderPromotions2.Visible && !this.divOrderPromotions3.Visible)
            {
                this.divCuxiao.Style.Add("display", "none");
            }
            if (this.rptOnlineService != null)
            {
                IList <OnlineServiceInfo> allOnlineService  = OnlineServiceHelper.GetAllOnlineService(0, 1);
                IList <OnlineServiceInfo> allOnlineService2 = OnlineServiceHelper.GetAllOnlineService(0, 2);
                if (allOnlineService2 != null)
                {
                    foreach (OnlineServiceInfo item in allOnlineService2)
                    {
                        allOnlineService.Add(item);
                    }
                }
                this.rptOnlineService.DataSource = allOnlineService;
                this.rptOnlineService.DataBind();
            }
            return;

IL_0d9f:
            num3 = 1;
            goto IL_0da0;
IL_0d79:
            if (HiContext.Current.SiteSettings.OpenReferral == 1)
            {
                num3 = ((!HiContext.Current.SiteSettings.ShowDeductInProductPage) ? 1 : 0);
                goto IL_0da0;
            }
            goto IL_0d9f;
        }
Example #19
0
        private void BindSalePassTip()
        {
            SupplierInfo supplierById = SupplierHelper.GetSupplierById(HiContext.Current.Manager.StoreId);

            this.ltistradepass.Text = (string.IsNullOrEmpty(supplierById.TradePassword) ? "0" : "1");
        }
        protected override void AttachChildControls()
        {
            this.hidSupplier             = (HtmlInputHidden)this.FindControl("hidSupplier");
            this.litSupplierName         = (Literal)this.FindControl("litSupplierName");
            this.divConsultationEmpty    = (HtmlGenericControl)this.FindControl("divConsultationEmpty");
            this.rptProductConsultations = (WapTemplatedRepeater)this.FindControl("rptProductConsultations");
            this.fightGroupRule          = (Common_FightGroupRule)this.FindControl("fightGroupRule");
            this.litDescription          = (Literal)this.FindControl("litDescription");
            this.litConsultationsCount   = (Literal)this.FindControl("litConsultationsCount");
            this.rptProductImages        = (WapTemplatedRepeater)this.FindControl("rptProductImages");
            this.divFightGroupsHead      = (HtmlControl)this.FindControl("divFightGroupsHead");
            this.skuSubmitOrder          = (Common_SKUSubmitOrder)this.FindControl("skuSubmitOrder");
            this.fightGroupActivityId    = this.Page.Request["fightGroupActivityId"].ToInt(0);
            this.litJoinNumber           = (Literal)this.FindControl("litJoinNumber");
            this.litLimitedHour          = (Literal)this.FindControl("litLimitedHour");
            this.litEndDate            = (Literal)this.FindControl("litEndDate");
            this.litProductName        = (Literal)this.FindControl("litProductName");
            this.litFGAPrice           = (Literal)this.FindControl("litFGAPrice");
            this.litPPrice             = (Literal)this.FindControl("litPPrice");
            this.litProductReviewCount = (Literal)this.FindControl("litProductReviewCount");
            this.imgEnd          = (Image)this.FindControl("imgEnd");
            this.hlProductReview = (HyperLink)this.FindControl("hlProductReview");
            this.rptFightGroups  = (WapTemplatedRepeater)this.FindControl("rptFightGroups");
            this.litMinPrice     = (Literal)this.FindControl("litMinPrice");
            this.litProductPrice = (Literal)this.FindControl("litProductPrice");
            this.lblStock        = (StockLabel)this.FindControl("lblStock");
            this.litUnit         = (Literal)this.FindControl("litUnit");
            this.divGetBySelf    = (HtmlControl)this.FindControl("divGetBySelf");
            this.hiddenProductId = (HtmlInputText)this.FindControl("hiddenProductId");
            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");
            FightGroupActivityInfo fightGroupActivitieInfo = TradeHelper.GetFightGroupActivitieInfo(this.fightGroupActivityId);

            if (fightGroupActivitieInfo != null)
            {
                HtmlInputText htmlInputText = this.hiddenProductId;
                int           num           = fightGroupActivitieInfo.ProductId;
                htmlInputText.Value = num.ToString();
                this.fightGroupRule.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId;
                if (fightGroupActivitieInfo.StartDate > DateTime.Now)
                {
                    this.Page.Response.Redirect("FightGroupActivityDetailsSoon.aspx?fightGroupActivityId=" + this.fightGroupActivityId);
                }
                SiteSettings masterSettings = SettingsManager.GetMasterSettings();
                if (masterSettings.OpenMultStore && StoresHelper.ProductHasStores(fightGroupActivitieInfo.ProductId))
                {
                    this.divGetBySelf.Visible = true;
                }
                this.skuSubmitOrder.FightGroupActivityId = fightGroupActivitieInfo.FightGroupActivityId;
                IList <FightGroupSkuInfo> fightGroupSkus = VShopHelper.GetFightGroupSkus(this.fightGroupActivityId);
                this.hlProductReview.NavigateUrl = $"/vshop/ProductReview.aspx?ProductId={fightGroupActivitieInfo.ProductId}";
                this.imgEnd.Visible = (fightGroupActivitieInfo.EndDate < DateTime.Now);
                Literal literal = this.litJoinNumber;
                num          = fightGroupActivitieInfo.JoinNumber;
                literal.Text = num.ToString();
                Literal literal2 = this.litLimitedHour;
                num                      = fightGroupActivitieInfo.LimitedHour;
                literal2.Text            = num.ToString();
                this.litEndDate.Text     = fightGroupActivitieInfo.EndDate.ToString("yy.MM.dd");
                this.litProductName.Text = fightGroupActivitieInfo.ProductName;
                decimal num2 = fightGroupSkus.Min((FightGroupSkuInfo c) => c.SalePrice);
                this.litFGAPrice.Text = num2.F2ToString("f2");
                if (fightGroupSkus.Count() > 1)
                {
                    decimal num3 = fightGroupSkus.Max((FightGroupSkuInfo c) => c.SalePrice);
                    if (num3 > num2)
                    {
                        this.litFGAPrice.Text = num2.F2ToString("f2") + "~" + num3.F2ToString("f2");
                    }
                }
                this.litMinPrice.Text = num2.F2ToString("f2");
                IList <int> list = null;
                Dictionary <int, IList <int> > dictionary = default(Dictionary <int, IList <int> >);
                ProductInfo productDetails = ProductHelper.GetProductDetails(fightGroupActivitieInfo.ProductId, out dictionary, out list);
                if (productDetails != null)
                {
                    this.skuSubmitOrder.ProductInfo = productDetails;
                    this.litPPrice.Text             = MemberProcessor.GetMemberPrice(productDetails).F2ToString("f2");
                    this.litProductPrice.Text       = this.litPPrice.Text;
                }
                int supplierId = productDetails.SupplierId;
                if (supplierId > 0)
                {
                    SupplierInfo supplierById = SupplierHelper.GetSupplierById(supplierId);
                    if (supplierById != null)
                    {
                        this.hidSupplier.Value    = "true";
                        this.litSupplierName.Text = supplierById.SupplierName;
                    }
                }
                else
                {
                    this.hidSupplier.Value = "false";
                }
                Literal literal3 = this.litProductReviewCount;
                num = ProductBrowser.GetProductReviews(new ProductReviewQuery
                {
                    PageIndex = 1,
                    PageSize  = 2147483647,
                    ProductId = fightGroupActivitieInfo.ProductId
                }).TotalRecords;
                literal3.Text = num.ToString();
                DataTable fightGroups = VShopHelper.GetFightGroups(this.fightGroupActivityId);
                for (int i = 0; i < fightGroups.Rows.Count; i++)
                {
                    fightGroups.Rows[i]["Name"] = DataHelper.GetHiddenUsername(fightGroups.Rows[i]["Name"].ToString());
                }
                this.divFightGroupsHead.Visible = (fightGroups.Rows.Count > 0);
                this.rptFightGroups.DataSource  = fightGroups;
                this.rptFightGroups.DataBind();
                this.hdAppId.Value = base.site.WeixinAppId;
                if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareTitle))
                {
                    this.hdTitle.Value = (string.IsNullOrEmpty(productDetails.Title) ? productDetails.ProductName : productDetails.Title);
                }
                else
                {
                    this.hdTitle.Value = fightGroupActivitieInfo.ShareTitle.Trim();
                }
                if (string.IsNullOrEmpty(fightGroupActivitieInfo.ShareContent.Trim()))
                {
                    this.hdDesc.Value = productDetails.Meta_Description;
                }
                else
                {
                    this.hdDesc.Value = fightGroupActivitieInfo.ShareContent.Trim();
                }
                string local = string.IsNullOrEmpty(fightGroupActivitieInfo.Icon) ? SettingsManager.GetMasterSettings().DefaultProductImage : fightGroupActivitieInfo.Icon;
                this.hdImgUrl.Value = Globals.FullPath(local);
                this.hdLink.Value   = Globals.FullPath(this.Page.Request.Url.ToString());
                if (this.rptProductImages != null)
                {
                    string locationUrl = "javascript:;";
                    if (string.IsNullOrEmpty(productDetails.ImageUrl1) && string.IsNullOrEmpty(productDetails.ImageUrl2) && string.IsNullOrEmpty(productDetails.ImageUrl3) && string.IsNullOrEmpty(productDetails.ImageUrl4) && string.IsNullOrEmpty(productDetails.ImageUrl5))
                    {
                        productDetails.ImageUrl1 = masterSettings.DefaultProductImage;
                    }
                    DataTable         skus  = ProductBrowser.GetSkus(fightGroupActivitieInfo.ProductId);
                    List <SlideImage> list2 = new List <SlideImage>();
                    list2.Add(new SlideImage(productDetails.ImageUrl1, locationUrl));
                    list2.Add(new SlideImage(productDetails.ImageUrl2, locationUrl));
                    list2.Add(new SlideImage(productDetails.ImageUrl3, locationUrl));
                    list2.Add(new SlideImage(productDetails.ImageUrl4, locationUrl));
                    list2.Add(new SlideImage(productDetails.ImageUrl5, locationUrl));
                    this.rptProductImages.DataSource = from item in list2
                                                       where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                       select item;
                    this.rptProductImages.DataBind();
                    Literal control = this.litConsultationsCount;
                    num = ProductBrowser.GetProductConsultationsCount(productDetails.ProductId, false);
                    control.SetWhenIsNotNull(num.ToString());
                    if (this.litDescription != null)
                    {
                        string text  = "";
                        Regex  regex = new Regex("<script[^>]*?>.*?</script>", RegexOptions.IgnoreCase);
                        if (!string.IsNullOrWhiteSpace(productDetails.MobbileDescription))
                        {
                            text = regex.Replace(productDetails.MobbileDescription, "");
                        }
                        else if (!string.IsNullOrWhiteSpace(productDetails.Description))
                        {
                            text = regex.Replace(productDetails.Description, "");
                        }
                        text = text.Replace("src", "data-url");
                        this.litDescription.Text = text;
                    }
                    DataTable data = ProductBrowser.GetProductConsultations(new ProductConsultationAndReplyQuery
                    {
                        ProductId  = productDetails.ProductId,
                        PageIndex  = 1,
                        PageSize   = 2147483647,
                        SortOrder  = SortAction.Desc,
                        SortBy     = "ConsultationId",
                        HasReplied = true
                    }).Data;
                    for (int j = 0; j < data.Rows.Count; j++)
                    {
                        data.Rows[j]["UserName"] = DataHelper.GetHiddenUsername(data.Rows[j]["UserName"].ToNullString());
                    }
                    this.rptProductConsultations.DataSource = data;
                    this.rptProductConsultations.DataBind();
                    this.divConsultationEmpty.Visible = data.IsNullOrEmpty();
                }
            }
            else
            {
                base.GotoResourceNotFound("活动不存在");
            }
        }