Esempio n. 1
0
        protected override void AttachChildControls()
        {
            this.orderId           = this.Page.Request.QueryString["orderId"];
            this.litShipTo         = (Literal)this.FindControl("litShipTo");
            this.litPhone          = (Literal)this.FindControl("litPhone");
            this.litAddress        = (Literal)this.FindControl("litAddress");
            this.litOrderId        = (Literal)this.FindControl("litOrderId");
            this.litOrderDate      = (Literal)this.FindControl("litOrderDate");
            this.litOrderStatus    = (OrderStatusLabel)this.FindControl("litOrderStatus");
            this.rptOrderProducts  = (VshopTemplatedRepeater)this.FindControl("rptOrderProducts");
            this.litTotalPrice     = (Literal)this.FindControl("litTotalPrice");
            this.litPayTime        = (Literal)this.FindControl("litPayTime");
            this.hlinkGetRedPager  = (HyperLink)this.FindControl("hlinkGetRedPager");
            this.orderStatus       = (HtmlInputHidden)this.FindControl("orderStatus");
            this.txtOrderId        = (HtmlInputHidden)this.FindControl("txtOrderId");
            this.litRemark         = (Literal)this.FindControl("litRemark");
            this.litShipToDate     = (Literal)this.FindControl("litShipToDate");
            this.litShippingCost   = (Literal)this.FindControl("litShippingCost");
            this.litCounponPrice   = (Literal)this.FindControl("litCounponPrice");
            this.litRedPagerAmount = (Literal)this.FindControl("litRedPagerAmount");
            this.litExemption      = (Literal)this.FindControl("litExemption");
            this.litPointToCash    = (Literal)this.FindControl("litPointToCash");
            this.litBuildPrice     = (Literal)this.FindControl("litBuildPrice");
            this.litDisCountPrice  = (Literal)this.FindControl("litDisCountPrice");
            this.litActualPrice    = (Literal)this.FindControl("litActualPrice");
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(this.orderId);

            if (orderInfo == null)
            {
                base.GotoResourceNotFound("此订单已不存在");
            }
            this.litShipTo.Text  = orderInfo.ShipTo;
            this.litPhone.Text   = orderInfo.CellPhone;
            this.litAddress.Text = orderInfo.ShippingRegion + orderInfo.Address;
            if (orderInfo.BargainDetialId > 0)
            {
                this.litOrderId.Text = this.orderId + "<span class='text-danger'> 【砍价】</span>";
            }
            else
            {
                this.litOrderId.Text = this.orderId;
            }
            this.litOrderDate.Text = orderInfo.OrderDate.ToString();
            this.litTotalPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
            this.litOrderStatus.OrderStatusCode = orderInfo.OrderStatus;
            this.litOrderStatus.Gateway         = orderInfo.Gateway;
            this.litPayTime.SetWhenIsNotNull(orderInfo.PayDate.HasValue ? orderInfo.PayDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "");
            OrderRedPagerInfo orderRedPagerInfo = OrderRedPagerBrower.GetOrderRedPagerInfo(this.orderId);

            if ((orderRedPagerInfo != null) && (orderRedPagerInfo.MaxGetTimes > orderRedPagerInfo.AlreadyGetTimes))
            {
                this.hlinkGetRedPager.NavigateUrl = "/vshop/GetRedShare.aspx?orderid=" + this.orderId;
                this.hlinkGetRedPager.Visible     = true;
            }
            this.orderStatus.SetWhenIsNotNull(((int)orderInfo.OrderStatus).ToString());
            this.txtOrderId.SetWhenIsNotNull(this.orderId.ToString());
            decimal couponValue = 0M;

            couponValue = orderInfo.CouponValue;
            if (couponValue > 0M)
            {
                this.litCounponPrice.Text = "-\x00a5" + couponValue.ToString("F2");
            }
            else
            {
                this.litCounponPrice.Text = " \x00a5" + couponValue.ToString("F2").Trim(new char[] { '-' });
            }
            couponValue = orderInfo.RedPagerAmount;
            if (couponValue > 0M)
            {
                this.litRedPagerAmount.Text = "<div><span class=\"span-r-80\">代金券抵扣:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            couponValue = orderInfo.GetAdjustCommssion();
            if (couponValue > 0M)
            {
                this.litDisCountPrice.Text = "<div><span class=\"span-r-80\">价格调整:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            else
            {
                this.litDisCountPrice.Text = "<div><span class=\"span-r-80\">价格调整:</span> &nbsp;\x00a5" + couponValue.ToString("F2").Trim(new char[] { '-' }) + "</div>";
            }
            couponValue = orderInfo.PointToCash;
            if (couponValue > 0M)
            {
                this.litPointToCash.Text = "<div><span class=\"span-r-80\">积分抵现:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            couponValue = orderInfo.DiscountAmount;
            if (couponValue > 0M)
            {
                this.litExemption.Text = "<div><span class=\"span-r-80\">优惠减免:</span>- \x00a5" + couponValue.ToString("F2") + "</div>";
            }
            this.litShippingCost.Text = orderInfo.AdjustedFreight.ToString("F2");
            this.litShipToDate.SetWhenIsNotNull(orderInfo.ShipToDate);
            this.litBuildPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
            this.litActualPrice.SetWhenIsNotNull(orderInfo.TotalPrice.ToString("F2"));
            this.litRemark.SetWhenIsNotNull(orderInfo.Remark);
            this.rptOrderProducts.DataSource = orderInfo.LineItems.Values;
            this.rptOrderProducts.DataBind();
            PageTitle.AddSiteNameTitle("订单详情");
        }
Esempio n. 2
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("会员中心");
            Member member = HiContext.Current.User as Member;

            if (member == null)
            {
                this.Page.Response.Redirect("/Vshop/Login.aspx");
            }
            this.litUserLink       = (System.Web.UI.WebControls.Literal) this.FindControl("litUserLink");
            this.litUserName       = (System.Web.UI.WebControls.Literal) this.FindControl("litUserName");
            this.litPaymentBalance = (System.Web.UI.WebControls.Literal) this.FindControl("litPaymentBalance");
            this.litExpenditure    = (System.Web.UI.WebControls.Literal) this.FindControl("litExpenditure");
            this.litExpenditure.SetWhenIsNotNull(member.Expenditure.ToString("F2"));
            this.litPaymentBalance.SetWhenIsNotNull(member.Balance.ToString("F2"));
            this.litPoints         = (System.Web.UI.WebControls.Literal) this.FindControl("litPoints");
            this.referralLink      = (System.Web.UI.WebControls.HyperLink) this.FindControl("referralLink");
            this.bindAccountLink   = (System.Web.UI.WebControls.HyperLink) this.FindControl("bindAccountLink");
            this.litAllOrderCount  = (System.Web.UI.WebControls.Literal) this.FindControl("litAllOrderCount");
            this.litRefundCount    = (System.Web.UI.WebControls.Literal) this.FindControl("litRefundCount");
            this.litReturnCount    = (System.Web.UI.WebControls.Literal) this.FindControl("litReturnCount");
            this.litReplaceCount   = (System.Web.UI.WebControls.Literal) this.FindControl("litReplaceCount");
            this.switchAccountLink = (System.Web.UI.WebControls.HyperLink) this.FindControl("switchAccountLink");
            this.litCoupons        = (System.Web.UI.WebControls.Literal) this.FindControl("litCoupons");
            this.litVoucher        = (System.Web.UI.WebControls.Literal) this.FindControl("litVoucher");
            this.litBindPhone      = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("litBindPhone");
            Regex regMobile = new Regex("^(13|14|15|17|18)\\d{9}$");

            if (!regMobile.IsMatch(member.Username))
            {
                this.litBindPhone.Visible = true;
            }
            else
            {
                this.litBindPhone.Visible = false;
            }
            if (this.litPoints != null)
            {
                this.litPoints.SetWhenIsNotNull(member.Points.ToString("F2"));
            }
            this.litMemberGrade = (System.Web.UI.WebControls.Literal) this.FindControl("litMemberGrade");
            MemberGradeInfo memberGrade = MemberProcessor.GetMemberGrade(member.GradeId);

            if (memberGrade != null)
            {
                this.litMemberGrade.SetWhenIsNotNull(memberGrade.Name);
            }
            this.litUserName.Text       = (string.IsNullOrEmpty(member.RealName) ? member.Username : member.RealName);
            this.litWaitForRecieveCount = (System.Web.UI.WebControls.Literal) this.FindControl("litWaitForRecieveCount");
            this.litWaitForPayCount     = (System.Web.UI.WebControls.Literal) this.FindControl("litWaitForPayCount");
            OrderQuery orderQuery = new OrderQuery();

            orderQuery.Status = OrderStatus.WaitBuyerPay;
            int userOrderCount = MemberProcessor.GetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            //
            HttpCookie httpCookieMember = new HttpCookie("wait");

            httpCookieMember.Value   = userOrderCount.ToString();
            httpCookieMember.Expires = System.DateTime.Now.AddYears(1);
            HttpContext.Current.Response.Cookies.Add(httpCookieMember);

            #region 处理cookie中的购物车和收藏信息
            Member curMember = HiContext.Current.User as Member;
            if (curMember != null && !curMember.IsAnonymous)
            {
                //修改TopRegionId
                if (curMember.TopRegionId == 0)
                {
                    long ip = 0;
                    try
                    {
                        ip = Globals.IpToInt(Globals.IPAddress);
                    }
                    catch
                    {
                    }
                    if (ip != 0)
                    {
                        string provinceName = TradeHelper.GetProvinceName(ip);
                        int    ProvinceId   = 0;
                        if (!string.IsNullOrEmpty(provinceName))
                        {
                            provinceName = provinceName.Replace("市", "");
                            ProvinceId   = RegionHelper.GetProvinceId(provinceName);
                            ErrorLog.Write(string.Format("更新会员的ProvinceId:{0}", ProvinceId));
                            if (ProvinceId != 0)
                            {
                                UserHelper.UpdateUserTopRegionId(curMember.UserId, ProvinceId);
                            }
                        }
                    }
                }
                //
                ShoppingCartInfo cookieShoppingCart = ShoppingCartProcessor.GetCookieShoppingCart();
                if (cookieShoppingCart != null)
                {
                    ShoppingCartProcessor.ConvertShoppingCartToDataBase(cookieShoppingCart);
                    ShoppingCartProcessor.ClearCookieShoppingCart();
                }

                System.Web.HttpCookie cookieFavorite = HiContext.Current.Context.Request.Cookies["Hid_Ecshop_Favorite_Data_New"];
                if (cookieFavorite != null && !string.IsNullOrEmpty(cookieFavorite.Value))
                {
                    string[] favoriteProductIds = cookieFavorite.Value.Split('|');
                    int      productId          = 0;
                    foreach (string fav in favoriteProductIds)
                    {
                        try
                        {
                            productId = int.Parse(fav);
                            int favoriteId;
                            ProductBrowser.AddProductToFavorite(productId, curMember.UserId, out favoriteId);
                        }
                        catch
                        {
                            continue;
                        }
                    }
                    cookieFavorite.Expires = DateTime.Now.AddDays(-1);
                    HttpContext.Current.Response.Cookies.Add(cookieFavorite);
                }
            }
            #endregion

            //购物车商品数量
            ShoppingCartInfo shoppingCart = ShoppingCartProcessor.GetShoppingCart();
            string           quantity     = "0";
            if (shoppingCart != null)
            {
                quantity = shoppingCart.GetQuantity().ToString();
            }
            HttpCookie httpCookieShoppingCart = new HttpCookie("cn");
            httpCookieShoppingCart.Value   = quantity;
            httpCookieShoppingCart.Expires = System.DateTime.Now.AddYears(1);
            HttpContext.Current.Response.Cookies.Add(httpCookieShoppingCart);

            this.litWaitForPayCount.SetWhenIsNotNull(userOrderCount.ToString());
            orderQuery.Status = OrderStatus.SellerAlreadySent;
            userOrderCount    = MemberProcessor.GetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litWaitForRecieveCount.SetWhenIsNotNull(userOrderCount.ToString());
            //
            orderQuery.Status = OrderStatus.All;
            userOrderCount    = MemberProcessor.GetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litAllOrderCount.SetWhenIsNotNull(userOrderCount.ToString());

            userOrderCount = MemberProcessor.GetRefundCount(HiContext.Current.User.UserId);
            this.litRefundCount.SetWhenIsNotNull(userOrderCount.ToString());
            userOrderCount = MemberProcessor.GetReturnCount(HiContext.Current.User.UserId);
            this.litReturnCount.SetWhenIsNotNull(userOrderCount.ToString());
            userOrderCount = MemberProcessor.GetReplaceCount(HiContext.Current.User.UserId);
            this.litReplaceCount.SetWhenIsNotNull(userOrderCount.ToString());

            int UserNotReadCoupons = MemberProcessor.GetUserNotReadCoupons(HiContext.Current.User.UserId);
            this.litCoupons.SetWhenIsNotNull(UserNotReadCoupons.ToString());

            int UserNotReadlitVoucher = MemberProcessor.GetUserNotReadVoucher(HiContext.Current.User.UserId);
            if (this.litVoucher != null)
            {
                this.litVoucher.SetWhenIsNotNull(UserNotReadlitVoucher.ToString());
            }

            if (this.litUserLink != null)
            {
                System.Uri url  = System.Web.HttpContext.Current.Request.Url;
                string     text = (url.Port == 80) ? string.Empty : (":" + url.Port.ToString(System.Globalization.CultureInfo.InvariantCulture));
                this.litUserLink.Text = string.Concat(new object[]
                {
                    string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}://{1}{2}", new object[]
                    {
                        url.Scheme,
                        url.Host,
                        text
                    }),
                    Globals.ApplicationPath,
                    "/VShop/?ReferralUserId=",
                    HiContext.Current.User.UserId
                });
            }
            if (this.referralLink != null)
            {
                this.referralLink.CssClass = "list-group-item";
                if (member.ReferralStatus == 0 || member.ReferralStatus == 1 || member.ReferralStatus == 3)
                {
                    this.referralLink.Text = "申请成为推广员";
                    if (member.ReferralStatus == 1 || member.ReferralStatus == 3)
                    {
                        this.referralLink.NavigateUrl = "/VShop/ReferralRegisterresults.aspx";
                    }
                    else
                    {
                        this.referralLink.NavigateUrl = "/VShop/ReferralRegisterAgreement.aspx";
                    }
                }
                if (member.ReferralStatus == 2)
                {
                    this.referralLink.Text        = "推广员";
                    this.referralLink.NavigateUrl = "/VShop/Referral.aspx";
                }
            }

            if (bindAccountLink != null)
            {
                this.bindAccountLink.CssClass    = "list-group-item";
                this.bindAccountLink.Text        = "绑定PC端会员帐号";
                this.bindAccountLink.NavigateUrl = "/VShop/BindPCAccount.aspx";
            }

            int    totalCount = 0;
            string opernId    = member.OpenId;
            if (!string.IsNullOrEmpty(opernId))
            {
                totalCount = UserHelper.GetToalCountByOpenId(opernId);
            }

            if (switchAccountLink != null && totalCount >= 2)
            {
                this.switchAccountLink.CssClass    = "list-group-item";
                this.switchAccountLink.Text        = "切换帐号";
                this.switchAccountLink.NavigateUrl = "/VShop/SwitchAccount.aspx";
            }
        }
Esempio n. 3
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["AfficheId"], out this.affichesId))
     {
         base.GotoResourceNotFound();
     }
     this.litAffichesAddedDate = (FormatedTimeLabel)this.FindControl("litAffichesAddedDate");
     this.litContent           = (System.Web.UI.WebControls.Literal) this.FindControl("litContent");
     this.litTilte             = (System.Web.UI.WebControls.Literal) this.FindControl("litTilte");
     this.lblFront             = (System.Web.UI.WebControls.Label) this.FindControl("lblFront");
     this.lblNext       = (System.Web.UI.WebControls.Label) this.FindControl("lblNext");
     this.aFront        = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front");
     this.aNext         = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next");
     this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle");
     this.lblNextTitle  = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle");
     if (!this.Page.IsPostBack)
     {
         AfficheInfo affiche = CommentBrowser.GetAffiche(this.affichesId);
         if (affiche != null)
         {
             PageTitle.AddSiteNameTitle(affiche.Title);
             this.litTilte.Text = affiche.Title;
             string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("AffichesDetails", new object[]
             {
                 this.affichesId
             });
             this.litContent.Text           = affiche.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litAffichesAddedDate.Time = affiche.AddedDate;
             AfficheInfo frontOrNextAffiche  = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Front");
             AfficheInfo frontOrNextAffiche2 = CommentBrowser.GetFrontOrNextAffiche(this.affichesId, "Next");
             if (frontOrNextAffiche != null && frontOrNextAffiche.AfficheId > 0)
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible   = true;
                     this.aFront.HRef        = "AffichesDetails.aspx?afficheId=" + frontOrNextAffiche.AfficheId;
                     this.lblFrontTitle.Text = frontOrNextAffiche.Title;
                 }
             }
             else
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible = false;
                 }
             }
             if (frontOrNextAffiche2 != null && frontOrNextAffiche2.AfficheId > 0)
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible   = true;
                     this.aNext.HRef        = "AffichesDetails.aspx?afficheId=" + frontOrNextAffiche2.AfficheId;
                     this.lblNextTitle.Text = frontOrNextAffiche2.Title;
                     return;
                 }
             }
             else
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible = false;
                 }
             }
         }
     }
 }
Esempio n. 4
0
        protected override void AttachChildControls()
        {
            DistributorsInfo nowCurrentDistributors = DistributorsBrower.GetNowCurrentDistributors(Globals.GetCurrentMemberUserId());
            MemberInfo       currentMember          = MemberProcessor.GetCurrentMember();

            if (nowCurrentDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                PageTitle.AddSiteNameTitle("申请提现");
                this.accoutType  = (System.Web.UI.HtmlControls.HtmlSelect) this.FindControl("accoutType");
                this.litmaxmoney = (System.Web.UI.WebControls.Literal) this.FindControl("litmaxmoney");
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);
                if (masterSettings.DrawPayType.Contains("0"))
                {
                    this.accoutType.Items.Add(new System.Web.UI.WebControls.ListItem("微信钱包", "0"));
                }
                if (masterSettings.DrawPayType.Contains("1"))
                {
                    this.accoutType.Items.Add(new System.Web.UI.WebControls.ListItem("支付宝", "1"));
                }
                if (masterSettings.DrawPayType.Contains("2"))
                {
                    this.accoutType.Items.Add(new System.Web.UI.WebControls.ListItem("线下转帐", "2"));
                }
                System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal) this.FindControl("litAlipayBtn");
                literal.Text = "display:none";
                if (masterSettings.DrawPayType.Contains("3"))
                {
                    literal.Text = "";
                }
                this.txtAccountName       = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtAccountName");
                this.txtaccount           = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtaccount");
                this.txtmoney             = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtmoney");
                this.txtmoneyweixin       = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtmoneyweixin");
                this.hidmoney             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hidmoney");
                this.requestcommission    = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("requestcommission");
                this.requestcommission1   = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("requestcommission1");
                this.txtaccount.Value     = nowCurrentDistributors.RequestAccount;
                this.txtAccountName.Value = currentMember.RealName;
                decimal referralBlance = nowCurrentDistributors.ReferralBlance;
                this.litmaxmoney.Text = referralBlance.ToString("F2");
                decimal num = 0m;
                if (decimal.TryParse(SettingsManager.GetMasterSettings(false).MentionNowMoney, out num) && num > 0m)
                {
                    this.txtmoney.Attributes["placeholder"]       = "请输入大于等于" + num + "元的金额";
                    this.txtmoneyweixin.Attributes["placeholder"] = "最低提现金额" + num + "元的金额";
                    this.hidmoney.Value = num.ToString();
                }
                if (DistributorsBrower.IsExitsCommionsRequest())
                {
                    this.requestcommission.Disabled   = true;
                    this.requestcommission.InnerText  = "您的申请正在审核当中";
                    this.requestcommission1.Disabled  = true;
                    this.requestcommission1.InnerText = "您的申请正在审核当中";
                    literal.Text = "display:none";
                    System.Web.UI.WebControls.Literal literal2 = (System.Web.UI.WebControls.Literal) this.FindControl("litWechatBtn");
                    literal2.Text = "display:none";
                }
                else
                {
                    this.requestcommission.Attributes.Add("onclick", "return RequestCommissions(3)");
                    this.requestcommission1.Attributes.Add("onclick", "return RequestCommissions(1)");
                }
            }
        }
