예제 #1
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("我的订单");

            WAPHeadName.AddHeadName("我的订单");
            int num = 0;

            int.TryParse(System.Web.HttpContext.Current.Request.QueryString.Get("status"), out num);
            OrderQuery orderQuery = new OrderQuery();

            orderQuery.ShowGiftOrder = false;
            if (num == 1)
            {
                orderQuery.Status = OrderStatus.WaitBuyerPay;
            }

            if (num == 2)
            {
                orderQuery.Status = OrderStatus.BuyerAlreadyPaid;
            }

            if (num == 3)
            {
                orderQuery.Status = OrderStatus.SellerAlreadySent;
            }

            if (num == 5)
            {
                orderQuery.Status = OrderStatus.Finished;
            }
            orderQuery.ShowGiftOrder  = false;
            this.rptOrders            = (WapTemplatedRepeater)this.FindControl("rptOrders");
            this.rptOrders.DataSource = MemberProcessor.GetWAPUserOrder(HiContext.Current.User.UserId, orderQuery);
            this.rptOrders.DataBind();
        }
예제 #2
0
        protected override void AttachChildControls()
        {
            this.refundId = System.Convert.ToInt32(this.Page.Request.QueryString["RefundId"]);
            //this.RefundDetails = (Common_OrderManage_OrderItems)this.FindControl("Common_OrderManage_OrderItems");
            this.txtOrderId       = (System.Web.UI.WebControls.Literal) this.FindControl("txtOrderId");
            this.handleStatus     = (System.Web.UI.WebControls.Literal) this.FindControl("handleStatus");
            this.litAddDate       = (FormatedTimeLabel)this.FindControl("litAddDate");
            this.litRemark        = (System.Web.UI.WebControls.Literal) this.FindControl("litRemark");
            this.litAdminRemark   = (System.Web.UI.WebControls.Literal) this.FindControl("litAdminRemark");
            this.litWeight        = (System.Web.UI.WebControls.Literal) this.FindControl("litWeight");
            this.litType          = (System.Web.UI.WebControls.Literal) this.FindControl("litType");
            this.litTotalPrice    = (FormatedMoneyLabel)this.FindControl("litTotalPrice");
            this.litRefundTotal   = (FormatedMoneyLabel)this.FindControl("litRefundTotal");
            this.litOrderTotal    = (FormatedMoneyLabel)this.FindControl("litOrderTotal");
            this.rptOrderProducts = (WapTemplatedRepeater)this.FindControl("rptOrderProducts");
            if (!this.Page.IsPostBack)
            {
                this.BindOrderRefund(this.refundId);
                OrderInfo orderInfo = TradeHelper.GetOrderInfo(this.orderId);
                if (orderInfo == null || orderInfo.UserId != HiContext.Current.User.UserId)
                {
                    this.Page.Response.Redirect(Globals.ApplicationPath + "/ResourceNotFound.aspx?errorMsg=" + Globals.UrlEncode("该订单不存在或者不属于当前用户的订单"));
                    return;
                }
                this.BindOrderItems(orderInfo);
                this.BindRefunds(orderInfo);
            }

            PageTitle.AddSiteNameTitle("退款申请单");

            WAPHeadName.AddHeadName("退款申请单");
        }
예제 #3
0
 protected override void AttachChildControls()
 {
     PageTitle.AddSiteNameTitle("下载APP");
     WAPHeadName.AddHeadName("下载APP");
     if (!this.Page.IsPostBack)
     {
     }
 }
예제 #4
0
        protected override void AttachChildControls()
        {
            this.helpCategories = (WapTemplatedRepeater)this.FindControl("helpCategories");

            this.helpCategories.DataSource = CommentBrowser.GetHelpCategories();
            this.helpCategories.DataBind();

            PageTitle.AddSiteNameTitle("帮助中心");
            WAPHeadName.AddHeadName("帮助中心");
        }
예제 #5
0
        protected override void AttachChildControls()
        {
            string url = this.Page.Request.QueryString["returnUrl"];

            if (!string.IsNullOrWhiteSpace(this.Page.Request.QueryString["returnUrl"]))
            {
                this.Page.Response.Redirect(url);
            }
            PageTitle.AddSiteNameTitle("我的收藏");

            WAPHeadName.AddHeadName("我的收藏");
        }