Esempio n. 5
0
        protected override void AttachChildControls()
        {
            this.orderId = this.Page.Request.QueryString["orderId"];
            System.Collections.Generic.List <OrderInfo> orderMarkingOrderInfo = ShoppingProcessor.GetOrderMarkingOrderInfo(this.orderId);
            decimal num = 0m;

            if (orderMarkingOrderInfo.Count == 0)
            {
                this.Page.Response.Redirect("/Vshop/MemberOrders.aspx?status=0");
            }
            bool flag = true;

            foreach (OrderInfo current in orderMarkingOrderInfo)
            {
                num += current.GetTotal();
                foreach (LineItemInfo current2 in current.LineItems.Values)
                {
                    if (current2.Type == 0)
                    {
                        flag = false;
                    }
                    foreach (LineItemInfo current3 in current.LineItems.Values)
                    {
                        if (!ProductHelper.GetProductHasSku(current3.SkuId, current3.Quantity))
                        {
                            current.OrderStatus = OrderStatus.Closed;
                            current.CloseReason = "库存不足";
                            OrderHelper.UpdateOrder(current);
                            System.Web.HttpContext.Current.Response.Write("<script>alert('库存不足,订单自动关闭!');location.href='/Vshop/MemberOrders.aspx'</script>");
                            System.Web.HttpContext.Current.Response.End();
                            return;
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(orderMarkingOrderInfo[0].Gateway) && orderMarkingOrderInfo[0].Gateway == "hishop.plugins.payment.offlinerequest")
            {
                this.litMessage = (System.Web.UI.WebControls.Literal) this.FindControl("litMessage");
                this.litMessage.SetWhenIsNotNull(SettingsManager.GetMasterSettings(false).OffLinePayContent);
            }
            this.btnToPay = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("btnToPay");
            if (!string.IsNullOrEmpty(orderMarkingOrderInfo[0].Gateway) && orderMarkingOrderInfo[0].Gateway == "hishop.plugins.payment.weixinrequest")
            {
                this.btnToPay.Visible = true;
                this.btnToPay.HRef    = "~/pay/wx_Submit.aspx?orderId=" + this.orderId;
            }
            if (!string.IsNullOrEmpty(orderMarkingOrderInfo[0].Gateway) && orderMarkingOrderInfo[0].Gateway != "hishop.plugins.payment.podrequest" && orderMarkingOrderInfo[0].Gateway != "hishop.plugins.payment.offlinerequest" && orderMarkingOrderInfo[0].Gateway != "hishop.plugins.payment.weixinrequest")
            {
                PaymentModeInfo paymentMode    = ShoppingProcessor.GetPaymentMode(orderMarkingOrderInfo[0].PaymentTypeId);
                string          attach         = "";
                string          showUrl        = string.Format("http://{0}/vshop/", System.Web.HttpContext.Current.Request.Url.Host);
                PaymentRequest  paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), this.orderId, num, "订单支付", "订单号-" + this.orderId, orderMarkingOrderInfo[0].EmailAddress, orderMarkingOrderInfo[0].OrderDate, showUrl, Globals.FullPath("/pay/PaymentReturn_url.aspx"), Globals.FullPath("/pay/PaymentNotify_url.aspx"), attach);
                paymentRequest.SendRequest();
            }
            else
            {
                this.litOrderId        = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderId");
                this.litOrderTotal     = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
                this.literalOrderTotal = (System.Web.UI.WebControls.Literal) this.FindControl("literalOrderTotal");
                this.litPaymentType    = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litPaymentType");
                int num2 = 0;
                this.litPaymentType.SetWhenIsNotNull("0");
                if (int.TryParse(this.Page.Request.QueryString["PaymentType"], out num2))
                {
                    this.litPaymentType.SetWhenIsNotNull(num2.ToString());
                }
                this.litOrderId.SetWhenIsNotNull(this.orderId);
                if (flag)
                {
                    this.litOrderTotal.SetWhenIsNotNull("您需要支付:¥" + num.ToString("F2"));
                }
                this.literalOrderTotal.SetWhenIsNotNull("订单金额:<span style='color:red'>¥" + num.ToString("F2") + "</span>");
                this.litHelperText = (System.Web.UI.WebControls.Literal) this.FindControl("litHelperText");
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                this.litHelperText.SetWhenIsNotNull(masterSettings.OffLinePayContent);
                PageTitle.AddSiteNameTitle("下单成功");
            }
        }
Esempio n. 6
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("登录");
     this.client       = (HtmlInputHidden)this.FindControl("client");
     this.client.Value = base.ClientType.ToString().ToLower();
 }
Esempio n. 7
0
 protected override void AttachChildControls()
 {
     this.hidErrorMsg           = (HtmlInputHidden)this.FindControl("hidErrorMsg");
     this.txtOrderId            = (HtmlInputHidden)this.FindControl("txtOrderId");
     this.litOrderIds           = (Literal)this.FindControl("litOrderIds");
     this.txtSkuId              = (HtmlInputHidden)this.FindControl("txtSkuId");
     this.txtRemark             = (TextBox)this.FindControl("txtRemark");
     this.txtRefundAmount       = (TextBox)this.FindControl("txtRefundMoney");
     this.dropRefundType        = (WapRefundTypeDropDownList)this.FindControl("dropRefundType");
     this.DropReturnsReason     = (WapAfterSalesReasonDropDownList)this.FindControl("ReturnsReasonDropDownList");
     this.btnReturns            = ButtonManager.Create(this.FindControl("btnReturns"));
     this.litProductName        = (Literal)this.FindControl("litProductName");
     this.txtQuantity           = (TextBox)this.FindControl("txtQuantity");
     this.divQuantity           = (HtmlTableRow)this.FindControl("divQuantity");
     this.divQuantityTag        = (HtmlTableRow)this.FindControl("divQuantityTag");
     this.litMaxAmount          = (Literal)this.FindControl("litMaxAmount");
     this.litMaxQuantity        = (Literal)this.FindControl("litMaxQuantity");
     this.hidOneMaxRefundAmount = (HtmlInputHidden)this.FindControl("hidOneMaxRefundAmount");
     this.groupbuyPanel         = (HtmlGenericControl)this.FindControl("groupbuyPanel");
     this.hidMaxRefundAmount    = (HtmlInputHidden)this.FindControl("hidMaxRefundAmount");
     this.txtOrderId.Value      = this.OrderId;
     this.txtSkuId.Value        = this.SkuId;
     this.litOrderIds.Text      = this.OrderId;
     PageTitle.AddSiteNameTitle("退货申请");
     this.order = TradeHelper.GetOrderInfo(this.OrderId);
     if (this.order == null)
     {
         this.ShowError("错误的订单信息!");
     }
     else if (!TradeHelper.CanReturn(this.order, this.SkuId))
     {
         this.ShowError("订单状态不正确或者已有未处理完成的退款/退货申请!");
     }
     else if (string.IsNullOrEmpty(this.SkuId) || !this.order.LineItems.ContainsKey(this.SkuId))
     {
         this.ShowError("错误的商品信息!");
     }
     else
     {
         decimal canRefundAmount  = this.order.GetCanRefundAmount(this.SkuId, null, 0);
         decimal canRefundAmount2 = this.order.GetCanRefundAmount(this.SkuId, null, 1);
         if (canRefundAmount < decimal.Zero)
         {
             this.ShowError("订单中已申请的退款金额超过了订单总额!");
         }
         else
         {
             if (this.order.LineItems.ContainsKey(this.SkuId))
             {
                 this.ReturnsItem = this.order.LineItems[this.SkuId];
             }
             else
             {
                 if (this.divQuantity != null)
                 {
                     this.divQuantity.Style.Add("display", "none");
                 }
                 if (this.divQuantityTag != null)
                 {
                     this.divQuantityTag.Style.Add("display", "none");
                 }
             }
             if (!string.IsNullOrEmpty(this.SkuId))
             {
                 LineItemInfo lineItemInfo = this.order.LineItems[this.SkuId];
                 this.litProductName.Text = lineItemInfo.ItemDescription;
             }
             else
             {
                 this.txtQuantity.ReadOnly = true;
                 this.litProductName.Text  = "所有商品";
             }
             if (!this.Page.IsPostBack)
             {
                 this.litMaxQuantity.Text         = TradeHelper.GetMaxQuantity(this.order, this.SkuId).ToString();
                 this.litMaxAmount.Text           = canRefundAmount.F2ToString("f2");
                 this.hidOneMaxRefundAmount.Value = canRefundAmount2.F2ToString("f2");
                 this.hidMaxRefundAmount.Value    = this.litMaxAmount.Text;
                 this.txtQuantity.Text            = this.litMaxQuantity.Text;
                 this.txtRefundAmount.Text        = this.litMaxAmount.Text;
                 this.txtRefundAmount.Attributes.Add("placeholder", "最多可退款" + this.litMaxAmount.Text);
                 this.txtQuantity.Attributes.Add("placeholder", "最后可售后数量" + this.txtQuantity.Text + "件");
                 this.dropRefundType.preSaleId = this.order.PreSaleId;
                 string enumDescription = EnumDescription.GetEnumDescription((Enum)(object)EnumPaymentType.AdvancePay, 1);
                 this.dropRefundType.OrderGateWay  = ((this.order.PreSaleId > 0 && this.order.DepositGatewayOrderId.ToNullString().ToLower() == enumDescription) ? enumDescription : this.order.Gateway);
                 this.dropRefundType.BalanceAmount = this.order.BalanceAmount;
             }
         }
     }
 }
Esempio n. 8
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("分销中心");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId();
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            if (userIdDistributors == null)
            {
                System.Web.HttpContext.Current.Response.Redirect("DistributorRegCheck.aspx");
            }
            else if (userIdDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                this.imglogo = (System.Web.UI.WebControls.Image) this.FindControl("image");
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                this.litStroeName      = (System.Web.UI.WebControls.Literal) this.FindControl("litStroeName");
                this.litStroeName.Text = userIdDistributors.StoreName;
                this.litrGradeName     = (System.Web.UI.WebControls.Literal) this.FindControl("litrGradeName");
                DistributorGradeInfo distributorGradeInfo = DistributorGradeBrower.GetDistributorGradeInfo(userIdDistributors.DistriGradeId);
                if (distributorGradeInfo != null)
                {
                    this.litrGradeName.Text = distributorGradeInfo.Name;
                }
                this.litReferralBlance      = (System.Web.UI.WebControls.Literal) this.FindControl("litReferralBlance");
                this.litReferralBlance.Text = userIdDistributors.ReferralBlance.ToString("F2");
                this.litUserId         = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
                this.litUserId1        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId1");
                this.litUserId2        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId2");
                this.litUserId3        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId3");
                this.litUserId4        = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId4");
                this.litUserId.Text    = userIdDistributors.UserId.ToString();
                this.litUserId1.Text   = userIdDistributors.UserId.ToString();
                this.litUserId2.Text   = userIdDistributors.UserId.ToString();
                this.litUserId3.Text   = userIdDistributors.UserId.ToString();
                this.litUserId4.Text   = userIdDistributors.UserId.ToString();
                this.litTodayOrdersNum = (System.Web.UI.WebControls.Literal) this.FindControl("litTodayOrdersNum");
                OrderQuery orderQuery = new OrderQuery();
                orderQuery.UserId           = new int?(currentMemberUserId);
                orderQuery.Status           = OrderStatus.Today;
                this.litTodayOrdersNum.Text = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                this.refrraltotal           = (FormatedMoneyLabel)this.FindControl("refrraltotal");
                this.refrraltotal.Money     = DistributorsBrower.GetUserCommissions(userIdDistributors.UserId, System.DateTime.Now, null, null, null, "");
                this.saletotal       = (FormatedMoneyLabel)this.FindControl("saletotal");
                this.saletotal.Money = userIdDistributors.OrdersTotal;
                this.litMysubMember  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
                this.litMysubFirst   = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
                this.litMysubSecond  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
                DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);
                if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
                {
                    this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                    this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                    this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
                }
                else
                {
                    this.litMysubMember.Text = "0";
                    this.litMysubFirst.Text  = "0";
                    this.litMysubSecond.Text = "0";
                }
                this.litProtuctNum      = (System.Web.UI.WebControls.Literal) this.FindControl("litProtuctNum");
                this.litProtuctNum.Text = ProductBrowser.GetProductsNumber(true).ToString();
                orderQuery.Status       = OrderStatus.All;
                this.litOrders          = (System.Web.UI.WebControls.Literal) this.FindControl("litOrders");
                this.litOrders.Text     = DistributorsBrower.GetDistributorOrderCount(orderQuery).ToString();
                this.UpClassInfo        = (System.Web.UI.HtmlControls.HtmlContainerControl) this.FindControl("UpClassInfo");
                System.Collections.Generic.IList <DistributorGradeInfo> distributorGradeInfos = VShopHelper.GetDistributorGradeInfos();
                DistributorGradeInfo distributorGradeInfo2 = null;
                foreach (DistributorGradeInfo current in distributorGradeInfos)
                {
                    if (!(distributorGradeInfo.CommissionsLimit >= current.CommissionsLimit))
                    {
                        if (distributorGradeInfo2 == null)
                        {
                            distributorGradeInfo2 = current;
                        }
                        else if (distributorGradeInfo2.CommissionsLimit > current.CommissionsLimit)
                        {
                            distributorGradeInfo2 = current;
                        }
                    }
                }
                if (distributorGradeInfo2 == null)
                {
                    this.UpClassInfo.Visible = false;
                }
                else
                {
                    decimal d = distributorGradeInfo2.CommissionsLimit - userIdDistributors.ReferralBlance - userIdDistributors.ReferralRequestBalance;
                    if (d < 0m)
                    {
                        d = 0.01m;
                    }
                    this.UpClassInfo.InnerHtml = string.Concat(new string[]
                    {
                        "再获得<span> ",
                        d.ToString("F2"),
                        " 元</span>佣金升级为 <span>",
                        distributorGradeInfo2.Name,
                        "</span>"
                    });
                }
            }
        }
Esempio n. 9
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("错误的商品信息");
            }
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

            this.litProdcutName      = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litSalePrice        = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litShortDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSoldCount        = (System.Web.UI.WebControls.Literal) this.FindControl("litSoldCount");
            this.productImage        = (System.Web.UI.HtmlControls.HtmlImage) this.FindControl("productImage");
            this.productLink         = (System.Web.UI.WebControls.HyperLink) this.FindControl("productLink");
            this.txtTotal            = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal");
            ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(this.productId);

            if (productSimpleInfo == null)
            {
                base.GotoResourceNotFound("该件商品已经被管理员删除");
            }
            this.litProdcutName.SetWhenIsNotNull(productSimpleInfo.ProductName);
            this.litSalePrice.SetWhenIsNotNull(productSimpleInfo.MinSalePrice.ToString("F2"));
            this.litShortDescription.SetWhenIsNotNull(productSimpleInfo.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(productSimpleInfo.ShowSaleCounts.ToString());
            if (!string.IsNullOrEmpty(productSimpleInfo.ThumbnailUrl180))
            {
                this.productImage.Src = productSimpleInfo.ThumbnailUrl180;
            }
            else
            {
                this.productImage.Src = masterSettings.DefaultProductThumbnail5;
            }
            this.productLink.NavigateUrl = "ProductDetails.aspx?ProductId=" + productSimpleInfo.ProductId;
            int pageIndex;

            if (!int.TryParse(this.Page.Request.QueryString["page"], out pageIndex))
            {
                pageIndex = 1;
            }
            int pageSize;

            if (!int.TryParse(this.Page.Request.QueryString["size"], out pageSize))
            {
                pageSize = 20;
            }
            ProductReviewQuery productReviewQuery = new ProductReviewQuery();

            productReviewQuery.productId = this.productId;
            productReviewQuery.IsCount   = true;
            productReviewQuery.PageIndex = pageIndex;
            productReviewQuery.PageSize  = pageSize;
            productReviewQuery.SortBy    = "ReviewId";
            productReviewQuery.SortOrder = SortAction.Desc;
            this.rptProducts             = (WapTemplatedRepeater)this.FindControl("rptProducts");
            DbQueryResult productReviews = ProductBrowser.GetProductReviews(productReviewQuery);

            this.rptProducts.DataSource = productReviews.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("商品评价");
        }
Esempio n. 10
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("申请提现");
     this.lblBanlance        = (Literal)this.FindControl("lblBanlance");
     this.lblLastDrawTime    = (Literal)this.FindControl("lblLastDrawTime");
     this.lblminDraws        = (Literal)this.FindControl("lblminDraws");
     this.CanDrawRequestType = (HtmlInputHidden)this.FindControl("CanDrawRequestType");
     this.requestBalance     = (HtmlInputHidden)this.FindControl("requestBalance");
     if (!this.Page.IsPostBack)
     {
         int        num  = 0;
         MemberInfo user = HiContext.Current.User;
         if (!user.IsOpenBalance || string.IsNullOrEmpty(user.TradePassword))
         {
             this.Page.Response.Redirect(string.Format("/{1}/OpenBalance?ReturnUrl={0}", HttpContext.Current.Request.Url, "AppShop"));
         }
         SiteSettings masterSettings = SettingsManager.GetMasterSettings();
         if (this.lblminDraws != null)
         {
             this.lblminDraws.Text = masterSettings.MinimumSingleShot.F2ToString("f2");
         }
         if (this.lblBanlance != null)
         {
             this.lblBanlance.Text = MemberProcessor.GetUserUseSplittin(HiContext.Current.UserId).F2ToString("f2");
         }
         if (this.lblLastDrawTime != null)
         {
             SplittinDrawInfo myRecentlySplittinDraws = MemberProcessor.GetMyRecentlySplittinDraws();
             if (myRecentlySplittinDraws != null)
             {
                 this.lblLastDrawTime.Text = myRecentlySplittinDraws.RequestDate.ToString("yyyy-MM-dd HH:mm:ss");
                 if (myRecentlySplittinDraws.AuditStatus == 1)
                 {
                     this.requestBalance.Value = "1";
                 }
             }
             else
             {
                 this.lblLastDrawTime.Text = "您还没有提现记录";
             }
         }
         bool flag = masterSettings.EnableBulkPaymentWeixin;
         bool enableBulkPaymentAliPay = masterSettings.EnableBulkPaymentAliPay;
         if (masterSettings.EnableBulkPaymentWeixin)
         {
             if (user.MemberOpenIds == null)
             {
                 flag = false;
             }
             else
             {
                 MemberOpenIdInfo memberOpenIdInfo = user.MemberOpenIds.FirstOrDefault((MemberOpenIdInfo item) => item.OpenIdType.ToLower() == "hishop.plugins.openid.weixin");
                 if (memberOpenIdInfo == null)
                 {
                     flag = false;
                 }
             }
         }
         if (masterSettings.SplittinDraws_CashToDeposit)
         {
             num++;
         }
         if (masterSettings.SplittinDraws_CashToBankCard)
         {
             num += 2;
         }
         if (flag && masterSettings.SplittinDraws_CashToWeiXin)
         {
             num += 4;
         }
         if (enableBulkPaymentAliPay && masterSettings.SplittinDraws_CashToALiPay)
         {
             num += 8;
         }
         this.CanDrawRequestType.Value = num.ToString();
     }
 }
        protected override void AttachChildControls()
        {
            this.hidHasTradePassword = (HtmlInputHidden)this.FindControl("hidHasTradePassword");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            this.orderId              = this.Page.Request.QueryString["orderId"];
            this.spandemo             = (HtmlGenericControl)this.FindControl("spandemo");
            this.litBalanceAmount     = (Literal)this.FindControl("litBalanceAmount");
            this.liBalanceAmount      = (HtmlGenericControl)this.FindControl("liBalanceAmount");
            this.hidExpressStatus     = (HtmlInputHidden)this.FindControl("hidExpressStatus");
            this.litInvoiceType       = (Literal)this.FindControl("litInvoiceType");
            this.litRegisterAddress   = (Literal)this.FindControl("litRegisterAddress");
            this.litRegisterTel       = (Literal)this.FindControl("litRegisterTel");
            this.litOpenBank          = (Literal)this.FindControl("litOpenBank");
            this.litBankName          = (Literal)this.FindControl("litBankName");
            this.litReceiveName       = (Literal)this.FindControl("litReceiveName");
            this.litReceiveMobbile    = (Literal)this.FindControl("litReceiveMobbile");
            this.litReceiveEmail      = (Literal)this.FindControl("litReceiveEmail");
            this.litReceiveRegionName = (Literal)this.FindControl("litReceiveRegionName");
            this.litReceiveAddress    = (Literal)this.FindControl("litReceiveAddress");
            this.spandemo.Visible     = masterSettings.IsDemoSite;
            this.LoadAllControls();
            this.order = ShoppingProcessor.GetOrderInfo(this.orderId);
            if (this.order == null || this.order.UserId != HiContext.Current.UserId)
            {
                base.GotoResourceNotFound("此订单已不存在");
            }
            if (this.order.ParentOrderId != "0" && this.order.ParentOrderId != "-1" && this.order.OrderStatus == OrderStatus.WaitBuyerPay)
            {
                this.order   = ShoppingProcessor.GetOrderInfo(this.order.ParentOrderId);
                this.orderId = this.order.OrderId;
            }
            if (this.hidHasTradePassword != null && HiContext.Current.User.UserId > 0)
            {
                this.hidHasTradePassword.Value = (string.IsNullOrWhiteSpace(HiContext.Current.User.TradePassword) ? "0" : "1");
            }
            else
            {
                this.hidHasTradePassword.Value = "0";
            }
            if ((this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) && this.order.ShippingModeId != -2)
            {
                if (!string.IsNullOrEmpty(this.order.ExpressCompanyAbb) && !string.IsNullOrEmpty(this.order.ShipOrderNumber))
                {
                    this.hidExpressStatus.Value = "2";
                }
                else
                {
                    this.hidExpressStatus.Value = "1";
                }
            }
            this.BindOrderInfo();
            if (!masterSettings.OpenMultStore && masterSettings.IsOpenPickeupInStore && this.order.SupplierId == 0 && this.order.ShippingModeId == -2)
            {
                this.litGetGoodsRemark.Text  = masterSettings.PickeupInStoreRemark;
                this.divStoreAddress.Visible = false;
            }
            else
            {
                this.divPickUpRemark.Visible = false;
            }
            if (this.order.CountDownBuyId > 0)
            {
                this.paymenttypeselect.OrderSalesPromotion = Common_AppPaymentTypeSelect.EnumOrderSalesPromotion.CountDownBuy;
            }
            if (!string.IsNullOrEmpty(this.order.InvoiceTitle))
            {
                UserInvoiceDataInfo userInvoiceDataInfo = this.order.InvoiceInfo;
                if (userInvoiceDataInfo == null)
                {
                    userInvoiceDataInfo = new UserInvoiceDataInfo
                    {
                        InvoiceType           = this.order.InvoiceType,
                        InvoiceTaxpayerNumber = this.order.InvoiceTaxpayerNumber,
                        InvoiceTitle          = this.order.InvoiceTitle
                    };
                }
                this.litInvoiceType.SetWhenIsNotNull(EnumDescription.GetEnumDescription((Enum)(object)this.order.InvoiceType, 0));
                this.litRegisterAddress.SetWhenIsNotNull(userInvoiceDataInfo.RegisterAddress.ToNullString());
                this.litRegisterTel.SetWhenIsNotNull(userInvoiceDataInfo.RegisterTel.ToNullString());
                this.litOpenBank.SetWhenIsNotNull(userInvoiceDataInfo.OpenBank.ToNullString());
                this.litBankName.SetWhenIsNotNull(userInvoiceDataInfo.BankAccount.ToNullString());
                this.litReceiveName.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveName.ToNullString());
                if (this.order.InvoiceType != InvoiceType.Enterprise)
                {
                    this.litReceiveMobbile.SetWhenIsNotNull(userInvoiceDataInfo.ReceivePhone.ToNullString());
                    if (this.order.InvoiceType != InvoiceType.VATInvoice)
                    {
                        this.litReceiveEmail.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveEmail.ToNullString());
                    }
                }
                this.litReceiveRegionName.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveRegionName.ToNullString());
                this.litReceiveAddress.SetWhenIsNotNull(userInvoiceDataInfo.ReceiveAddress.ToNullString());
            }
            this.paymenttypeselect.IsFireGroup  = (this.order.FightGroupId > 0);
            this.litFightGroupStatusLabel.Order = this.order;
            this.SetOperatorsStatus();
            this.BindStoreInfo();
            this.rptOrderProducts = (Common_MemberOrderProducts)this.FindControl("Common_MemberOrderProducts");
            this.rptOrderProducts.ItemDataBound += this.rptOrderProducts_ItemDataBound;
            var dataSource = (from i in (from i in this.order.LineItems.Values
                                         select new
            {
                i.SupplierId,
                i.SupplierName
            }).Distinct()
                              orderby i.SupplierId
                              select i).ToList();

            this.rptOrderProducts.DataSource = dataSource;
            this.rptOrderProducts.orderInfo  = this.order;
            this.rptOrderProducts.DataBind();
            IList <OrderGiftInfo> gifts = this.order.Gifts;

            if (gifts.Count() > 0)
            {
                this.rptCartGifts.DataSource = gifts;
                this.rptCartGifts.DataBind();
            }
            else
            {
                this.divGifts.Visible = false;
            }
            this.divProducts.Visible          = (this.order.LineItems.Count > 0);
            this.rptPromotionGifts.DataSource = from a in this.order.Gifts
                                                where a.PromoteType > 0
                                                select a;

            this.rptPromotionGifts.DataBind();
            PageTitle.AddSiteNameTitle("订单详情");
        }
Esempio n. 12
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("关于海美生活");

            WAPHeadName.AddHeadName("关于海美生活");
        }
Esempio n. 13
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["voteId"], out this.voteId))
            {
                base.GotoResourceNotFound("");
            }
            //设置微信流量其中标头
            VoteInfo voteById = StoreHelper.GetVoteById(this.voteId);

            if (voteById != null && voteById.VoteId > 0)
            {
                PageTitle.AddSiteNameTitle(voteById.VoteName + "结果");
            }

            this.litVoteResult = (Literal)this.FindControl("litVoteResult");
            System.Text.StringBuilder builder = new System.Text.StringBuilder();

            //加载配置模块
            string selectSql = string.Format("Select * From Yihui_Votes_Model Where VoteId={0} order by ModelSN;", voteId);

            selectSql += string.Format("Select * From YiHui_HomePage_Model where PageID in (select VMID from Yihui_Votes_Model where VoteId = {0});", voteId);
            selectSql += string.Format("Select * From YIHui_Votes_Model_Detail where VMID in (select VMID from Yihui_Votes_Model where VoteId = {0}) order by VMID,Scode;", voteId);
            selectSql += string.Format("Select * From YiHui_Votes_Model_Result where VoteId = {0}", voteId);
            DataSet ds = DataBaseHelper.GetDataSet(selectSql);

            DataTable dtvm        = ds.Tables[0];
            DataTable dthpm_Model = ds.Tables[1];
            DataTable dtvm_detail = ds.Tables[2];
            DataTable dtvm_Result = ds.Tables[3];

            int i = 0;

            foreach (DataRow dr in dtvm.Rows)
            {
                if (dr["ModelCode"].ToString() == "XuanXiang")
                {
                    i++;
                    DataRow[] drs = dthpm_Model.Select(string.Format("PageID = '{0}'", dr["VMID"].ToString()), "", DataViewRowState.CurrentRows);
                    if (drs.Length > 0)
                    {
                        string[] strValues = drs[0]["PMContents"].ToString().Split('♦');
                        if (strValues.Length == 3)
                        {
                            builder.AppendFormat("<div id='vote-result{0}' i='{0}' class='vote-result'>", i);
                            builder.Append("<div class='vote-result-con'>");
                            builder.AppendFormat("<div class='vote-result-con-title'><h3>{0}</h3><h4>{1}</h4></div>", strValues[0], strValues[1]);
                            builder.Append("<ul>");
                            DataRow[] drsdetail = dtvm_detail.Select(string.Format("VMID = '{0}'", dr["VMID"].ToString()), "Scode", DataViewRowState.CurrentRows);
                            foreach (DataRow drxm in drsdetail)
                            {
                                DataRow[] drSumResult = dtvm_Result.Select(string.Format("PMID = '{0}'", drs[0]["PMID"].ToString()), "", DataViewRowState.CurrentRows);//当前投票项参与总人数
                                DataRow[] drResult    = dtvm_Result.Select(string.Format("PMID = '{0}' and Result like '%{1},%'", drs[0]["PMID"].ToString(), drxm["Value"].ToString()), "", DataViewRowState.CurrentRows);
                                string    strBl       = "0%";
                                if (drSumResult.Length > 0)
                                {
                                    double dbBl = Convert.ToDouble(drResult.Length) / Convert.ToDouble(drSumResult.Length);
                                    strBl = string.Format("{0:0.00%}", dbBl);
                                }
                                builder.AppendFormat("<li n='{0}'>{1}<div class='progress'><p style='width:{4}'></p><span style='left:{4}'>{4}</span></div></li>", drxm["Scode"].ToString(), drxm["Name"].ToString(), drResult.Length, drSumResult.Length, strBl);
                            }
                            builder.Append("</ul>");
                            builder.Append("</div>");
                            builder.Append("</div>");
                        }
                    }
                }
            }
            this.litVoteResult.Text = builder.ToString();
        }