예제 #6
0
        protected override void AttachChildControls()
        {
            this.txtRefundRemark      = (System.Web.UI.WebControls.TextBox) this.FindControl("txtRefundRemark");
            this.txtReturnRemark      = (System.Web.UI.WebControls.TextBox) this.FindControl("txtReturnRemark");
            this.txtReplaceRemark     = (System.Web.UI.WebControls.TextBox) this.FindControl("txtReplaceRemark");
            this.rptOrderProducts     = (WapTemplatedRepeater)this.FindControl("rptOrderProducts");
            this.dropLogisticsCompany = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropLogisticsCompany");
            this.dropRefundReason     = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropRefundReason");
            this.dropReturnReason     = (System.Web.UI.WebControls.DropDownList) this.FindControl("dropReturnReason");
            string action  = this.Page.Request.QueryString["Action"];
            string orderId = this.Page.Request.QueryString["OrderId"];

            if (action == "Refund")
            {
                PageTitle.AddSiteNameTitle("退款申请");
                WAPHeadName.AddHeadName("退款申请");
            }
            else if (action == "Return")
            {
                PageTitle.AddSiteNameTitle("退货申请");
                WAPHeadName.AddHeadName("退货申请");
            }
            else if (action == "Replace")
            {
                PageTitle.AddSiteNameTitle("换货申请");
                WAPHeadName.AddHeadName("换货申请");
            }
            //OrderInfo orderInfo = OrderHelper.GetOrderInfo(orderId);
            IList <string>  list = ExpressHelper.GetAllExpressName();
            List <ListItem> item = new List <ListItem>();

            foreach (string s in list)
            {
                item.Add(new ListItem(s, s));
            }
            dropLogisticsCompany.Items.AddRange(item.ToArray());
            //绑定物流公司选择
            //IList<ShippingModeInfo> shippingModes = ControlProvider.Instance().GetShippingModes();
            //dropLogisticsCompany.DataSource = shippingModes;
            //dropLogisticsCompany.DataValueField = "Name";
            //dropLogisticsCompany.DataMember = "Name";
            //dropLogisticsCompany.DataBind();
            this.rptOrderProducts.DataSource = ShoppingProcessor.GetOrderItems(orderId);
            this.rptOrderProducts.DataBind();

            BindRefundReason();
            BindReturnReason();
        }
예제 #7
0
        protected override void AttachChildControls()
        {
            int useType = 1;

            int.TryParse(this.Page.Request.QueryString["usedType"], out useType);
            DataTable userCoupons = MemberProcessor.GetUserCoupons(HiContext.Current.User.UserId, useType);

            if (userCoupons != null)
            {
                this.rptCoupons            = (System.Web.UI.WebControls.Repeater) this.FindControl("rptCoupons");
                this.rptCoupons.DataSource = userCoupons;
                this.rptCoupons.DataBind();
            }
            PageTitle.AddSiteNameTitle("优惠券");

            WAPHeadName.AddHeadName("优惠券");
        }
예제 #8
0
        protected override void AttachChildControls()
        {
            this.MessageContent = (System.Web.UI.WebControls.Literal) this.FindControl("MessageContent");

            if (!long.TryParse(this.Page.Request.QueryString["MessageId"], out this.MessageId))
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.MessageContent.Text = CommentBrowser.GetMemberMessage(MessageId).Content;

                PageTitle.AddSiteNameTitle("消息详情");

                WAPHeadName.AddHeadName("消息详情");
            }
        }
예제 #9
0
        protected override void AttachChildControls()
        {
            this.helpContent = (System.Web.UI.WebControls.Literal) this.FindControl("helpContent");

            if (!int.TryParse(this.Page.Request.QueryString["helpid"], out this.helpid))
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                HelpInfo helpinfo = CommentBrowser.GetHelp(this.helpid);
                this.helpContent.Text = helpinfo.Content;
                string name = helpinfo.Title;

                PageTitle.AddSiteNameTitle(name);
                WAPHeadName.AddHeadName(name);
            }
        }
예제 #10
0
        protected override void AttachChildControls()
        {
            WapTemplatedRepeater rptOrderProducts = this.FindControl("rptOrderProducts") as WapTemplatedRepeater;
            string text = this.Page.Request.QueryString["orderId"];

            if (string.IsNullOrEmpty(text))
            {
                base.GotoResourceNotFound("");
            }
            OrderInfo orderInfo = ShoppingProcessor.GetOrderInfo(text);

            rptOrderProducts.DataSource = orderInfo.LineItems.Values;
            rptOrderProducts.DataBind();

            PageTitle.AddSiteNameTitle("发表评价");

            WAPHeadName.AddHeadName("发表评价");
        }