Esempio n. 14
0
        protected override void AttachChildControls()
        {
            string a = this.Page.Request["action"].ToNullString().ToLower();

            if (a == "register")
            {
                PageTitle.AddSiteNameTitle("登录");
            }
            else
            {
                PageTitle.AddSiteNameTitle("注册");
            }
            this.hidIsAuth              = (HtmlInputHidden)this.FindControl("hid_IsAuth");
            this.hidAuthMsg             = (HtmlInputHidden)this.FindControl("hid_AuthMsg");
            this.hidOpenIdType          = (HtmlInputHidden)this.FindControl("hid_OpenIdType");
            this.hidOpenId              = (HtmlInputHidden)this.FindControl("hid_OpenId");
            this.hidToken               = (HtmlInputHidden)this.FindControl("hid_Token");
            this.hidRealName            = (HtmlInputHidden)this.FindControl("hid_RealName");
            this.hidUserId              = (HtmlInputHidden)this.FindControl("hid_UserId");
            this.hidEmail               = (HtmlInputHidden)this.FindControl("hid_Email");
            this.hidIsNeedValidateEmail = (HiddenField)this.FindControl("hidIsNeedValidateEmail");
            this.hidIsOpenGeetest       = (HiddenField)this.FindControl("hidIsOpenGeetest");
            this.client              = (HtmlInputHidden)this.FindControl("client");
            this.client.Value        = base.ClientType.ToString().ToLower();
            this.smsenable           = (HiddenField)this.FindControl("smsenable");
            this.emailenable         = (HiddenField)this.FindControl("emailenable");
            this.txtUserName         = (HtmlInputText)this.FindControl("txtUserName");
            this.txtRegisterUserName = (HtmlInputText)this.FindControl("txtRegisterUserName");
            this.forgetPassword      = (HtmlAnchor)this.FindControl("forgetPassword");
            this.divRealName         = (HtmlGenericControl)this.FindControl("divRealName");
            this.divBirthday         = (HtmlGenericControl)this.FindControl("divBirthday");
            this.divSex              = (HtmlGenericControl)this.FindControl("divSex");
            SiteSettings masterSettings = SettingsManager.GetMasterSettings();

            this.hidIsNeedValidateEmail.Value = (masterSettings.IsNeedValidEmail ? "1" : "0");
            this.hidIsOpenGeetest.Value       = (masterSettings.IsOpenGeetest ? "1" : "0");
            this.labNickName  = (Label)this.FindControl("labNickName");
            this.labNickName1 = (Label)this.FindControl("labNickName1");
            this.labNickName2 = (Label)this.FindControl("labNickName2");
            this.userPicture  = (HtmlImage)this.FindControl("userPicture");
            this.hid_QuickLoginIsForceBindingMobbile       = (HtmlInputHidden)this.FindControl("hid_QuickLoginIsForceBindingMobbile");
            this.hid_QuickLoginIsForceBindingMobbile.Value = (masterSettings.QuickLoginIsForceBindingMobbile ? "true" : "false");
            if (masterSettings.RegistExtendInfo.Contains("RealName"))
            {
                this.divRealName.Visible = true;
            }
            if (masterSettings.RegistExtendInfo.Contains("Sex"))
            {
                this.divSex.Visible = true;
            }
            if (masterSettings.RegistExtendInfo.Contains("Birthday"))
            {
                this.divBirthday.Visible = true;
            }
            if (masterSettings.IsSurportEmail && masterSettings.IsSurportPhone && masterSettings.SMSEnabled && !string.IsNullOrEmpty(masterSettings.SMSSettings))
            {
                this.smsenable.Value   = "true";
                this.emailenable.Value = "true";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/邮箱/手机");
                this.txtRegisterUserName.Attributes.Add("placeholder", "邮箱/手机");
                this.forgetPassword.Visible = true;
            }
            else if (!masterSettings.IsSurportEmail && (!masterSettings.IsSurportPhone || !masterSettings.SMSEnabled || string.IsNullOrEmpty(masterSettings.SMSSettings)))
            {
                this.smsenable.Value   = "false";
                this.emailenable.Value = "true";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/邮箱");
                this.txtRegisterUserName.Attributes.Add("placeholder", "邮箱");
            }
            else if (masterSettings.IsSurportEmail && (!masterSettings.IsSurportPhone || !masterSettings.SMSEnabled || string.IsNullOrEmpty(masterSettings.SMSSettings)))
            {
                this.smsenable.Value   = "false";
                this.emailenable.Value = "true";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/邮箱");
                this.txtRegisterUserName.Attributes.Add("placeholder", "邮箱");
            }
            else if (!masterSettings.IsSurportEmail && masterSettings.IsSurportPhone && masterSettings.SMSEnabled && !string.IsNullOrEmpty(masterSettings.SMSSettings))
            {
                this.smsenable.Value   = "true";
                this.emailenable.Value = "false";
                this.txtUserName.Attributes.Add("placeholder", "请输入用户名/手机");
                this.txtRegisterUserName.Attributes.Add("placeholder", "手机");
            }
            this.openIdType = base.GetParameter("HIGW");
            if (!string.IsNullOrEmpty(this.openIdType))
            {
                this.openIdType = this.openIdType.ToLower().Replace("_", ".");
                OpenIdSettingInfo openIdSettings = MemberProcessor.GetOpenIdSettings(this.openIdType);
                if (openIdSettings == null)
                {
                    this.AuthMsg = "没有找到对应的插件配置信息。";
                }
                else
                {
                    this.IsAuth     = true;
                    this.parameters = new NameValueCollection
                    {
                        this.Page.Request.Form,
                        this.Page.Request.QueryString
                    };
                    OpenIdNotify openIdNotify = OpenIdNotify.CreateInstance(this.openIdType, this.parameters);
                    openIdNotify.Authenticated += this.Notify_Authenticated;
                    openIdNotify.Failed        += this.Notify_Failed;
                    try
                    {
                        openIdNotify.Verify(30000, HiCryptographer.Decrypt(openIdSettings.Settings));
                    }
                    catch (Exception ex)
                    {
                        this.IsAuth  = false;
                        this.AuthMsg = ex.Message;
                    }
                    if (this.hidIsAuth != null)
                    {
                        this.hidIsAuth.Value = this.IsAuth.ToString();
                    }
                    if (this.hidAuthMsg != null)
                    {
                        this.hidAuthMsg.Value = this.AuthMsg;
                    }
                    if (this.hidOpenId != null)
                    {
                        this.hidOpenId.Value = this.openId;
                    }
                    if (this.hidOpenIdType != null)
                    {
                        this.hidOpenIdType.Value = this.openIdType;
                    }
                }
            }
        }
        protected override void AttachChildControls()
        {
            this.btnReferral        = (HtmlInputButton)this.FindControl("btnReferral");
            this.btnSendGoods       = (HtmlInputButton)this.FindControl("btnSendGoods");
            this.btnLogistic        = (HtmlInputButton)this.FindControl("btnLogistic");
            this.hidUploadImages    = (HtmlInputHidden)this.FindControl("hidUploadImages");
            this.hidErrorMsg        = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.hidOldImages       = (HtmlInputHidden)this.FindControl("hidOldImages");
            this.txtReturnsId       = (HtmlInputHidden)this.FindControl("txtReturnsId");
            this.txtOrderId         = (Literal)this.FindControl("txtOrderId");
            this.txtRefundMoney     = (Literal)this.FindControl("txtRefundMoney");
            this.txtRefundType      = (Literal)this.FindControl("txtRefundType");
            this.txtMemo            = (Literal)this.FindControl("txtMemo");
            this.txtStatus          = (Literal)this.FindControl("txtStatus");
            this.txtAdminRemark     = (Literal)this.FindControl("txtAdminRemark");
            this.txtQuantity        = (Literal)this.FindControl("txtQuantity");
            this.ExpressRow         = (HtmlGenericControl)this.FindControl("ExpressRow");
            this.ExpressNumberRow   = (HtmlGenericControl)this.FindControl("ExpressNumberRow");
            this.AdminRemarkRow     = (HtmlGenericControl)this.FindControl("AdminRemarkRow");
            this.txtExpress         = (Literal)this.FindControl("txtExpress");
            this.txtExpressNo       = (Literal)this.FindControl("txtExpressNo");
            this.txtReturnReason    = (Literal)this.FindControl("txtReturnReason");
            this.litStep            = (Literal)this.FindControl("litStep");
            this.litStatus          = (Literal)this.FindControl("litStatus");
            this.txtIsRefund        = (HtmlInputHidden)this.FindControl("txtIsRefund");
            this.products           = (Common_OrderItem_AfterSales)this.FindControl("Common_OrderItemAfterSales");
            this.txtAfterSaleId     = (Literal)this.FindControl("txtAfterSaleId");
            this.litCredentialsImg  = (Literal)this.FindControl("litCredentialsImg");
            this.litBankName        = (Literal)this.FindControl("litBankName");
            this.litBankAccountName = (Literal)this.FindControl("litBankAccountName");
            this.litBankAccountNo   = (Literal)this.FindControl("litBankAccountNo");
            this.bankRow1           = (HtmlGenericControl)this.FindControl("bankRow1");
            this.bankRow2           = (HtmlGenericControl)this.FindControl("bankRow2");
            this.bankRow3           = (HtmlGenericControl)this.FindControl("bankRow3");
            int num = HttpContext.Current.Request.QueryString["ReturnId"].ToInt(0);

            if (num <= 0)
            {
                HttpContext.Current.Request.QueryString["ReturnsId"].ToInt(0);
            }
            ReturnInfo returnInfo = TradeHelper.GetReturnInfo(num);

            if (returnInfo == null)
            {
                this.ShowError("错误的退货信息");
                return;
            }
            if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund)
            {
                this.litStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 0);
            }
            else
            {
                this.litStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.HandleStatus, 3);
            }
            OrderInfo orderInfo = TradeHelper.GetOrderInfo(returnInfo.OrderId);

            if (orderInfo == null || orderInfo.UserId != HiContext.Current.UserId)
            {
                this.ShowMessage("退货订单不存在或者不属于当前用户的订单", false, "", 1);
                return;
            }
            if (!string.IsNullOrEmpty(returnInfo.UserCredentials))
            {
                this.hidOldImages.Value = returnInfo.UserCredentials;
            }
            Literal literal = this.txtAfterSaleId;
            int     num2    = returnInfo.ReturnId;

            literal.Text = num2.ToString();
            Literal literal2 = this.txtQuantity;

            num2          = returnInfo.Quantity;
            literal2.Text = num2.ToString();
            HtmlInputHidden htmlInputHidden = this.txtReturnsId;

            num2 = returnInfo.ReturnId;
            htmlInputHidden.Value     = num2.ToString();
            this.txtOrderId.Text      = returnInfo.OrderId;
            this.txtRefundMoney.Text  = returnInfo.RefundAmount.F2ToString("f2");
            this.txtRefundType.Text   = EnumDescription.GetEnumDescription((Enum)(object)returnInfo.RefundType, 0);
            this.txtMemo.Text         = returnInfo.UserRemark;
            this.txtReturnReason.Text = returnInfo.ReturnReason;
            if (returnInfo.RefundType == RefundTypes.InBankCard)
            {
                this.bankRow1.Visible        = true;
                this.bankRow2.Visible        = true;
                this.bankRow3.Visible        = true;
                this.litBankName.Text        = returnInfo.BankName;
                this.litBankAccountName.Text = returnInfo.BankAccountName;
                this.litBankAccountNo.Text   = returnInfo.BankAccountNo;
            }
            string userCredentials = returnInfo.UserCredentials;

            if (!string.IsNullOrEmpty(userCredentials))
            {
                string[] array = userCredentials.Split('|');
                userCredentials = "";
                string[] array2 = array;
                foreach (string str in array2)
                {
                    userCredentials += string.Format(this.credentialsImgHtml, Globals.GetImageServerUrl() + str);
                }
                this.litCredentialsImg.Text = userCredentials;
            }
            if (returnInfo.AfterSaleType == AfterSaleTypes.ReturnAndRefund && (returnInfo.HandleStatus == ReturnStatus.Deliverying || returnInfo.HandleStatus == ReturnStatus.GetGoods || returnInfo.HandleStatus == ReturnStatus.Returned))
            {
                this.txtExpress.Text   = returnInfo.ExpressCompanyName;
                this.txtExpressNo.Text = returnInfo.ShipOrderNumber;
            }
            else
            {
                this.ExpressRow.Visible       = false;
                this.ExpressNumberRow.Visible = false;
                this.btnLogistic.Visible      = false;
            }
            if (returnInfo.HandleStatus != ReturnStatus.MerchantsAgreed && returnInfo.HandleStatus != ReturnStatus.Deliverying)
            {
                this.btnSendGoods.Visible = false;
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                this.btnSendGoods.Value = "修改发货信息";
            }
            if (!string.IsNullOrEmpty(returnInfo.AdminRemark))
            {
                this.txtAdminRemark.Text = returnInfo.AdminRemark;
                if (this.AdminRemarkRow != null)
                {
                    this.AdminRemarkRow.Visible = true;
                }
            }
            else if (this.AdminRemarkRow != null)
            {
                this.AdminRemarkRow.Visible = false;
            }
            if (orderInfo != null)
            {
                this.products.order = orderInfo;
                if (string.IsNullOrEmpty(returnInfo.SkuId))
                {
                    this.products.DataSource = orderInfo.LineItems.Values;
                }
                else
                {
                    Dictionary <string, LineItemInfo> dictionary = new Dictionary <string, LineItemInfo>();
                    foreach (LineItemInfo value2 in orderInfo.LineItems.Values)
                    {
                        if (value2.SkuId == returnInfo.SkuId)
                        {
                            dictionary.Add(value2.SkuId, value2);
                        }
                    }
                    this.products.DataSource = dictionary.Values;
                }
                this.products.DataBind();
            }
            DateTime dateTime = returnInfo.AgreedOrRefusedTime.HasValue ? returnInfo.AgreedOrRefusedTime.Value : returnInfo.ApplyForTime;
            DateTime value;
            DateTime dateTime2;

            if (returnInfo.FinishTime.HasValue)
            {
                DateTime?finishTime = returnInfo.FinishTime;
                value = DateTime.MinValue;
                if (!(finishTime == (DateTime?)value))
                {
                    dateTime2 = returnInfo.FinishTime.Value;
                    goto IL_0842;
                }
            }
            dateTime2 = returnInfo.ApplyForTime;
            goto IL_0842;
IL_0842:
            DateTime dateTime3 = dateTime2;
            DateTime dateTime4 = returnInfo.UserSendGoodsTime.HasValue ? returnInfo.UserSendGoodsTime.Value : dateTime;
            DateTime dateTime5 = returnInfo.ConfirmGoodsTime.HasValue ? returnInfo.ConfirmGoodsTime.Value : dateTime4;
            string   text      = "<ul>";

            returnInfo.AdminRemark = (string.IsNullOrEmpty(returnInfo.AdminRemark) ? "" : ("备注:" + returnInfo.AdminRemark));
            if (returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
            {
                this.txtIsRefund.Value = "1";
                if (returnInfo.HandleStatus == ReturnStatus.Applied)
                {
                    string str2   = text;
                    string text2  = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str2 + text2.Replace("{time}", string.Format(format, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "商家同意退款");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
                {
                    string str3    = text;
                    string text3   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format2 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str3 + text3.Replace("{time}", string.Format(format2, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                            .Replace("{StatusText}", "商家同意申请");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Returned)
                {
                    string str4    = text;
                    string text4   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format3 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str4 + text4.Replace("{time}", string.Format(format3, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                            .Replace("{StatusText}", "商家同意申请");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (returnInfo.HandleStatus == ReturnStatus.Refused)
                {
                    string str5    = text;
                    string text5   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format4 = this.timeTemplate;
                    value = returnInfo.ApplyForTime;
                    text  = str5 + text5.Replace("{time}", string.Format(format4, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退款中");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                            .Replace("{StatusText}", "商家拒绝申请");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, ""))
                            .Replace("{StatusText}", "退款失败");
                }
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Applied)
            {
                string str6    = text;
                string text6   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format5 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str6 + text6.Replace("{time}", string.Format(format5, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.MerchantsAgreed)
            {
                string str7    = text;
                string text7   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format6 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str7 + text7.Replace("{time}", string.Format(format6, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Deliverying)
            {
                string str8    = text;
                string text8   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format7 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str8 + text8.Replace("{time}", string.Format(format7, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.GetGoods)
            {
                string str9    = text;
                string text9   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format8 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str9 + text9.Replace("{time}", string.Format(format8, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Returned)
            {
                string str10   = text;
                string text10  = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format9 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str10 + text10.Replace("{time}", string.Format(format9, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家同意申请");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime4.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "买家退货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime5.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "商家确认收货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime3.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "退货完成");
            }
            else if (returnInfo.HandleStatus == ReturnStatus.Refused)
            {
                string str11    = text;
                string text11   = this.stepTemplate.Replace("{style}", this.activityStyle);
                string format10 = this.timeTemplate;
                value = returnInfo.ApplyForTime;
                text  = str11 + text11.Replace("{time}", string.Format(format10, value.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "申请退货中");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, returnInfo.AdminRemark))
                        .Replace("{StatusText}", "商家拒绝退货");
                text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                        .Replace("{StatusText}", "退货失败");
            }
            text += "</ul>";
            this.litStep.Text = text;
            if (returnInfo != null && returnInfo.AfterSaleType == AfterSaleTypes.OnlyRefund)
            {
                PageTitle.AddSiteNameTitle("退款详情");
            }
            else
            {
                PageTitle.AddSiteNameTitle("退货详情");
            }
        }
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            this.rptProductImages      = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.litItemParams         = (Literal)this.FindControl("litItemParams");
            this.litProdcutName        = (Literal)this.FindControl("litProdcutName");
            this.litProdcutTag         = (Literal)this.FindControl("litProdcutTag");
            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.litStock              = (Literal)this.FindControl("litStock");
            this.skuSelector           = (Common_SKUSelector)this.FindControl("skuSelector");
            this.linkDescription       = (HyperLink)this.FindControl("linkDescription");
            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.litCategoryId         = (HtmlInputHidden)this.FindControl("litCategoryId");
            this.litproductid          = (HtmlInputHidden)this.FindControl("litproductid");
            this.litTemplate           = (HtmlInputHidden)this.FindControl("litTemplate");
            ProductInfo product = ProductBrowser.GetProduct(MemberProcessor.GetCurrentMember(), this.productId);

            if (product != null)
            {
                this.litproductid.Value = this.productId.ToString();
                this.litTemplate.Value  = product.FreightTemplateId.ToString();
                if (product == null)
                {
                    base.GotoResourceNotFound("此商品已不存在");
                }
                if (product.SaleStatus != ProductSaleStatus.OnSale)
                {
                    base.GotoResourceNotFound(ErrorType.前台商品下架, "此商品已下架");
                }
                if (this.rptProductImages != null)
                {
                    string       locationUrl = "javascript:;";
                    SlideImage[] imageArray  = new SlideImage[] { new SlideImage(product.ImageUrl1, locationUrl), new SlideImage(product.ImageUrl2, locationUrl), new SlideImage(product.ImageUrl3, locationUrl), new SlideImage(product.ImageUrl4, locationUrl), new SlideImage(product.ImageUrl5, locationUrl) };
                    this.rptProductImages.DataSource = from item in imageArray
                                                       where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                       select item;
                    this.rptProductImages.DataBind();
                }
                string mainCategoryPath = product.MainCategoryPath;
                if (!string.IsNullOrEmpty(mainCategoryPath))
                {
                    this.litCategoryId.Value = mainCategoryPath.Split(new char[] { '|' })[0];
                }
                else
                {
                    this.litCategoryId.Value = "0";
                }
                string productName    = product.ProductName;
                string productTagName = ProductBrowser.GetProductTagName(this.productId);
                if (!string.IsNullOrEmpty(productTagName))
                {
                    this.litProdcutTag.Text = "<div class='y-shopicon'>" + productTagName.Trim() + "</div>";
                    productTagName          = "<span class='producttag'>【" + HttpContext.Current.Server.HtmlEncode(productTagName) + "】</span>";
                }
                this.litProdcutName.Text = productTagName + productName;
                if (product.MinSalePrice != product.MaxSalePrice)
                {
                    this.litSalePrice.Text = product.MinSalePrice.ToString("F2") + "~" + product.MaxSalePrice.ToString("F2");
                }
                else
                {
                    this.litSalePrice.Text = product.MinSalePrice.ToString("F2");
                }
                if (product.MarketPrice.HasValue && (product.MarketPrice > 0M))
                {
                    this.litMarketPrice.Text = "<del class=\"text-muted font-s\">\x00a5" + product.MarketPrice.Value.ToString("F2") + "</del>";
                }
                this.litShortDescription.Text = product.ShortDescription;
                string description = product.Description;
                if (!string.IsNullOrEmpty(description))
                {
                    description = Regex.Replace(description, "<img[^>]*\\bsrc=('|\")([^'\">]*)\\1[^>]*>", "<img alt='" + HttpContext.Current.Server.HtmlEncode(productName) + "' src='$2' />", RegexOptions.IgnoreCase);
                }
                if (this.litDescription != null)
                {
                    this.litDescription.Text = description;
                }
                this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
                this.litStock.Text         = product.Stock.ToString();
                this.skuSelector.ProductId = this.productId;
                if (this.expandAttr != null)
                {
                    this.expandAttr.ProductId = this.productId;
                }
                if (this.linkDescription != null)
                {
                    this.linkDescription.NavigateUrl = "/Vshop/ProductDescription.aspx?productId=" + this.productId;
                }
                int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(this.productId, false);
                this.litConsultationsCount.SetWhenIsNotNull(productConsultationsCount.ToString());
                this.litReviewsCount.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(this.productId).ToString());
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                bool       flag          = false;
                if (currentMember != null)
                {
                    flag = ProductBrowser.CheckHasCollect(currentMember.UserId, this.productId);
                }
                this.litHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                ProductBrowser.UpdateVisitCounts(this.productId);
                PageTitle.AddSiteNameTitle(productName);
                PageTitle.AddSiteDescription(product.ShortDescription);
                SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                string       objStr         = "";
                if (!string.IsNullOrEmpty(masterSettings.GoodsPic))
                {
                    objStr = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.GoodsPic;
                }
                this.litItemParams.Text = Globals.GetReplaceStr(objStr, "|", "|") + "|" + Globals.GetReplaceStr(masterSettings.GoodsName, "|", "|") + "|" + Globals.GetReplaceStr(masterSettings.GoodsDescription, "|", "|") + "$" + Globals.HostPath(HttpContext.Current.Request.Url).Replace("|", "|") + Globals.GetReplaceStr(product.ImageUrl1, "|", "|") + "|" + Globals.GetReplaceStr(product.ProductName, "|", "|") + "|" + Globals.GetReplaceStr(product.ShortDescription, "|", "|") + "|" + HttpContext.Current.Request.Url.ToString().Replace("|", "|");
            }
            else
            {
                HttpContext.Current.Response.Redirect("/default.aspx");
                HttpContext.Current.Response.End();
            }
        }
Esempio n. 17
0
        protected override void AttachChildControls()
        {
            this.litShipTo            = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
            this.litCellPhone         = (System.Web.UI.WebControls.Literal) this.FindControl("litCellPhone");
            this.litAddress           = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
            this.rptCartProducts      = (WapTemplatedRepeater)this.FindControl("rptCartProducts");
            this.dropCoupon           = (WAP_CouponSelect)this.FindControl("dropCoupon");
            this.litOrderTotal        = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
            this.litPromotionPrice    = (System.Web.UI.WebControls.Literal) this.FindControl("litPromotionPrice");
            this.groupbuyHiddenBox    = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("groupbuyHiddenBox");
            this.selectShipTo         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("selectShipTo");
            this.regionId             = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("regionId");
            this.litProductTotalPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litProductTotalPrice");
            this.rptPromotions        = (WapTemplatedRepeater)this.FindControl("rptPromotions");
            this.litTotalTax          = (System.Web.UI.WebControls.Literal) this.FindControl("litTotalTax");
            this.litToalFreight       = (System.Web.UI.WebControls.Literal) this.FindControl("litToalFreight");
            this.litTotalQuantity     = (System.Web.UI.WebControls.Literal) this.FindControl("litTotalQuantity");
            this.isCustomsClearance   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("isCustomsClearance");
            //this.txtmemberIdentityCard = (System.Web.UI.HtmlControls.HtmlInputText)this.FindControl("txtmemberIdentityCard");
            //this.txtRealName = (System.Web.UI.HtmlControls.HtmlInputText)this.FindControl("txtRealName");
            this.htmlIsCanMergeOrder = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("htmlIsCanMergeOrder");
            this.txtVoucherCode      = (HtmlInputText)this.FindControl("txtVoucherCode");
            this.txtVoucherPwd       = (HtmlInputText)this.FindControl("txtVoucherPwd");
            this.dropVoucher         = (WAP_VoucherSelect)this.FindControl("dropVoucher"); // 现金券列表
            this.litIdentityCard     = (System.Web.UI.WebControls.Literal) this.FindControl("litIdentityCard");
            this.litPoint            = (System.Web.UI.WebControls.Literal) this.FindControl("litPoint");
            System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();
            ShippingAddressInfo shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo item) => item.IsDefault);

            if (shippingAddressInfo == null)
            {
                shippingAddressInfo = ((shippingAddresses.Count > 0) ? shippingAddresses[0] : null);
            }
            if (shippingAddressInfo != null)
            {
                this.litShipTo.Text       = shippingAddressInfo.ShipTo;
                this.litCellPhone.Text    = shippingAddressInfo.CellPhone;
                this.litAddress.Text      = RegionHelper.GetFullRegion(shippingAddressInfo.RegionId, "  ") + shippingAddressInfo.Address;
                this.litIdentityCard.Text = shippingAddressInfo.IdentityCard;
                this.selectShipTo.SetWhenIsNotNull(shippingAddressInfo.ShippingId.ToString());
                this.regionId.SetWhenIsNotNull(shippingAddressInfo.RegionId.ToString());
            }
            if (shippingAddresses == null || shippingAddresses.Count == 0)
            {
                this.Page.Response.Redirect(Globals.ApplicationPath + "/Wapshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
                return;
            }
            ShoppingCartInfo shoppingCartInfo;

            if (int.TryParse(this.Page.Request.QueryString["buyAmount"], out this.buyAmount) && !string.IsNullOrEmpty(this.Page.Request.QueryString["productSku"]) && !string.IsNullOrEmpty(this.Page.Request.QueryString["from"]) && (this.Page.Request.QueryString["from"] == "signBuy" || this.Page.Request.QueryString["from"] == "groupBuy"))
            {
                this.productSku = this.Page.Request.QueryString["productSku"];
                int storeId = 0;
                int.TryParse(this.Page.Request.QueryString["storeId"], out storeId);
                if (int.TryParse(this.Page.Request.QueryString["groupbuyId"], out this.groupBuyId))
                {
                    this.groupbuyHiddenBox.SetWhenIsNotNull(this.groupBuyId.ToString());
                    shoppingCartInfo = ShoppingCartProcessor.GetGroupBuyShoppingCart(this.productSku, this.buyAmount, storeId);
                }
                else
                {
                    shoppingCartInfo = ShoppingCartProcessor.GetShoppingCart(this.productSku, this.buyAmount, storeId);
                }
            }
            else
            {
                if (int.TryParse(this.Page.Request.QueryString["buyAmount"], out this.buyAmount) && !string.IsNullOrEmpty(this.Page.Request.QueryString["productSku"]) && !string.IsNullOrEmpty(this.Page.Request.QueryString["from"]) && this.Page.Request.QueryString["from"] == "countDown")
                {
                    this.productSku = this.Page.Request.QueryString["productSku"];
                    int storeId = 0;
                    int.TryParse(this.Page.Request.QueryString["storeId"], out storeId);
                    if (int.TryParse(this.Page.Request.QueryString["countDownId"], out this.countDownId))
                    {
                        this.groupbuyHiddenBox.SetWhenIsNotNull(this.countDownId.ToString());
                        shoppingCartInfo = ShoppingCartProcessor.GetCountDownShoppingCart(this.productSku, this.buyAmount, storeId);
                    }
                    else
                    {
                        shoppingCartInfo = ShoppingCartProcessor.GetShoppingCart(this.productSku, this.buyAmount, storeId);
                    }
                }
                else
                {
                    //shoppingCartInfo = ShoppingCartProcessor.GetShoppingCart();
                    HttpCookie cookieSkuIds = this.Page.Request.Cookies["UserSession-SkuIds"];
                    if (cookieSkuIds != null && !string.IsNullOrEmpty(cookieSkuIds.Value))
                    {
                        shoppingCartInfo = ShoppingCartProcessor.GetPartShoppingCartInfo(Globals.UrlDecode(cookieSkuIds.Value));//获取用户选择的商品
                    }
                    else
                    {
                        shoppingCartInfo = ShoppingCartProcessor.GetShoppingCart();
                    }
                    if (shoppingCartInfo != null && shoppingCartInfo.GetQuantity() == 0)
                    {
                        //this.buytype = "0";
                    }
                }
            }
            if (shoppingCartInfo != null)
            {
                this.rptCartProducts.DataSource = shoppingCartInfo.LineItems;
                this.rptCartProducts.DataBind();



                #region  获取优惠券筛选条件
                string bindId     = "";
                string categoryId = "";

                List <int> bindIdList     = new List <int>();
                List <int> categoryIdList = new List <int>();

                if (shoppingCartInfo.LineItems != null && shoppingCartInfo.LineItems.Count > 0)
                {
                    shoppingCartInfo.LineItems.ToList().ForEach(t =>
                    {
                        //单品券
                        if (t.ProductId > 0)
                        {
                            bindIdList.Add(t.ProductId);
                        }
                        //商品分类
                        if (t.CategoryId > 0)
                        {
                            categoryIdList.Add(t.CategoryId);
                        }
                        //品牌
                        if (t.BrandId > 0)
                        {
                            bindIdList.Add(t.BrandId);
                        }
                        //供货商
                        if (t.SupplierId > 0)
                        {
                            bindIdList.Add(t.SupplierId);
                        }
                    });
                }

                if (bindIdList != null && bindIdList.Count > 0)
                {
                    bindId = string.Join(",", bindIdList.Distinct().ToArray());
                }
                if (categoryIdList != null && categoryIdList.Count > 0)
                {
                    categoryId = string.Join(",", categoryIdList.Distinct().ToArray());
                }


                #endregion


                decimal totalAmount = shoppingCartInfo.GetNewTotal();
                this.dropVoucher.CartTotal = totalAmount;
                this.dropCoupon.CartTotal  = totalAmount;
                this.dropCoupon.BindId     = bindId;
                this.dropCoupon.CategoryId = categoryId;
                this.litPoint.Text         = shoppingCartInfo.GetPoint().ToString();

                System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <string, string> > list = new System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <string, string> >();
                if (shoppingCartInfo.IsReduced)
                {
                    list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.Reduced), shoppingCartInfo.ReducedPromotionName + string.Format(" 优惠:{0}", shoppingCartInfo.ReducedPromotionAmount.ToString("F2"))));
                }
                if (shoppingCartInfo.IsFreightFree)
                {
                    list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.FullAmountSentFreight), string.Format("{0}", shoppingCartInfo.FreightFreePromotionName)));
                }
                if (shoppingCartInfo.IsSendTimesPoint)
                {
                    list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.FullAmountSentTimesPoint), string.Format("{0}:送{1}倍", shoppingCartInfo.SentTimesPointPromotionName, shoppingCartInfo.TimesPoint.ToString("F2"))));
                }
                if (this.groupBuyId == 0)
                {
                    this.rptPromotions.DataSource = list;
                    this.rptPromotions.DataBind();
                }
                Member currentUser = HiContext.Current.User as Member;
                //this.txtmemberIdentityCard.Value = shippingAddressInfo.IdentityCard;
                //this.txtRealName.Value = shippingAddressInfo.ShipTo;
                #region 是否存在清关商品标识
                bool          isOneTemplateId = true;
                int           templateId      = 0;
                StringBuilder stringBuilder   = new StringBuilder();
                for (int i = 0; i < shoppingCartInfo.LineItems.Count; i++)
                {
                    if (i == (shoppingCartInfo.LineItems.Count - 1))
                    {
                        stringBuilder.Append(shoppingCartInfo.LineItems[i].ProductId);
                    }
                    else
                    {
                        stringBuilder.AppendFormat("{0},", shoppingCartInfo.LineItems[i].ProductId);
                    }
                    if (i == 0)
                    {
                        templateId = shoppingCartInfo.LineItems[i].TemplateId;
                    }
                    else
                    {
                        if (templateId != shoppingCartInfo.LineItems[i].TemplateId)
                        {
                            isOneTemplateId = false;
                        }
                    }
                }
                bool b = ShoppingProcessor.CheckIsCustomsClearance(stringBuilder.ToString());
                if (b)
                {
                    this.isCustomsClearance.Value = "1";//表示存在需要清关的商品
                }
                else
                {
                    this.isCustomsClearance.Value = "0";
                }
                #endregion

                decimal tax           = 0m;//输出税费+运费
                decimal freight       = 0m;
                bool    flag          = groupBuyId > 0;
                int     totalQuantity = 0;
                //Dictionary<int, decimal> dictShippingMode = new Dictionary<int, decimal>();
                foreach (ShoppingCartItemInfo item in shoppingCartInfo.LineItems)
                {
                    totalQuantity += item.Quantity;
                    tax           += item.AdjustedPrice * item.TaxRate * item.Quantity;
                    #region 弃用代码
                    //if ((!shoppingCartInfo.IsFreightFree ||!item.IsfreeShipping|| flag))
                    //{
                    //    if (item.TemplateId > 0)
                    //    {
                    //        if (dictShippingMode.ContainsKey(item.TemplateId))
                    //        {
                    //            dictShippingMode[item.TemplateId] += item.Weight * item.Quantity;
                    //        }
                    //        else
                    //        {
                    //            dictShippingMode.Add(item.TemplateId, item.Weight * item.Quantity);
                    //        }
                    //    }
                    //}
                }
                //foreach (var item in dictShippingMode)//模拟分单,计算运费
                //{
                //    ShippingModeInfo shippingMode = ShoppingProcessor.GetShippingMode(item.Key);
                //    freight += ShoppingProcessor.CalcFreight(shippingAddressInfo.RegionId, item.Value, shippingMode);
                //}
                #endregion
                freight = ShoppingCartProcessor.GetFreight(shoppingCartInfo, shippingAddressInfo.RegionId, false); //ShoppingProcessor.CalcShoppingCartFreight(shoppingCartInfo, shippingAddressInfo.RegionId);
                #region 判断是否符合单条件
                this.htmlIsCanMergeOrder.Value = "0";
                if (templateId != 0 && isOneTemplateId && tax <= 50)
                {
                    bool IsCanMergeOrder = ShoppingProcessor.CheckIsCanMergeOrder(templateId, tax, currentUser.UserId);
                    this.htmlIsCanMergeOrder.Value = IsCanMergeOrder ? "1" : "0";
                }
                #endregion

                //this.litTotalTax.Text =(tax<50?"0.00":tax.ToString("F2"));
                decimal totaltax = shoppingCartInfo.GetNewTotalTax();
                this.litTotalTax.Text          = (totaltax < 50 ? "0.00" : totaltax.ToString("F2"));
                this.litToalFreight.Text       = freight == 0 ? "0.00" : freight.ToString("F2");
                this.litProductTotalPrice.Text = shoppingCartInfo.GetTotal().ToString("F2");

                //tax=tax<50?0:tax;
                totaltax = totaltax < 50 ? 0 : totaltax;

                this.litOrderTotal.Text = (shoppingCartInfo.GetNewTotal() + totaltax + freight).ToString("F2");//总额=商品调整后价格+运费+税费 -活动优惠

                //活动优惠
                this.litPromotionPrice.Text = shoppingCartInfo.GetActivityPrice().ToString("F2");
                this.litTotalQuantity.Text  = totalQuantity.ToString();
            }

            else
            {
                this.Page.Response.Redirect("ShoppingCart.aspx");
            }
            PageTitle.AddSiteNameTitle("订单确认");

            WAPHeadName.AddHeadName("确认订单");
        }
Esempio n. 18
0
        protected override void AttachChildControls()
        {
            this.litShipTo       = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
            this.litIsUseBalance = (System.Web.UI.WebControls.Literal) this.FindControl("litIsUseBalance");
            this.litCellPhone    = (System.Web.UI.WebControls.Literal) this.FindControl("litCellPhone");
            this.litAddress      = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
            this.litShowMes      = (System.Web.UI.WebControls.Literal) this.FindControl("litShowMes");
            this.GetUserCoupons  = MemberProcessor.GetUserCoupons();
            this.rptCartProducts = (VshopTemplatedRepeater)this.FindControl("rptCartProducts");
            this.rptCartProducts.ItemDataBound += new System.Web.UI.WebControls.RepeaterItemEventHandler(this.rptCartProducts_ItemDataBound);
            this.litOrderTotal          = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderTotal");
            this.litPointNumber         = (System.Web.UI.WebControls.Literal) this.FindControl("litPointNumber");
            this.litUseMembersPointShow = (System.Web.UI.WebControls.Literal) this.FindControl("litUseMembersPointShow");
            this.litDisplayPointNumber  = (System.Web.UI.WebControls.Literal) this.FindControl("litDisplayPointNumber");
            this.litDisplayPoint        = (System.Web.UI.WebControls.Literal) this.FindControl("litDisplayPoint");
            this.BalanceCanPayMoney     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("BalanceCanPayMoney");
            this.groupbuyHiddenBox      = (System.Web.UI.HtmlControls.HtmlInputControl) this.FindControl("groupbuyHiddenBox");
            this.rptAddress             = (VshopTemplatedRepeater)this.FindControl("rptAddress");
            this.selectShipTo           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("selectShipTo");
            this.MembersPointMoney      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("MembersPointMoney");
            this.regionId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("regionId");
            this.litAddAddress = (System.Web.UI.WebControls.Literal) this.FindControl("litAddAddress");

            if (Globals.GetCurrentDistributorId() == CurrentMemberInfo.UserId)
            {
                base.GotoResourceNotFound("站点管理员无法在自己店内购买!");
                return;
            }
            if (Globals.GetCurrentDistributorId() == 0)//CurrentMemberInfo.ReferralUserId ==0  &&
            {
                base.GotoResourceNotFound("请先扫码关注站点后再下单!");
                return;
            }


            System.Collections.Generic.IList <ShippingAddressInfo> shippingAddresses = MemberProcessor.GetShippingAddresses();
            this.rptAddress.DataSource = from item in shippingAddresses
                                         orderby item.IsDefault
                                         select item;

            this.rptAddress.DataBind();
            ShippingAddressInfo shippingAddressInfo = shippingAddresses.FirstOrDefault((ShippingAddressInfo item) => item.IsDefault);

            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["startDate"]))
            {
                this.SendStartDate = DateTime.Parse(this.Page.Request.QueryString["startDate"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["quantityPerDay"]))
            {
                this.QuantityPerDay = Convert.ToInt32(this.Page.Request.QueryString["quantityPerDay"]);
            }
            if (!string.IsNullOrEmpty(this.Page.Request.QueryString["sendDays"]))
            {
                this.SendDays = Convert.ToInt32(this.Page.Request.QueryString["sendDays"]);
            }


            if (shippingAddressInfo == null)
            {
                shippingAddressInfo = ((shippingAddresses.Count > 0) ? shippingAddresses[0] : null);
            }
            if (shippingAddressInfo != null)
            {
                this.litShipTo.Text    = shippingAddressInfo.ShipTo;
                this.litCellPhone.Text = shippingAddressInfo.CellPhone;
                this.litAddress.Text   = shippingAddressInfo.Address;
                this.selectShipTo.SetWhenIsNotNull(shippingAddressInfo.ShippingId.ToString());
                this.regionId.SetWhenIsNotNull(shippingAddressInfo.RegionId.ToString());
            }
            this.litAddAddress.Text = "<li><a href='/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()) + "'>新增收货地址</a></li>";
            if (shippingAddresses == null || shippingAddresses.Count == 0)
            {
                this.Page.Response.Redirect(Globals.ApplicationPath + "/Vshop/AddShippingAddress.aspx?returnUrl=" + Globals.UrlEncode(System.Web.HttpContext.Current.Request.Url.ToString()));
            }
            else
            {
                System.Collections.Generic.List <ShoppingCartInfo> list = new System.Collections.Generic.List <ShoppingCartInfo>();
                if (int.TryParse(this.Page.Request.QueryString["buyAmount"], out this.buyAmount) && !string.IsNullOrEmpty(this.Page.Request.QueryString["productSku"]) && !string.IsNullOrEmpty(this.Page.Request.QueryString["from"]) && (this.Page.Request.QueryString["from"] == "signBuy" || this.Page.Request.QueryString["from"] == "groupBuy"))
                {
                    this.productSku = this.Page.Request.QueryString["productSku"];
                    if (this.isbargain)
                    {
                        int bargainDetialId = Globals.RequestQueryNum("bargainDetialId");
                        list = ShoppingCartProcessor.GetListShoppingCart(this.productSku, this.buyAmount, bargainDetialId, 0);
                    }
                    else
                    {
                        int num  = this.buyAmount;
                        int num2 = Globals.RequestQueryNum("limitedTimeDiscountId");
                        if (num2 > 0)
                        {
                            bool flag = true;
                            LimitedTimeDiscountInfo discountInfo = LimitedTimeDiscountHelper.GetDiscountInfo(num2);
                            if (discountInfo == null)
                            {
                                flag = false;
                            }
                            if (flag)
                            {
                                if (MemberHelper.CheckCurrentMemberIsInRange(discountInfo.ApplyMembers, discountInfo.DefualtGroup, discountInfo.CustomGroup, this.CurrentMemberInfo.UserId))
                                {
                                    if (discountInfo.LimitNumber != 0)
                                    {
                                        int limitedTimeDiscountUsedNum = ShoppingCartProcessor.GetLimitedTimeDiscountUsedNum(num2, this.productSku, 0, this.CurrentMemberInfo.UserId, false);
                                        if (this.buyAmount > discountInfo.LimitNumber - limitedTimeDiscountUsedNum)
                                        {
                                            num = discountInfo.LimitNumber - limitedTimeDiscountUsedNum;
                                        }
                                    }
                                }
                                else
                                {
                                    num2 = 0;
                                }
                            }
                            else
                            {
                                num2 = 0;
                            }
                        }
                        if (num2 > 0)
                        {
                            ShoppingCartProcessor.RemoveLineItem(this.productSku, 0, num2);
                        }
                        if (num == 0 && num2 > 0)
                        {
                            num  = this.buyAmount;
                            num2 = 0;
                        }
                        list = ShoppingCartProcessor.GetListShoppingCart(SendStartDate, QuantityPerDay, SendDays, this.productSku, num, 0, num2);
                    }
                }
                else
                {
                    list = ShoppingCartProcessor.GetOrderSummitCart();
                }
                if (list == null)
                {
                    System.Web.HttpContext.Current.Response.Write("<script>alert('商品已下架或没有需要结算的订单!');location.href='/Vshop/ShoppingCart.aspx'</script>");
                }
                else
                {
                    if (list.Count > 1)
                    {
                        this.litShowMes.Text = "<div style=\"color: #F60; \"><img  src=\"/Utility/pics/u77.png\">您所购买的商品不支持同一个物流规则发货,系统自动拆分成多个子订单处理</div>";
                    }
                    this.rptCartProducts.DataSource = list;
                    this.rptCartProducts.DataBind();
                    decimal d    = 0m;
                    decimal num3 = 0m;
                    decimal d2   = 0m;
                    int     num4 = 0;
                    foreach (ShoppingCartInfo current in list)
                    {
                        num4 += current.GetPointNumber;
                        d    += current.Total;
                        num3 += current.Exemption;
                        d2   += current.ShipCost;
                    }
                    decimal d3   = num3;
                    decimal num5 = d - d3;
                    if (num5 <= 0m)
                    {
                        num5 = 0m;
                    }
                    num5 = decimal.Round(num5, 2);
                    this.litOrderTotal.Text = num5.ToString("F2");
                    if (num4 == 0)
                    {
                        this.litDisplayPointNumber.Text = "style=\"display:none;\"";
                    }
                    this.litPointNumber.Text = num4.ToString();
                    int          num6           = this.CurrentMemberInfo.Points - num4;
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);
                    decimal      num7;
                    if (num5 * masterSettings.PointToCashRate > this.CurrentMemberInfo.Points)
                    {
                        if (num6 > masterSettings.PonitToCash_MaxAmount * masterSettings.PointToCashRate)
                        {
                            num7 = masterSettings.PonitToCash_MaxAmount;
                            num6 = (int)masterSettings.PonitToCash_MaxAmount * masterSettings.PointToCashRate;
                        }
                        else
                        {
                            num7 = num6 / masterSettings.PointToCashRate;
                        }
                    }
                    else
                    {
                        num7 = masterSettings.PonitToCash_MaxAmount;
                        if (num7 > num5)
                        {
                            num7 = num5;
                        }
                        num7 = decimal.Round(num7, 2);
                        num6 = (int)(num7 * masterSettings.PointToCashRate);
                    }
                    if (num6 <= 0)
                    {
                        num6 = 0;
                        num7 = 0m;
                    }
                    this.MembersPointMoney.Value = num7.ToString("F2");
                    if (num6 > 0)
                    {
                        this.litUseMembersPointShow.Text = string.Concat(new object[]
                        {
                            "<input type='hidden' id='hdCanUsePoint' value='",
                            num6,
                            "'/><input type='hidden' id='hdCanUsePointMoney' value='",
                            num7.ToString("F2"),
                            "'/><div class=\"prompt-text pull-left\" id=\"divUseMembersPointShow\">可用<span  id=\"usepointnum\">",
                            num6,
                            "</span>积分抵 <span class=\"colorr\">¥<span  id=\"usepointmoney\">",
                            num7.ToString("F2"),
                            "</span></span>元</div><div class=\"switch pull-right\" id=\"mySwitchUseMembersPoint\"><input  type=\"checkbox\" /></div>"
                        });
                    }
                    else
                    {
                        this.litUseMembersPointShow.Text = "<input type='hidden' id='hdCanUsePoint' value='0'/><input type='hidden' id='hdCanUsePointMoney' value='0'/><div class=\"prompt-text pull-left\" id=\"divUseMembersPointShow\">可用<span  id=\"usepointnum\">0</span>积分 <span  id=\"usepointmoney\" style=\"display:none\">" + num7.ToString("F2") + "</span></div><div class=\"switch pull-right\" id=\"mySwitchUseMembersPoint\" style=\"display:none\"><input type=\"checkbox\" disabled /></div>";
                    }
                    decimal d4;
                    if (num5 > this.CurrentMemberInfo.AvailableAmount)
                    {
                        d4 = this.CurrentMemberInfo.AvailableAmount;
                        this.BalanceCanPayMoney.Value = this.CurrentMemberInfo.AvailableAmount.ToString("F2");
                    }
                    else
                    {
                        d4 = num5;
                        this.BalanceCanPayMoney.Value = num5.ToString("F2");
                    }
                    if (this.CurrentMemberInfo.AvailableAmount > 0m && masterSettings.EnableBalancePayment)
                    {
                        this.litIsUseBalance.Text = string.Concat(new string[]
                        {
                            "<div class=\"prompt-text pull-left\">余额支付 <span class=\"colorr\">¥<span id=\"spCanpayMoney\">",
                            d4.ToString("F2"),
                            "</span></span>(可用 ¥<span id=\"spAvailableAmount\">",
                            this.CurrentMemberInfo.AvailableAmount.ToString("F2"),
                            "</span>)</div><div class=\"switch pull-right\" id=\"mySwitchUseBalance\"><input type=\"checkbox\" ",
                            (d4 > 0m) ? "" : " disabled",
                            " /></div></div>"
                        });
                    }
                    else
                    {
                        this.litIsUseBalance.Text = "<div class=\"prompt-text pull-left\"" + (masterSettings.EnableBalancePayment ? "" : " style=\"display:none\"") + ">余额可用 <span class=\"colorr\">¥<span id=\"spCanpayMoney\">0.00</span></span><span id=\"spAvailableAmount\" style=\"display:none\">0.00</span></div><div class=\"switch pull-right\" id=\"mySwitchUseBalance\" style=\"display:none\"><input type=\"checkbox\" disabled /></div></div>";
                    }
                    if (!masterSettings.PonitToCash_Enable)
                    {
                        this.litDisplayPoint.Text = " style=\"display:none;\"";
                    }
                    PageTitle.AddSiteNameTitle("订单确认");
                }
            }
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            wid = GetCurWebId();
            if (string.IsNullOrEmpty(wid))
            {
                return;
            }

            if (base.IsPostBack)
            {
                goto Label_0829;
            }
            if (!(this.type == "getarticleinfo"))
            {
                if ((this.type == "subscribe") && (this.replyID == 0))
                {
                    this.replyID = ReplyHelper.GetSubscribeID(0, this.wid);
                    if (this.replyID > 0)
                    {
                        base.Response.Redirect("replyedit.aspx?type=subscribe&id=" + this.replyID);
                        base.Response.End();
                    }
                    this.rbtlMatchType.SelectedIndex = 0;
                    if (string.IsNullOrEmpty(this.htmlInfo))
                    {
                        this.htmlInfo = "<div class=\"exit-shop-info\">内容区</div>";
                    }
                    this.litInfo.Text = this.htmlInfo;
                }
                else
                {
                    if (this.replyID > 0)
                    {
                        this.htmlTitle = "修改自动回复";
                        Hidistro.Entities.VShop.ReplyInfo reply = ReplyHelper.GetReply(this.replyID);
                        if (reply == null)
                        {
                            base.Response.Redirect("replyonkey.aspx");
                            base.Response.End();
                        }
                        else
                        {
                            MessageType messageType = reply.MessageType;
                            if (ReplyType.NoMatch == reply.ReplyType)
                            {
                                this.txtKeys.Text = "*";
                            }
                            else if (ReplyType.Subscribe == reply.ReplyType)
                            {
                                this.txtKeys.Text = "";
                                if (this.type != "subscribe")
                                {
                                    base.Response.Redirect("replyedit.aspx?type=subscribe&id=" + this.replyID);
                                    base.Response.End();
                                }
                            }
                            else
                            {
                                this.txtKeys.Text = reply.Keys.Trim();
                            }
                            for (int i = 0; i < this.rbtlMatchType.Items.Count; i++)
                            {
                                if (this.rbtlMatchType.Items[i].Value == ((int)reply.MatchType).ToString())
                                {
                                    this.rbtlMatchType.Items[i].Selected = true;
                                    break;
                                }
                            }
                            this.hdfMessageType.Value = ((int)reply.MessageType).ToString();
                            this.hdfArticleID.Value   = reply.ArticleID.ToString();
                            int articleID = reply.ArticleID;
                            switch (messageType)
                            {
                            case MessageType.Text:
                            {
                                TextReplyInfo info7 = ReplyHelper.GetReply(this.replyID) as TextReplyInfo;
                                if (info7 != null)
                                {
                                    string str2 = Regex.Replace(Regex.Replace(info7.Text, "</?([^>^a^p]*)>", ""), "<img([^>]*)>", "").Replace("</p>", "\r\n").Replace("<p>", "");
                                    this.fkContent.Text = str2;
                                }
                                break;
                            }

                            case MessageType.News:
                                if (articleID <= 0)
                                {
                                    this.hdfIsOldArticle.Value = "1";
                                    NewsReplyInfo info6 = ReplyHelper.GetReply(this.replyID) as NewsReplyInfo;
                                    if (((info6 != null) && (info6.NewsMsg != null)) && (info6.NewsMsg.Count != 0))
                                    {
                                        this.htmlInfo = "<div class=\"mate-inner\"><h3 id=\"singelTitle\">" + info6.NewsMsg[0].Title + "</h3><span>" + info6.LastEditDate.ToString("M月d日") + "</span><div class=\"mate-img\"><img id=\"img1\" src=\"" + info6.NewsMsg[0].PicUrl + "\" class=\"img-responsive\"></div><div class=\"mate-info\" id=\"Lbmsgdesc\">" + info6.NewsMsg[0].Description + "</div><div class=\"red-all clearfix\"><strong class=\"fl\">查看全文</strong><em class=\"fr\">&gt;</em></div></div>";
                                    }
                                }
                                break;

                            case MessageType.List:
                                if (articleID <= 0)
                                {
                                    this.hdfIsOldArticle.Value = "1";
                                    NewsReplyInfo info4 = ReplyHelper.GetReply(this.replyID) as NewsReplyInfo;
                                    if (info4 != null)
                                    {
                                        StringBuilder builder2 = new StringBuilder();
                                        if ((info4.NewsMsg != null) && (info4.NewsMsg.Count > 0))
                                        {
                                            int num4 = 0;
                                            foreach (NewsMsgInfo info5 in info4.NewsMsg)
                                            {
                                                num4++;
                                                if (num4 == 1)
                                                {
                                                    builder2.Append("<div class=\"mate-inner top\">                 <div class=\"mate-img\" >                     <img id=\"img1\" src=\"" + info5.PicUrl + "\" class=\"img-responsive\">                     <div class=\"title\" id=\"title1\">" + info5.Title + "</div>                 </div>             </div>");
                                                }
                                                else
                                                {
                                                    builder2.Append("             <div class=\"mate-inner\">                 <div class=\"child-mate\">                     <div class=\"child-mate-title clearfix\">                         <div class=\"title\">" + info5.Title + "</div>                         <div class=\"img\">                             <img src=\"" + info5.PicUrl + "\" class=\"img-responsive\">                         </div>                     </div>                 </div>             </div>");
                                                }
                                            }
                                            this.htmlInfo = builder2.ToString();
                                        }
                                    }
                                }
                                break;
                            }
                        }
                    }
                    if (string.IsNullOrEmpty(this.htmlInfo))
                    {
                        this.htmlInfo = "<div class=\"exit-shop-info\">内容区</div>";
                    }
                    this.litInfo.Text = this.htmlInfo;
                }
                goto Label_0829;
            }
            base.Response.ContentType = "application/json";
            string s         = "{\"type\":\"0\",\"tips\":\"操作失败\"}";
            int    articleid = Globals.RequestFormNum("articleid");

            if (articleid > 0)
            {
                ArticleInfo articleInfo = ArticleHelper.GetArticleInfo(articleid);
                if (articleInfo != null)
                {
                    StringBuilder builder = new StringBuilder();
                    switch (articleInfo.ArticleType)
                    {
                    case ArticleType.News:
                        s = string.Concat(new object[] { "{\"type\":\"1\",\"articletype\":", (int)articleInfo.ArticleType, ",\"title\":\"", String2Json(articleInfo.Title), "\",\"date\":\"", String2Json(articleInfo.PubTime.ToString("M月d日")), "\",\"imgurl\":\"", String2Json(articleInfo.ImageUrl), "\",\"memo\":\"", String2Json(articleInfo.Memo), "\"}" });
                        goto Label_0301;

                    case ArticleType.List:
                        foreach (ArticleItemsInfo info2 in articleInfo.ItemsInfo)
                        {
                            builder.Append("{\"title\":\"" + String2Json(info2.Title) + "\",\"imgurl\":\"" + String2Json(info2.ImageUrl) + "\"},");
                        }
                        s = string.Concat(new object[] { "{\"type\":\"1\",\"articletype\":", (int)articleInfo.ArticleType, ",\"title\":\"", String2Json(articleInfo.Title), "\",\"date\":\"", String2Json(articleInfo.PubTime.ToString("M月d日")), "\",\"imgurl\":\"", String2Json(articleInfo.ImageUrl), "\",\"items\":[", builder.ToString().Trim(new char[] { ',' }), "]}" });
                        goto Label_0301;
                    }
                    s = string.Concat(new object[] { "{\"type\":\"1\",\"articletype\":", (int)articleInfo.ArticleType, ",\"title\":\"", String2Json(articleInfo.Title), "\",\"date\":\"", String2Json(articleInfo.PubTime.ToString("M月d日")), "\",\"imgurl\":\"", String2Json(articleInfo.ImageUrl), "\",\"memo\":\"", String2Json(articleInfo.Content), "\"}" });
                }
            }
Label_0301:
            base.Response.Write(s);
            base.Response.End();
Label_0829:
            PageTitle.AddSiteNameTitle(this.htmlTitle);
        }
Esempio n. 20
0
        protected override void AttachChildControls()
        {
            int num;
            int num2;

            if (!int.TryParse(this.Page.Request.QueryString["productId"], out this.productId))
            {
                base.GotoResourceNotFound("");
            }
            this.litProdcutName      = (Literal)this.FindControl("litProdcutName");
            this.litSalePrice        = (Literal)this.FindControl("litSalePrice");
            this.litShortDescription = (Literal)this.FindControl("litShortDescription");
            this.litSoldCount        = (Literal)this.FindControl("litSoldCount");
            this.productImage        = (HtmlImage)this.FindControl("productImage");
            this.productLink         = (HyperLink)this.FindControl("productLink");
            this.txtTotal            = (HtmlInputHidden)this.FindControl("txtTotal");
            this.litPID     = (Literal)this.FindControl("litPID");
            this.litSkuId   = (Literal)this.FindControl("litSkuId");
            this.litItemid  = (Literal)this.FindControl("litItemid");
            this.litOrderId = (Literal)this.FindControl("litOrderId");
            string orderID = this.Page.Request["OrderId"];
            string str2    = "";

            this.litSkuId.Text  = Globals.RequestQueryStr("skuid");
            this.litItemid.Text = Globals.RequestQueryNum("itemid").ToString();
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (!string.IsNullOrEmpty(orderID))
            {
                this.litOrderId.Text = orderID;
                OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(orderID);
                if ((orderInfo != null) && (orderInfo.ReferralUserId > 0))
                {
                    str2 = "&&ReferralId=" + orderInfo.ReferralUserId;
                }
            }
            else
            {
                LineItemInfo latestOrderItemByProductIDAndUserID = ProductBrowser.GetLatestOrderItemByProductIDAndUserID(this.productId, currentMember.UserId);
                if (latestOrderItemByProductIDAndUserID != null)
                {
                    orderID = latestOrderItemByProductIDAndUserID.OrderID;
                    this.Page.Response.Redirect(string.Concat(new object[] { "ProductReview.aspx?OrderId=", orderID, "&ProductId=", latestOrderItemByProductIDAndUserID.ProductId, "&skuid=", latestOrderItemByProductIDAndUserID.SkuId, "&itemid=", latestOrderItemByProductIDAndUserID.ID }));
                    this.Page.Response.End();
                }
                if (Globals.GetCurrentDistributorId() > 0)
                {
                    str2 = "&&ReferralId=" + Globals.GetCurrentDistributorId().ToString();
                }
            }
            ProductInfo product = ProductBrowser.GetProduct(currentMember, this.productId);

            this.litProdcutName.SetWhenIsNotNull(product.ProductName);
            this.litSalePrice.SetWhenIsNotNull(product.MinSalePrice.ToString("F2"));
            this.litShortDescription.SetWhenIsNotNull(product.ShortDescription);
            this.litSoldCount.SetWhenIsNotNull(product.ShowSaleCounts.ToString());
            this.productImage.Src        = product.ThumbnailUrl180;
            this.litPID.Text             = this.productId.ToString();
            this.productLink.NavigateUrl = "/ProductDetails.aspx?ProductId=" + product.ProductId + str2;
            if (!int.TryParse(this.Page.Request.QueryString["page"], out num))
            {
                num = 1;
            }
            if (!int.TryParse(this.Page.Request.QueryString["size"], out num2))
            {
                num2 = 20;
            }
            ProductReviewQuery reviewQuery = new ProductReviewQuery {
                productId = this.productId,
                IsCount   = true,
                PageIndex = num,
                PageSize  = num2,
                SortBy    = "ReviewId",
                SortOrder = SortAction.Desc
            };

            this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            DbQueryResult productReviews = ProductBrowser.GetProductReviews(reviewQuery);

            this.rptProducts.DataSource = productReviews.Data;
            this.rptProducts.DataBind();
            this.txtTotal.SetWhenIsNotNull(productReviews.TotalRecords.ToString());
            PageTitle.AddSiteNameTitle("商品评价");
        }
Esempio n. 21
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["id"], out this.id))
            {
                base.GotoResourceNotFound("");
            }
            PointExChangeInfo info = PointExChangeHelper.Get(this.id);

            if (info != null)
            {
                this.hideImgUrl      = (HtmlInputHidden)this.FindControl("hideImgUrl");
                this.hideTitle       = (HtmlInputHidden)this.FindControl("hideTitle");
                this.hideDesc        = (HtmlInputHidden)this.FindControl("hideDesc");
                this.hideTitle.Value = info.Name;
                this.hideDesc.Value  = "活动时间:" + info.BeginDate.ToString("yyyy-MM-dd HH:mm:ss") + "至" + info.EndDate.ToString("yyyy-MM-dd HH:mm:ss");
                Uri    url    = HttpContext.Current.Request.Url;
                string imgUrl = info.ImgUrl;
                string str2   = string.Empty;
                if (!string.IsNullOrEmpty(imgUrl))
                {
                    if (!imgUrl.StartsWith("http"))
                    {
                        str2 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                    }
                    this.hideImgUrl.Value = str2 + imgUrl;
                }
                PageTitle.AddSiteNameTitle(info.Name);
                this.imgCover = (Image)this.FindControl("imgCover");
                if (!string.IsNullOrEmpty(info.ImgUrl))
                {
                    this.imgCover.ImageUrl = info.ImgUrl;
                }
                else
                {
                    this.imgCover.Visible = false;
                }
                MemberInfo currentMember = MemberProcessor.GetCurrentMember();
                this.litPoints = (Literal)this.FindControl("litPoints");
                if (currentMember != null)
                {
                    this.hiddisInRange    = (HtmlInputHidden)this.FindControl("hiddisInRange");
                    this.hiddUserId       = (HtmlInputHidden)this.FindControl("hiddUserId");
                    this.litPoints.Text   = currentMember.Points.ToString();
                    this.hiddUserId.Value = currentMember.UserId.ToString();
                    if (MemberProcessor.CheckCurrentMemberIsInRange(info.MemberGrades, info.DefualtGroup, info.CustomGroup))
                    {
                        this.hiddisInRange.Value = "true";
                    }
                    else
                    {
                        this.hiddisInRange.Value = "false";
                    }
                }
                else
                {
                    this.litPoints.Text = "请先登录";
                }
            }
            else
            {
                HttpContext.Current.Response.Redirect("/default.aspx");
                HttpContext.Current.Response.End();
            }
        }
Esempio n. 22
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["bargainId"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            int num = int.Parse(this.Page.Request.QueryString["bargainDetialId"]);

            this.litProdcutName              = (System.Web.UI.WebControls.Literal) this.FindControl("litProdcutName");
            this.litShortDescription         = (System.Web.UI.WebControls.Literal) this.FindControl("litShortDescription");
            this.litSalePrice                = (System.Web.UI.WebControls.Literal) this.FindControl("litSalePrice");
            this.litFloorPrice               = (System.Web.UI.WebControls.Literal) this.FindControl("litFloorPrice");
            this.litPurchaseNumber           = (System.Web.UI.WebControls.Literal) this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (System.Web.UI.WebControls.Literal) this.FindControl("litParticipantNumber");
            this.litProductDesc              = (System.Web.UI.WebControls.Literal) this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (System.Web.UI.WebControls.Literal) this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (System.Web.UI.WebControls.Literal) this.FindControl("litProductCommentTotal");
            this.litStock           = (System.Web.UI.WebControls.Literal) this.FindControl("litStock");
            this.litPurcharseNum    = (System.Web.UI.WebControls.Literal) this.FindControl("litPurcharseNum");
            this.hiddHasCollected   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddHasCollected");
            this.hiddProductId      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddProductId");
            this.hiddEndDate        = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddPurchaseNumber");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.hideTitle          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideTitle");
            this.hideImgUrl         = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideImgUrl");
            this.hideDesc           = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hideDesc");
            MemberInfo        currentMember     = MemberProcessor.GetCurrentMember();
            bool              flag              = false;
            BargainInfo       bargainInfo       = BargainHelper.GetBargainInfo(this.bargainId);
            BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(num);

            if (bargainInfo != null)
            {
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.GetHelpBargainDetialCount(num).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                this.litPurcharseNum.Text      = bargainInfo.PurchaseNumber.ToString();
                this.hideTitle.Value           = bargainInfo.Title;
                this.hideDesc.Value            = bargainInfo.Remarks.Replace("\n", " ").Replace("\r", "");
                string     activityCover = bargainInfo.ActivityCover;
                string     str           = string.Empty;
                System.Uri url           = System.Web.HttpContext.Current.Request.Url;
                if (!activityCover.StartsWith("http"))
                {
                    str = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                if (bargainDetialInfo != null)
                {
                    this.litSalePrice.Text = bargainDetialInfo.Price.ToString("F2");
                }
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                    this.litProdcutName.Text      = productDetails.ProductName;
                    this.litShortDescription.Text = bargainInfo.Remarks;
                    this.hideImgUrl.Value         = (string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str + activityCover) : (str + productDetails.ThumbnailUrl60));
                    this.litProductDesc.Text      = productDetails.Description;
                    if (this.rptProductImages != null)
                    {
                        string       locationUrl = "javascript:;";
                        SlideImage[] source      = new SlideImage[]
                        {
                            new SlideImage(productDetails.ImageUrl1, locationUrl),
                            new SlideImage(productDetails.ImageUrl2, locationUrl),
                            new SlideImage(productDetails.ImageUrl3, locationUrl),
                            new SlideImage(productDetails.ImageUrl4, locationUrl),
                            new SlideImage(productDetails.ImageUrl5, locationUrl)
                        };
                        this.rptProductImages.DataSource = from item in source
                                                           where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                           select item;
                        this.rptProductImages.DataBind();
                    }
                    int num2 = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                    this.litProductConsultationTotal.SetWhenIsNotNull(num2.ToString());
                    num2 = ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId);
                    this.litProductCommentTotal.SetWhenIsNotNull(num2.ToString());
                }
            }
        }