예제 #11
0
        protected override void AttachChildControls()
        {
            this.helpItems = (WapTemplatedRepeater)this.FindControl("helpItems");

            if (!int.TryParse(this.Page.Request.QueryString["CategoryId"], out this.CategoryId))
            {
                base.GotoResourceNotFound("");
            }
            else
            {
                this.helpItems.DataSource = CommentBrowser.GetHelpByCateGoryId(this.CategoryId);
                this.helpItems.DataBind();

                string name = CommentBrowser.GetHelpCategory(this.CategoryId).Name;

                PageTitle.AddSiteNameTitle(name);
                WAPHeadName.AddHeadName(name);
            }
        }
예제 #12
0
        protected override void AttachChildControls()
        {
            System.Web.UI.HtmlControls.HtmlInputText control  = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtUserName");
            System.Web.UI.HtmlControls.HtmlInputText control2 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtRealName");
            System.Web.UI.HtmlControls.HtmlInputText control3 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtPhone");
            System.Web.UI.HtmlControls.HtmlInputText control4 = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("txtEmail");
            Member member = HiContext.Current.User as Member;

            if (member != null)
            {
                control.SetWhenIsNotNull(member.Username);
                control2.SetWhenIsNotNull(member.RealName);
                control3.SetWhenIsNotNull(member.CellPhone);
                control4.SetWhenIsNotNull(member.QQ);
            }
            PageTitle.AddSiteNameTitle("个人资料");

            WAPHeadName.AddHeadName("个人资料");
        }
예제 #13
0
        protected override void AttachChildControls()
        {
            int useType = 1;

            int.TryParse(this.Page.Request.QueryString["usedType"], out useType);
            DataTable rptVoucher = MemberProcessor.GetUserVoucher(HiContext.Current.User.UserId, useType);

            if (rptVoucher != null && rptVoucher.Rows.Count > 0)
            {
                this.rptVoucher            = (System.Web.UI.WebControls.Repeater) this.FindControl("rptVoucher");
                this.rptVoucher.DataSource = rptVoucher;
                this.rptVoucher.DataBind();
            }
            PageTitle.AddSiteNameTitle("现金券");

            WAPHeadName.AddHeadName("现金券");

            //查看之后,更新状态为已查阅
            MemberProcessor.UpdateVoucherReaded(HiContext.Current.User.UserId);
        }
예제 #14
0
        protected override void AttachChildControls()
        {
            this.shipTo       = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("shipTo");
            this.address      = (System.Web.UI.HtmlControls.HtmlTextArea) this.FindControl("address");
            this.cellphone    = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("cellphone");
            this.Hiddenshipid = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("shipId");
            this.regionText   = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("regionText");
            this.region       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("region");
            this.identityCard = (System.Web.UI.HtmlControls.HtmlInputText) this.FindControl("identityCard");
            ShippingAddressInfo shippingAddress = MemberProcessor.GetShippingAddress(this.shippingid);
            string fullRegion = RegionHelper.GetFullRegion(shippingAddress.RegionId, " ");

            this.shipTo.Value       = shippingAddress.ShipTo;
            this.address.Value      = shippingAddress.Address;
            this.cellphone.Value    = shippingAddress.CellPhone;
            this.Hiddenshipid.Value = this.shippingid.ToString();
            this.regionText.SetWhenIsNotNull(fullRegion);
            this.region.SetWhenIsNotNull(shippingAddress.RegionId.ToString());
            this.identityCard.Value = shippingAddress.IdentityCard;
            PageTitle.AddSiteNameTitle("编辑收货地址");
            WAPHeadName.AddHeadName("编辑收货地址");
        }