Esempio n. 23
0
 protected override void AttachChildControls()
 {
     if (!int.TryParse(this.Page.Request.QueryString["articleId"], out this.articleId))
     {
         base.GotoResourceNotFound("");
     }
     this.txtCatgoryId          = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtCatgoryId");
     this.litArticleAddedDate   = (FormatedTimeLabel)this.FindControl("litArticleAddedDate");
     this.litArticleContent     = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleContent");
     this.litArticleDescription = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleDescription");
     this.litArticleTitle       = (System.Web.UI.WebControls.Literal) this.FindControl("litArticleTitle");
     this.lblFront      = (System.Web.UI.WebControls.Label) this.FindControl("lblFront");
     this.lblNext       = (System.Web.UI.WebControls.Label) this.FindControl("lblNext");
     this.lblFrontTitle = (System.Web.UI.WebControls.Label) this.FindControl("lblFrontTitle");
     this.lblNextTitle  = (System.Web.UI.WebControls.Label) this.FindControl("lblNextTitle");
     this.aFront        = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("front");
     this.aNext         = (System.Web.UI.HtmlControls.HtmlAnchor) this.FindControl("next");
     this.ariticlative  = (Common_ArticleRelative)this.FindControl("list_Common_ArticleRelative");
     if (!this.Page.IsPostBack)
     {
         ArticleInfo article = CommentBrowser.GetArticle(this.articleId);
         if (article != null && article.IsRelease)
         {
             if (this.txtCatgoryId != null)
             {
                 this.txtCatgoryId.Value = article.CategoryId.ToString();
             }
             PageTitle.AddSiteNameTitle(article.Title);
             if (!string.IsNullOrEmpty(article.MetaKeywords))
             {
                 MetaTags.AddMetaKeywords(article.MetaKeywords, HiContext.Current.Context);
             }
             if (!string.IsNullOrEmpty(article.MetaDescription))
             {
                 MetaTags.AddMetaDescription(article.MetaDescription, HiContext.Current.Context);
             }
             this.litArticleTitle.Text       = article.Title;
             this.litArticleDescription.Text = article.Description;
             string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("ArticleDetails", new object[]
             {
                 this.articleId
             });
             this.litArticleContent.Text   = article.Content.Replace("href=\"#\"", "href=\"" + str + "\"");
             this.litArticleAddedDate.Time = article.AddedDate;
             ArticleInfo frontOrNextArticle = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Front", article.CategoryId);
             if (frontOrNextArticle != null && frontOrNextArticle.ArticleId > 0)
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible   = true;
                     this.aFront.HRef        = "/WapShop/ArticleDetails.aspx?ArticleId=" + frontOrNextArticle.ArticleId;
                     this.lblFrontTitle.Text = frontOrNextArticle.Title;
                 }
             }
             else
             {
                 if (this.lblFront != null)
                 {
                     this.lblFront.Visible = false;
                 }
             }
             ArticleInfo frontOrNextArticle2 = CommentBrowser.GetFrontOrNextArticle(this.articleId, "Next", article.CategoryId);
             if (frontOrNextArticle2 != null && frontOrNextArticle2.ArticleId > 0)
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible   = true;
                     this.aNext.HRef        = "/WapShop/ArticleDetails.aspx?ArticleId=" + frontOrNextArticle2.ArticleId;
                     this.lblNextTitle.Text = frontOrNextArticle2.Title;
                     return;
                 }
             }
             else
             {
                 if (this.lblNext != null)
                 {
                     this.lblNext.Visible = false;
                 }
             }
         }
     }
 }