예제 #15
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("会员中心");
            WAPHeadName.AddHeadName("我的海美生活");
            Member member = HiContext.Current.User as Member;

            if (member == null)
            {
                return;
            }
            this.litUserLink       = (System.Web.UI.WebControls.Literal) this.FindControl("litUserLink");
            this.litUserName       = (System.Web.UI.WebControls.Literal) this.FindControl("litUserName");
            this.litRealName       = (System.Web.UI.WebControls.Literal) this.FindControl("litRealName");
            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.HeadImg           = (System.Web.UI.WebControls.Image) this.FindControl("HeadImg");
            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.litRealName.Text       = (string.IsNullOrEmpty(member.RealName) ? member.Username : member.RealName);
            this.litUserName.Text       = member.Username;
            this.litWaitForRecieveCount = (System.Web.UI.WebControls.Literal) this.FindControl("litWaitForRecieveCount");
            this.litWaitForPayCount     = (System.Web.UI.WebControls.Literal) this.FindControl("litWaitForPayCount");
            this.litWaitForReviewCount  = (System.Web.UI.WebControls.Literal) this.FindControl("litWaitForReviewCount");
            this.litWaitForSentCount    = (System.Web.UI.WebControls.Literal) this.FindControl("litWaitForSentCount");

            #region 订单数量显示
            OrderQuery orderQuery = new OrderQuery();

            orderQuery.Status = OrderStatus.WaitBuyerPay;
            int userOrderCount = MemberProcessor.WAPGetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litWaitForPayCount.SetWhenIsNotNull(userOrderCount.ToString());


            orderQuery.Status = OrderStatus.SellerAlreadySent;
            userOrderCount    = MemberProcessor.WAPGetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litWaitForRecieveCount.SetWhenIsNotNull(userOrderCount.ToString());

            orderQuery.Status = OrderStatus.All;
            userOrderCount    = MemberProcessor.WAPGetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litAllOrderCount.SetWhenIsNotNull(userOrderCount.ToString());

            orderQuery.Status = OrderStatus.Finished;
            userOrderCount    = MemberProcessor.WAPGetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litWaitForReviewCount.SetWhenIsNotNull(userOrderCount.ToString());

            orderQuery.Status = OrderStatus.BuyerAlreadyPaid;
            userOrderCount    = MemberProcessor.WAPGetUserOrderCount(HiContext.Current.User.UserId, orderQuery);
            this.litWaitForSentCount.SetWhenIsNotNull(userOrderCount.ToString());
            #endregion


            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);

            //退货单数量显示
            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)
            {
                if (member.ReferralStatus == 0 || member.ReferralStatus == 1 || member.ReferralStatus == 3)
                {
                    this.referralLink.Text = "申请成为推广员";
                    if (member.ReferralStatus == 1 || member.ReferralStatus == 3)
                    {
                        this.referralLink.NavigateUrl = "/wapshop/ReferralRegisterresults.aspx";
                    }
                    else
                    {
                        this.referralLink.NavigateUrl = "/wapshop/ReferralRegisterAgreement.aspx";
                    }
                }
                if (member.ReferralStatus == 2)
                {
                    this.referralLink.Text        = "推广员";
                    this.referralLink.NavigateUrl = "/wapshop/Referral.aspx";
                }
            }

            //if (bindAccountLink != null)
            //{
            //    this.bindAccountLink.CssClass = "list-group-item";
            //    this.bindAccountLink.Text = "绑定PC端会员帐号";
            //    this.bindAccountLink.NavigateUrl = "/wapshop/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 = "/wapshop/SwitchAccount.aspx";
            //}
        }
예제 #16
0
        protected override void AttachChildControls()
        {
            PageTitle.AddSiteNameTitle("消息中心");

            WAPHeadName.AddHeadName("消息中心");
        }