Esempio n. 24
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("下级分销商");
            this.litMysubMember = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubMember");
            this.litMysubFirst  = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubFirst");
            this.litMysubSecond = (System.Web.UI.WebControls.Literal) this.FindControl("litMysubSecond");
            int currentMemberUserId             = Globals.GetCurrentMemberUserId(false);
            DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);

            this.litUserId      = (System.Web.UI.WebControls.Literal) this.FindControl("litUserId");
            this.litUserId.Text = userIdDistributors.UserId.ToString();
            DataTable distributorsSubStoreNum = VShopHelper.GetDistributorsSubStoreNum(userIdDistributors.UserId);

            if (distributorsSubStoreNum != null || distributorsSubStoreNum.Rows.Count > 0)
            {
                this.litMysubMember.Text = distributorsSubStoreNum.Rows[0]["memberCount"].ToString();
                this.litMysubFirst.Text  = distributorsSubStoreNum.Rows[0]["firstV"].ToString();
                this.litMysubSecond.Text = distributorsSubStoreNum.Rows[0]["secondV"].ToString();
            }
            else
            {
                this.litMysubMember.Text = "0";
                this.litMysubFirst.Text  = "0";
                this.litMysubSecond.Text = "0";
            }
            this.rpdistributor = (VshopTemplatedRepeater)this.FindControl("rpdistributor");
            this.hiddTotal     = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("hiddTotal");
            DistributorsQuery distributorsQuery = new DistributorsQuery();

            distributorsQuery.PageIndex = 0;
            distributorsQuery.PageSize  = 10;
            DistributorsInfo currentDistributors = DistributorsBrower.GetCurrentDistributors(Globals.GetCurrentMemberUserId(false), true);

            if (currentDistributors.ReferralStatus != 0)
            {
                System.Web.HttpContext.Current.Response.Redirect("MemberCenter.aspx");
            }
            else
            {
                distributorsQuery.GradeId = 2;
                int gradeId = 0;
                if (int.TryParse(this.Page.Request.QueryString["gradeId"], out gradeId))
                {
                    distributorsQuery.GradeId = gradeId;
                }
                distributorsQuery.ReferralPath = currentDistributors.UserId.ToString();
                distributorsQuery.UserId       = currentDistributors.UserId;
                string text = this.Page.Request.QueryString["sort"];
                if (string.IsNullOrWhiteSpace(text))
                {
                    text = "CreateTime";
                }
                string text2 = this.Page.Request.QueryString["order"];
                if (string.IsNullOrWhiteSpace(text2))
                {
                    text2 = "desc";
                }
                int       num = 0;
                DataTable downDistributors = DistributorsBrower.GetDownDistributors(distributorsQuery, out num, text, text2);
                this.hiddTotal.Value          = num.ToString();
                this.rpdistributor.DataSource = downDistributors;
                this.rpdistributor.DataBind();
            }
        }
Esempio n. 25
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("购物车");
 }
Esempio n. 26
0
        protected override void AttachChildControls()
        {
            this.hidUploadImages    = (HtmlInputHidden)this.FindControl("hidUploadImages");
            this.hidErrorMsg        = (HtmlInputHidden)this.FindControl("hidErrorMsg");
            this.hidOldImages       = (HtmlInputHidden)this.FindControl("hidOldImages");
            this.txtRefundId        = (HtmlInputHidden)this.FindControl("txtRefundId");
            this.txtOrderId         = (Literal)this.FindControl("txtOrderId");
            this.txtRefundMoney     = (Literal)this.FindControl("txtRefundMoney");
            this.txtRefundType      = (Literal)this.FindControl("txtRefundType");
            this.txtReturnReason    = (Literal)this.FindControl("txtReturnReason");
            this.txtMemo            = (Literal)this.FindControl("txtMemo");
            this.txtAfterSaleId     = (Literal)this.FindControl("litAfterSaleId");
            this.txtAdminRemark     = (Literal)this.FindControl("txtAdminRemark");
            this.txtRefuseReason    = (Literal)this.FindControl("txtRefuseReason");
            this.litStep            = (Literal)this.FindControl("litStep");
            this.litStatus          = (Literal)this.FindControl("litStatus");
            this.litBankName        = (Literal)this.FindControl("litBankName");
            this.litBankAccountName = (Literal)this.FindControl("litBankAccountName");
            this.litBankAccountNo   = (Literal)this.FindControl("litBankAccountNo");
            this.bankRow1           = (HtmlGenericControl)this.FindControl("bankRow1");
            this.bankRow2           = (HtmlGenericControl)this.FindControl("bankRow2");
            this.bankRow3           = (HtmlGenericControl)this.FindControl("bankRow3");
            this.AdminRemarkRow     = (HtmlGenericControl)this.FindControl("AdminRemarkRow");
            this.liRefundPassword   = (HtmlGenericControl)this.FindControl("liRefundPassword");
            this.txtRefundPassword  = (Literal)this.FindControl("txtRefundPassword");
            this.products           = (Common_OrderItem_AfterSales)this.FindControl("Common_OrderItemAfterSales");
            int refundId = 0;

            int.TryParse(HttpContext.Current.Request.QueryString["RefundId"], out refundId);
            RefundInfo refundInfo = TradeHelper.GetRefundInfo(refundId);

            if (refundInfo == null)
            {
                this.ShowError("错误的退款信息");
            }
            else
            {
                if (refundInfo.IsServiceProduct)
                {
                    this.txtRefundPassword.Text   = refundInfo.ValidCodes;
                    this.liRefundPassword.Visible = true;
                }
                else
                {
                    this.liRefundPassword.Visible = false;
                }
                this.litStatus.Text = EnumDescription.GetEnumDescription((Enum)(object)refundInfo.HandleStatus, 0);
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(refundInfo.OrderId);
                if (orderInfo == null || orderInfo.UserId != HiContext.Current.UserId)
                {
                    this.ShowMessage("退款订单不存在或者不属于当前用户的订单", false, "", 1);
                    return;
                }
                HtmlInputHidden htmlInputHidden = this.txtRefundId;
                int             refundId2       = refundInfo.RefundId;
                htmlInputHidden.Value     = refundId2.ToString();
                this.txtOrderId.Text      = refundInfo.OrderId;
                this.txtRefundMoney.Text  = refundInfo.RefundAmount.F2ToString("f2");
                this.txtRefundType.Text   = EnumDescription.GetEnumDescription((Enum)(object)refundInfo.RefundType, 0);
                this.txtMemo.Text         = refundInfo.UserRemark;
                this.txtReturnReason.Text = refundInfo.RefundReason;
                if (!string.IsNullOrEmpty(refundInfo.AdminRemark))
                {
                    this.txtAdminRemark.Text = refundInfo.AdminRemark;
                    if (this.AdminRemarkRow != null)
                    {
                        this.AdminRemarkRow.Visible = true;
                    }
                }
                else if (this.AdminRemarkRow != null)
                {
                    this.AdminRemarkRow.Visible = false;
                }
                Literal literal = this.txtAfterSaleId;
                refundId2    = refundInfo.RefundId;
                literal.Text = refundId2.ToString();
                if (orderInfo != null)
                {
                    this.products.order      = orderInfo;
                    this.products.DataSource = orderInfo.LineItems.Values;
                    this.products.DataBind();
                }
                DateTime dateTime  = refundInfo.AgreedOrRefusedTime.HasValue ? refundInfo.AgreedOrRefusedTime.Value : refundInfo.ApplyForTime;
                DateTime dateTime2 = refundInfo.FinishTime.HasValue ? refundInfo.FinishTime.Value : dateTime;
                string   text      = "<ul>";
                refundInfo.AdminRemark = (string.IsNullOrEmpty(refundInfo.AdminRemark) ? "" : ("备注:" + refundInfo.AdminRemark));
                DateTime applyForTime;
                if (refundInfo.HandleStatus == RefundStatus.Applied)
                {
                    string str    = text;
                    string text2  = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format = this.timeTemplate;
                    applyForTime = refundInfo.ApplyForTime;
                    text         = str + text2.Replace("{time}", string.Format(format, applyForTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "退款申请中");
                    text        += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                                   .Replace("{StatusText}", "商家同意退款");
                    text += this.stepTemplate.Replace("{style}", "").Replace("{time}", "").Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (refundInfo.HandleStatus == RefundStatus.Refunded)
                {
                    string str2    = text;
                    string text3   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format2 = this.timeTemplate;
                    applyForTime = refundInfo.ApplyForTime;
                    text         = str2 + text3.Replace("{time}", string.Format(format2, applyForTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "退款申请中");
                    text        += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, refundInfo.AdminRemark))
                                   .Replace("{StatusText}", "商家同意退款");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime2.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                            .Replace("{StatusText}", "退款完成");
                }
                else if (refundInfo.HandleStatus == RefundStatus.Refused)
                {
                    string str3    = text;
                    string text4   = this.stepTemplate.Replace("{style}", this.activityStyle);
                    string format3 = this.timeTemplate;
                    applyForTime = refundInfo.ApplyForTime;
                    text         = str3 + text4.Replace("{time}", string.Format(format3, applyForTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, "")).Replace("{StatusText}", "退款申请中");
                    text        += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", string.Format(this.remarkTemplate, refundInfo.AdminRemark))
                                   .Replace("{StatusText}", "商家拒绝退款");
                    text += this.stepTemplate.Replace("{style}", this.activityStyle).Replace("{time}", string.Format(this.timeTemplate, dateTime.ToString("yyyy-MM-dd HH:mm:ss"))).Replace("{remark}", "")
                            .Replace("{StatusText}", "退款失败");
                }
                text += "</ul>";
                this.litStep.Text = text;
                if (refundInfo.RefundType == RefundTypes.InBankCard)
                {
                    this.bankRow1.Visible        = true;
                    this.bankRow2.Visible        = true;
                    this.bankRow3.Visible        = true;
                    this.litBankName.Text        = refundInfo.BankName;
                    this.litBankAccountName.Text = refundInfo.BankAccountName;
                    this.litBankAccountNo.Text   = refundInfo.BankAccountNo;
                }
            }
            PageTitle.AddSiteNameTitle("退款详情");
        }
Esempio n. 27
0
        protected override void AttachChildControls()
        {
            this.rptCategories                = (VshopTemplatedRepeater)this.FindControl("rptCategories");
            this.rptProducts                  = (VshopTemplatedRepeater)this.FindControl("rptProducts");
            this.rptProducts.ItemDataBound   += new RepeaterItemEventHandler(this.rptProducts_ItemDataBound);
            this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound);
            this.img            = (HtmlImage)this.FindControl("imgDefaultBg");
            this.pager          = (Pager)this.FindControl("pager");
            this.litstorename   = (Literal)this.FindControl("litstorename");
            this.litdescription = (Literal)this.FindControl("litdescription");
            this.litattention   = (Literal)this.FindControl("litattention");
            this.imglogo        = (HiImage)this.FindControl("imglogo");
            this.litImgae       = (Literal)this.FindControl("litImgae");
            this.litItemParams  = (Literal)this.FindControl("litItemParams");
            if (string.IsNullOrEmpty(this.Page.Request.QueryString["ReferralId"]))
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
                {
                    this.Page.Response.Redirect("/Vshop/Default.aspx?ReferralId=" + cookie.Value);
                }
            }
            if (this.rptCategories.Visible)
            {
                DataTable brandCategories = CategoryBrowser.GetBrandCategories();
                this.itemcount = brandCategories.Rows.Count;
                if (brandCategories.Rows.Count > 0)
                {
                    this.rptCategories.DataSource = brandCategories;
                    this.rptCategories.DataBind();
                }
            }
            this.Page.Session["stylestatus"] = "3";
            SiteSettings masterSettings = SettingsManager.GetMasterSettings(false);

            PageTitle.AddSiteNameTitle(masterSettings.SiteName);
            this.litstorename.Text   = masterSettings.SiteName;
            this.litdescription.Text = masterSettings.ShopIntroduction;
            if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
            {
                this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
            }
            if (base.referralId <= 0)
            {
                HttpCookie cookie2 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if ((cookie2 != null) && !string.IsNullOrEmpty(cookie2.Value))
                {
                    base.referralId = int.Parse(cookie2.Value);
                    this.Page.Response.Redirect("/Vshop/Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            else
            {
                HttpCookie cookie3 = HttpContext.Current.Request.Cookies["Vshop-ReferralId"];
                if (((cookie3 != null) && !string.IsNullOrEmpty(cookie3.Value)) && (this.referralId.ToString() != cookie3.Value))
                {
                    this.Page.Response.Redirect("/Vshop/Default.aspx?ReferralId=" + this.referralId.ToString(), true);
                }
            }
            IList <BannerInfo> allBanners = new List <BannerInfo>();

            allBanners = VshopBrowser.GetAllBanners();
            foreach (BannerInfo info in allBanners)
            {
                TplCfgInfo info2 = new NavigateInfo
                {
                    LocationType = info.LocationType,
                    Url          = info.Url
                };
                string loctionUrl = "javascript:";
                if (!string.IsNullOrEmpty(info.Url))
                {
                    loctionUrl = info2.LoctionUrl;
                }
                string text = this.litImgae.Text;
                this.litImgae.Text = text + "<a  id=\"ahref\" href='" + loctionUrl + "'><img src=\"" + info.ImageUrl + "\" title=\"" + info.ShortDesc + "\" alt=\"" + info.ShortDesc + "\" /></a>";
            }
            if (allBanners.Count == 0)
            {
                this.litImgae.Text = "<a id=\"ahref\"  href='javascript:'><img src=\"/Utility/pics/default.jpg\" title=\"\"  /></a>";
            }
            DistributorsInfo userIdDistributors = new DistributorsInfo();

            userIdDistributors = DistributorsBrower.GetUserIdDistributors(base.referralId);
            if ((userIdDistributors != null) && (userIdDistributors.UserId > 0))
            {
                PageTitle.AddSiteNameTitle(userIdDistributors.StoreName);
                this.litdescription.Text = userIdDistributors.StoreDescription;
                this.litstorename.Text   = userIdDistributors.StoreName;
                if (!string.IsNullOrEmpty(userIdDistributors.Logo))
                {
                    this.imglogo.ImageUrl = userIdDistributors.Logo;
                }
                else if (!string.IsNullOrEmpty(masterSettings.DistributorLogoPic))
                {
                    this.imglogo.ImageUrl = masterSettings.DistributorLogoPic.Split(new char[] { '|' })[0];
                }
                if (!string.IsNullOrEmpty(userIdDistributors.BackImage))
                {
                    this.litImgae.Text = "";
                    foreach (string str2 in userIdDistributors.BackImage.Split(new char[] { '|' }))
                    {
                        if (!string.IsNullOrEmpty(str2))
                        {
                            this.litImgae.Text = this.litImgae.Text + "<a ><img src=\"" + str2 + "\" title=\"\"  /></a>";
                        }
                    }
                }
            }
            this.dtpromotion = ProductBrowser.GetAllFull();
            if (this.rptProducts != null)
            {
                ProductQuery query = new ProductQuery
                {
                    PageSize  = this.pager.PageSize,
                    PageIndex = this.pager.PageIndex,
                    SortBy    = "DisplaySequence",
                    SortOrder = SortAction.Desc
                };
                DbQueryResult homeProduct = ProductBrowser.GetHomeProduct(MemberProcessor.GetCurrentMember(), query);
                this.rptProducts.DataSource = homeProduct.Data;
                this.rptProducts.DataBind();
                this.pager.TotalRecords = homeProduct.TotalRecords;
                if (this.pager.TotalRecords <= this.pager.PageSize)
                {
                    this.pager.Visible = false;
                }
            }
            if (this.img != null)
            {
                this.img.Src = new VTemplateHelper().GetDefaultBg();
            }
            if (!string.IsNullOrEmpty(masterSettings.GuidePageSet))
            {
                this.litattention.Text = masterSettings.GuidePageSet;
            }
            string str3 = "";

            if (!string.IsNullOrEmpty(masterSettings.ShopHomePic))
            {
                str3 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.ShopHomePic;
            }
            string str4 = "";
            string str5 = (userIdDistributors == null) ? masterSettings.SiteName : userIdDistributors.StoreName;

            if (!string.IsNullOrEmpty(masterSettings.DistributorBackgroundPic))
            {
                str4 = Globals.HostPath(HttpContext.Current.Request.Url) + masterSettings.DistributorBackgroundPic.Split(new char[] { '|' })[0];
            }
            this.litItemParams.Text = str3 + "|" + masterSettings.ShopHomeName + "|" + masterSettings.ShopHomeDescription + "$";
            this.litItemParams.Text = string.Concat(new object[] { this.litItemParams.Text, str4, "|好店推荐之", str5, "商城|一个购物赚钱的好去处|", HttpContext.Current.Request.Url });
        }
Esempio n. 28
0
        protected override void AttachChildControls()
        {
            this.litIsEnable    = (HtmlInputHidden)this.FindControl("litIsEnable");
            this.litIsMember    = (HtmlInputHidden)this.FindControl("litIsMember");
            this.litExpenditure = (HtmlInputHidden)this.FindControl("litExpenditure");
            this.litminMoney    = (HtmlInputHidden)this.FindControl("litminMoney");
            this.litProds       = (HtmlInputHidden)this.FindControl("litProds");
            this.litProdOK      = (HtmlInputHidden)this.FindControl("litProdOK");
            SiteSettings masterSettings      = SettingsManager.GetMasterSettings(true);
            int          currentMemberUserId = Globals.GetCurrentMemberUserId();

            if (currentMemberUserId > 0)
            {
                this.litIsMember.Value = "1";
                DistributorsInfo userIdDistributors = DistributorsBrower.GetUserIdDistributors(currentMemberUserId);
                MemberInfo       currentMember      = MemberProcessor.GetCurrentMember();
                if (currentMember == null)
                {
                    this.Page.Response.Redirect("/Vshop/DistributorCenter.aspx");
                    return;
                }
                this.UserBindName       = (HtmlInputHidden)this.FindControl("UserBindName");
                this.UserBindName.Value = currentMember.UserBindName;
                decimal expenditure = currentMember.Expenditure;
                if (userIdDistributors != null)
                {
                    if (userIdDistributors.ReferralStatus == 0)
                    {
                        this.IsEnable = "1";
                        this.Context.Response.Redirect("/Vshop/DistributorCenter.aspx");
                        this.Context.Response.End();
                    }
                    else if (userIdDistributors.ReferralStatus == 1)
                    {
                        this.IsEnable = "3";
                    }
                    else if (userIdDistributors.ReferralStatus == 9)
                    {
                        this.IsEnable = "9";
                    }
                }
                else
                {
                    decimal   num3 = 0M;
                    DataTable userOrderPaidWaitFinish = OrderHelper.GetUserOrderPaidWaitFinish(currentMemberUserId);
                    decimal   total     = 0M;
                    OrderInfo orderInfo = null;
                    for (int i = 0; i < userOrderPaidWaitFinish.Rows.Count; i++)
                    {
                        orderInfo = OrderHelper.GetOrderInfo(userOrderPaidWaitFinish.Rows[i]["orderid"].ToString());
                        if (orderInfo != null)
                        {
                            total = orderInfo.GetTotal();
                            if (total > 0M)
                            {
                                num3 += total;
                            }
                        }
                    }
                    expenditure += num3;
                    if (!masterSettings.DistributorApplicationCondition)
                    {
                        if (SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                        {
                            this.IsEnable = "2";
                        }
                        else
                        {
                            this.IsEnable = "4";
                        }
                    }
                    else
                    {
                        int finishedOrderMoney = masterSettings.FinishedOrderMoney;
                        this.litminMoney.Value = finishedOrderMoney.ToString();
                        if ((finishedOrderMoney > 0) && (expenditure >= finishedOrderMoney))
                        {
                            if (SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                            {
                                this.IsEnable = "2";
                            }
                            else
                            {
                                this.IsEnable = "4";
                            }
                        }
                        if (masterSettings.EnableDistributorApplicationCondition && !string.IsNullOrEmpty(masterSettings.DistributorProductsDate))
                        {
                            if (!string.IsNullOrEmpty(masterSettings.DistributorProducts))
                            {
                                this.litProds.Value = masterSettings.DistributorProducts;
                                if (masterSettings.DistributorProductsDate.Contains("|"))
                                {
                                    DateTime result = new DateTime();
                                    DateTime time2  = new DateTime();
                                    DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[] { '|' })[0].ToString(), out result);
                                    DateTime.TryParse(masterSettings.DistributorProductsDate.Split(new char[] { '|' })[1].ToString(), out time2);
                                    if ((result.CompareTo(DateTime.Now) > 0) || (time2.CompareTo(DateTime.Now) < 0))
                                    {
                                        this.litProds.Value    = "";
                                        this.litIsEnable.Value = "0";
                                    }
                                    else if (MemberProcessor.CheckMemberIsBuyProds(currentMemberUserId, this.litProds.Value, new DateTime?(result), new DateTime?(time2)))
                                    {
                                        if (SystemAuthorizationHelper.CheckDistributorIsCanAuthorization())
                                        {
                                            this.IsEnable        = "2";
                                            this.litProdOK.Value = "(已购买指定商品,在" + time2.ToString("yyyy-MM-dd") + "之前申请有效)";
                                        }
                                        else
                                        {
                                            this.IsEnable = "4";
                                        }
                                    }
                                }
                            }
                            else
                            {
                                this.IsEnable = "6";
                            }
                        }
                    }
                }
                this.litExpenditure.Value = expenditure.ToString("F2");
            }
            else
            {
                this.litIsMember.Value = "0";
            }
            this.litIsEnable.Value = this.IsEnable;
            PageTitle.AddSiteNameTitle("申请分销商");
        }
Esempio n. 29
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["activityid"], out this.activityid))
            {
                base.GotoResourceNotFound("");
            }
            //this.bgimg = (HtmlImage) this.FindControl("bgimg");
            this.litActivityDesc = (Literal)this.FindControl("litActivityDesc");
            //this.litStartDate = (Literal) this.FindControl("litStartDate");
            //this.litEndDate = (Literal) this.FindControl("litEndDate");
            this.litPrizeNames = (Common_PrizeNames)this.FindControl("litPrizeNames");
            this.litPrizeUsers = (Common_PrizeUsers)this.FindControl("litPrizeUsers");
            this.litSurplusNum = (Literal)this.FindControl("litSurplusNum");
            this.litNum        = (Literal)this.FindControl("litNum");
            this.litimage      = (Literal)this.FindControl("litimage");
            LotteryActivityInfo lotteryActivity = VshopBrowser.GetLotteryActivity(this.activityid);

            if (lotteryActivity == null)
            {
                base.GotoResourceNotFound("");
            }
            if (MemberProcessor.GetCurrentMember() == null)
            {
                MemberInfo member     = new MemberInfo();
                string     generateId = Globals.GetGenerateId();
                member.GradeId        = MemberProcessor.GetDefaultMemberGrade();
                member.UserName       = "";
                member.OpenId         = "";
                member.CreateDate     = DateTime.Now;
                member.SessionId      = generateId;
                member.SessionEndTime = DateTime.Now;
                MemberProcessor.CreateMember(member);
                member = MemberProcessor.GetMember(generateId);
                HttpCookie cookie = new HttpCookie("Vshop-Member")
                {
                    Value   = member.UserId.ToString(),
                    Expires = DateTime.Now.AddYears(10)
                };
                HttpContext.Current.Response.Cookies.Add(cookie);
            }
            PageTitle.AddSiteNameTitle(lotteryActivity.ActivityName);
            litimage.Text = Globals.HostPath(HttpContext.Current.Request.Url) + lotteryActivity.ActivityPic;
            //this.litStartDate.Text = lotteryActivity.StartTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            //this.litEndDate.Text = lotteryActivity.EndTime.ToString("yyyy年MM月dd日 HH:mm:ss");
            //if (lotteryActivity.PrizeSettingList.Count > 3)
            //{
            //    this.bgimg.Src = Globals.GetVshopSkinPath(null) + "/images/process/panpic2.png";
            //}
            if ((lotteryActivity.StartTime < DateTime.Now) && (DateTime.Now < lotteryActivity.EndTime))
            {
                this.litActivityDesc.Text   = lotteryActivity.ActivityDesc;
                this.litPrizeNames.Activity = lotteryActivity;
                this.litPrizeUsers.Activity = lotteryActivity;
                int userPrizeCount = VshopBrowser.GetUserPrizeCount(this.activityid);
                this.litActivityDesc.Text = this.litActivityDesc.Text;
                //剩余次数提示
                this.litSurplusNum.Text = string.Format("您一共有{0}次参与机会,目前还剩<b class=\"sign\">{1}</b>次。", lotteryActivity.MaxNum, lotteryActivity.MaxNum - userPrizeCount);

                PrizeQuery page = new PrizeQuery
                {
                    ActivityId = this.activityid
                };
                System.Collections.Generic.List <PrizeRecordInfo> prizeList = VShopHelper.GetPrizeListEx(page);
                if (prizeList != null && prizeList.Count > 0)
                {
                    this.litNum.Text = prizeList.Count.ToString();
                }
                else
                {
                    this.litNum.Text = "0";
                }

                //前台JS刷的营销数据
                if (!string.IsNullOrEmpty(lotteryActivity.GradeIds))
                {
                    this.litNum.Text = lotteryActivity.GradeIds;
                }
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(base.GetType(), "myscript", "<script>$(function(){alert_h(\"活动还未开始或者已经结束!\");});</script>");
            }
        }
Esempio n. 30
0
        protected override void AttachChildControls()
        {
            if (!int.TryParse(this.Page.Request.QueryString["id"], out this.bargainId))
            {
                base.GotoResourceNotFound("");
            }
            MemberInfo currentMember = MemberProcessor.GetCurrentMember();

            if (currentMember != null)
            {
                BargainDetialInfo bargainDetialInfo = BargainHelper.GetBargainDetialInfo(this.bargainId, currentMember.UserId);
                if (bargainDetialInfo != null)
                {
                    this.Page.Response.Redirect(string.Concat(new object[] { "InviteBargainDetial.aspx?bargainId=", this.bargainId, "&bargainDetialId=", bargainDetialInfo.Id, "&ReferralId=", this.Page.Request.QueryString["ReferralId"] }));
                }
            }
            this.litProdcutName              = (Literal)this.FindControl("litProdcutName");
            this.litShortDescription         = (Literal)this.FindControl("litShortDescription");
            this.litSalePrice                = (Literal)this.FindControl("litSalePrice");
            this.litFloorPrice               = (Literal)this.FindControl("litFloorPrice");
            this.litFloorPrice1              = (Literal)this.FindControl("litFloorPrice1");
            this.litPurchaseNumber           = (Literal)this.FindControl("litPurchaseNumber");
            this.litParticipantNumber        = (Literal)this.FindControl("litParticipantNumber");
            this.litProductDesc              = (Literal)this.FindControl("litProductDesc");
            this.litProductConsultationTotal = (Literal)this.FindControl("litProductConsultationTotal");
            this.litProductCommentTotal      = (Literal)this.FindControl("litProductCommentTotal");
            this.litStock           = (Literal)this.FindControl("litStock");
            this.litPurcharseNum    = (Literal)this.FindControl("litPurcharseNum");
            this.hiddHasCollected   = (HtmlInputHidden)this.FindControl("hiddHasCollected");
            this.hiddProductId      = (HtmlInputHidden)this.FindControl("hiddProductId");
            this.hiddEndDate        = (HtmlInputHidden)this.FindControl("hiddEndDate");
            this.hiddPurchaseNumber = (HtmlInputHidden)this.FindControl("hiddPurchaseNumber");
            this.skuSelector        = (Common_SKUSelector)this.FindControl("skuSelector");
            this.rptProductImages   = (VshopTemplatedRepeater)this.FindControl("rptProductImages");
            this.hideTitle          = (HtmlInputHidden)this.FindControl("hideTitle");
            this.hideImgUrl         = (HtmlInputHidden)this.FindControl("hideImgUrl");
            this.hideDesc           = (HtmlInputHidden)this.FindControl("hideDesc");
            bool        flag        = false;
            BargainInfo bargainInfo = BargainHelper.GetBargainInfo(this.bargainId);

            if (bargainInfo != null)
            {
                PageTitle.AddSiteNameTitle(bargainInfo.Title);
                this.litFloorPrice.Text        = bargainInfo.FloorPrice.ToString("F2");
                this.litFloorPrice1.Text       = bargainInfo.FloorPrice.ToString("F2");
                this.litSalePrice.Text         = bargainInfo.InitialPrice.ToString("f2");
                this.litPurchaseNumber.Text    = (bargainInfo.ActivityStock - bargainInfo.TranNumber).ToString();
                this.litParticipantNumber.Text = BargainHelper.HelpBargainCount(this.bargainId).ToString();
                this.hiddEndDate.Value         = bargainInfo.EndDate.ToString("yyyy:MM:dd:HH:mm:ss");
                this.hiddPurchaseNumber.Value  = bargainInfo.PurchaseNumber.ToString();
                this.litStock.Text             = bargainInfo.PurchaseNumber.ToString();
                this.litPurcharseNum.Text      = bargainInfo.PurchaseNumber.ToString();
                this.hideTitle.Value           = bargainInfo.Title;
                this.hideDesc.Value            = bargainInfo.Remarks.Replace("\n", " ").Replace("\r", "");
                string activityCover = bargainInfo.ActivityCover;
                string str2          = string.Empty;
                Uri    url           = HttpContext.Current.Request.Url;
                if (!activityCover.StartsWith("http"))
                {
                    str2 = url.Scheme + "://" + url.Host + ((url.Port == 80) ? "" : (":" + url.Port.ToString()));
                }
                if (bargainInfo.ProductId > 0)
                {
                    this.skuSelector.ProductId = bargainInfo.ProductId;
                    if (currentMember != null)
                    {
                        flag = ProductBrowser.CheckHasCollect(currentMember.UserId, bargainInfo.ProductId);
                    }
                    this.hiddHasCollected.SetWhenIsNotNull(flag ? "1" : "0");
                    ProductInfo productDetails = ProductHelper.GetProductDetails(bargainInfo.ProductId);
                    if (productDetails == null)
                    {
                        this.Context.Response.Write("<script>alert('该商品不存在!');location.href='/default.aspx';</script>");
                        this.Context.Response.End();
                    }
                    else
                    {
                        this.hiddProductId.Value      = bargainInfo.ProductId.ToString();
                        this.litProdcutName.Text      = productDetails.ProductName;
                        this.litShortDescription.Text = bargainInfo.Remarks;
                        this.hideImgUrl.Value         = string.IsNullOrEmpty(productDetails.ThumbnailUrl60) ? (str2 + activityCover) : (str2 + productDetails.ThumbnailUrl60);
                        this.litProductDesc.Text      = productDetails.Description;
                        if (this.rptProductImages != null)
                        {
                            string       locationUrl = "javascript:;";
                            SlideImage[] imageArray  = new SlideImage[] { new SlideImage(productDetails.ImageUrl1, locationUrl), new SlideImage(productDetails.ImageUrl2, locationUrl), new SlideImage(productDetails.ImageUrl3, locationUrl), new SlideImage(productDetails.ImageUrl4, locationUrl), new SlideImage(productDetails.ImageUrl5, locationUrl) };
                            this.rptProductImages.DataSource = from item in imageArray
                                                               where !string.IsNullOrWhiteSpace(item.ImageUrl)
                                                               select item;
                            this.rptProductImages.DataBind();
                        }
                        int productConsultationsCount = ProductBrowser.GetProductConsultationsCount(bargainInfo.ProductId, false);
                        this.litProductConsultationTotal.SetWhenIsNotNull(productConsultationsCount.ToString());
                        this.litProductCommentTotal.SetWhenIsNotNull(ProductBrowser.GetProductReviewsCount(bargainInfo.ProductId).ToString());
                    }
                }
            }
        }