예제 #17
0
        protected override void AttachChildControls()
        {
            this.orderId          = this.Page.Request.QueryString["orderId"];
            this.litShipTo        = (System.Web.UI.WebControls.Literal) this.FindControl("litShipTo");
            this.litPhone         = (System.Web.UI.WebControls.Literal) this.FindControl("litPhone");
            this.litAddress       = (System.Web.UI.WebControls.Literal) this.FindControl("litAddress");
            this.litOrderId       = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderId");
            this.litOrderDate     = (System.Web.UI.WebControls.Literal) this.FindControl("litOrderDate");
            this.litOrderStatus   = (OrderStatusLabel)this.FindControl("litOrderStatus");
            this.rptOrderProducts = (WapTemplatedRepeater)this.FindControl("rptOrderProducts");
            this.litTotalPrice    = (System.Web.UI.WebControls.Literal) this.FindControl("litTotalPrice");
            this.litPayTime       = (System.Web.UI.WebControls.Literal) this.FindControl("litPayTime");
            this.orderStatus      = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("orderStatus");
            this.txtOrderId       = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtOrderId");
            this.litRemark        = (System.Web.UI.WebControls.Literal) this.FindControl("litRemark");
            this.litShipToDate    = (System.Web.UI.WebControls.Literal) this.FindControl("litShipToDate");
            this.litShippingCost  = (System.Web.UI.WebControls.Literal) this.FindControl("litShippingCost");
            this.litCounponPrice  = (System.Web.UI.WebControls.Literal) this.FindControl("litCounponPrice");
            this.litBuildPrice    = (System.Web.UI.WebControls.Literal) this.FindControl("litBuildPrice");
            this.litDisCountPrice = (System.Web.UI.WebControls.Literal) this.FindControl("litDisCountPrice");
            this.litActualPrice   = (System.Web.UI.WebControls.Literal) this.FindControl("litActualPrice");
            this.rptPromotions    = (WapTemplatedRepeater)this.FindControl("rptPromotions");
            this.litTax           = (System.Web.UI.WebControls.Literal) this.FindControl("litTax");
            this.litPayCharge     = (System.Web.UI.WebControls.Literal) this.FindControl("litPayCharge");
            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;
            this.litOrderId.Text   = this.orderId;
            this.litOrderDate.Text = orderInfo.OrderDate.ToString();
            this.litTotalPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
            this.litOrderStatus.OrderStatusCode = orderInfo.OrderStatus;
            this.litPayTime.SetWhenIsNotNull((orderInfo.PayDate != System.DateTime.MinValue) ? orderInfo.PayDate.ToString("yyyy-MM-dd HH:mm:ss") : "");
            this.orderStatus.SetWhenIsNotNull(((int)orderInfo.OrderStatus).ToString());
            this.txtOrderId.SetWhenIsNotNull(this.orderId.ToString());
            this.litCounponPrice.SetWhenIsNotNull(orderInfo.CouponValue.ToString("F2"));
            this.litShippingCost.SetWhenIsNotNull(orderInfo.AdjustedFreight.ToString("F2"));
            this.litShipToDate.SetWhenIsNotNull(orderInfo.ShipToDate);
            this.litBuildPrice.SetWhenIsNotNull(orderInfo.GetAmount().ToString("F2"));
            this.litDisCountPrice.SetWhenIsNotNull(orderInfo.AdjustedDiscount.ToString("F2"));
            this.litActualPrice.SetWhenIsNotNull(orderInfo.GetTotal().ToString("F2"));
            this.litRemark.SetWhenIsNotNull(orderInfo.Remark);
            this.litTax.SetWhenIsNotNull(orderInfo.Tax.ToString("F2"));
            this.litPayCharge.SetWhenIsNotNull(orderInfo.PayCharge.ToString("F2"));
            this.rptOrderProducts.DataSource = orderInfo.LineItems.Values;
            this.rptOrderProducts.DataBind();
            System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <string, string> > list = new System.Collections.Generic.List <System.Collections.Generic.KeyValuePair <string, string> >();
            if (orderInfo.IsReduced)
            {
                list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.Reduced), orderInfo.ReducedPromotionName + string.Format(" 优惠:{0}", orderInfo.ReducedPromotionAmount.ToString("F2"))));
            }
            if (orderInfo.IsFreightFree)
            {
                list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.FullAmountSentFreight), string.Format("{0}", orderInfo.FreightFreePromotionName)));
            }
            if (orderInfo.IsSendTimesPoint)
            {
                list.Add(new System.Collections.Generic.KeyValuePair <string, string>(PromotionHelper.GetShortName(PromoteType.FullAmountSentTimesPoint), string.Format("{0}:送{1}倍", orderInfo.SentTimesPointPromotionName, orderInfo.TimesPoint.ToString("F2"))));
            }
            this.rptPromotions.DataSource = list;
            this.rptPromotions.DataBind();
            PageTitle.AddSiteNameTitle("订单详情");

            WAPHeadName.AddHeadName("订单详情");
        }
예제 #18
0
 protected override void AttachChildControls()
 {
     this.dropRegions = (RegionSelector)this.FindControl("dropRegions");
     PageTitle.AddSiteNameTitle("添加收货地址");
     WAPHeadName.AddHeadName("添加收货地址");
 }
예제 #19
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("确认订单");
        }