예제 #1
0
        private void BindPage()
        {
            //Bind CustomerInfo
            this.lblName.Text      = oSession.sCustomer.CustomerName;
            this.lblAddr.Text      = oSession.sCustomer.DwellAddress;
            this.lblPhone.Text     = oSession.sCustomer.Phone;
            this.lblCellPhone.Text = oSession.sCustomer.CellPhone;
            this.lblZip.Text       = oSession.sCustomer.DwellZip;
            AreaInfo area = ASPManager.GetInstance().LoadArea(oSession.sCustomer.DwellAreaSysNo);

            this.lblProvince.Text = area.ProvinceName;
            this.lblCity.Text     = area.CityName;
            this.lblDistrict.Text = area.DistrictName;

            //修改部分显示

            txtRname.Text = soInfo.ReceiveName;

            txtRCellPhone.Text = soInfo.ReceiveCellPhone;
            txtRPhone.Text     = soInfo.ReceivePhone;
            if (oSession.sCustomer.DwellAreaSysNo != 1)//这个是new user的默认值。
            {
                RArea.AreaSysNo = soInfo.ReceiveAreaSysNo;
            }
            txtRaddress.Text = soInfo.ReceiveAddress;
            txtRzip.Text     = soInfo.ReceiveZip;

            //Bind SO
            //Bind SOMaster
            this.lblSOID.Text             = soInfo.SOID;
            this.lblReceiveName.Text      = soInfo.ReceiveName;
            this.lblReceiveAddr.Text      = soInfo.ReceiveAddress;
            this.lblReceivePhone.Text     = soInfo.ReceivePhone;
            this.lblReceiveCellPhone.Text = soInfo.ReceiveCellPhone;
            this.lblReceiveZip.Text       = soInfo.ReceiveZip;
            area = ASPManager.GetInstance().LoadArea(soInfo.ReceiveAreaSysNo);
            this.lblReceiveProvince.Text = area.ProvinceName;
            this.lblReceiveCity.Text     = area.CityName;
            this.lblReceiveDistrict.Text = area.DistrictName;
            ShipTypeInfo stInfo = ASPManager.GetInstance().LoadShipType(soInfo.ShipTypeSysNo);
            PayTypeInfo  ptInfo = ASPManager.GetInstance().LoadPayType(soInfo.PayTypeSysNo);

            this.lblShipType.Text       = stInfo.ShipTypeName;
            this.lblPayType.Text        = ptInfo.PayTypeName;
            this.lblPointAmt.Text       = soInfo.PointAmt.ToString();
            this.lblPointPay.Text       = soInfo.PointPay.ToString();
            this.lblFreeShipFeePay.Text = Util.ToMoney(soInfo.FreeShipFeePay).ToString();
            this.lblPremiumAmt.Text     = soInfo.PremiumAmt.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblShipPrice.Text      = soInfo.ShipPrice.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblPayPrice.Text       = soInfo.PayPrice.ToString(AppConst.DecimalFormatWithCurrency);
            if (soInfo.PayPrice > 0)
            {
                this.trPayPrice.Visible = true;
            }
            else
            {
                this.trPayPrice.Visible = false;
            }
            this.lblSOAmt.Text = soInfo.SOAmt.ToString(AppConst.DecimalFormatWithCurrency);
            //this.lblDiscountAmt.Text = soInfo.DiscountAmt.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblDiscountAmt.Text = Convert.ToDecimal(soInfo.DiscountAmt + soInfo.CouponAmt).ToString(AppConst.DecimalFormatWithCurrency);
            //if(soInfo.DiscountAmt>0)
            //    this.trSaleRule.Visible = true;
            //else
            //    this.trSaleRule.Visible = false;
            if ((soInfo.DiscountAmt + soInfo.CouponAmt) > 0)
            {
                this.trSaleRule.Visible = true;
            }
            else
            {
                this.trSaleRule.Visible = false;
            }

            decimal total    = soInfo.GetTotalAmt();
            decimal subTotal = total - soInfo.PayPrice;
            decimal endMoney = SaleManager.GetInstance().GetEndMoney(soInfo);
            decimal change   = total - endMoney;

            this.lblSubSum.Text     = subTotal.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblTotalMoney.Text = endMoney.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblChange.Text     = change.ToString(AppConst.DecimalFormatWithCurrency);
            this.lblSOWeight.Text   = soInfo.GetTotalWeight().ToString();
            this.lblStatus.Text     = AppEnum.GetSOStatus(soInfo.Status);
            this.lblSODate.Text     = soInfo.OrderDate.ToString(AppConst.DateFormat);
            if (soInfo.Memo == "")
            {
                lblMemo.Text    = "没有留言!";
                txtMessage.Text = "没有留言!";
            }
            else
            {
                this.lblMemo.Text = soInfo.Memo;
                txtMessage.Text   = soInfo.Memo;
            }
            //Bind SOItem Table
            this.BindSOItem();
            //Bind SaleRule Table
            this.BindSaleRule();
            //Set visible
            if (soInfo.Status == (int)AppEnum.SOStatus.Origin)
            {
                this.btnCancel.Visible = true;
            }
            else
            {
                this.btnCancel.Visible = false;
            }

            if (soInfo.HasExpectQty == (int)AppEnum.YNStatus.Yes)
            {
                this.dgItem.Columns[5].Visible = true;
            }
            else
            {
                this.dgItem.Columns[5].Visible = false;
            }
        }
예제 #2
0
        /// <summary>
        /// 获得用户的订单列表
        /// </summary>
        /// <param name="customSysNo"></param>
        /// <param name="pageNum"></param>
        /// <returns></returns>
        public static string GetCustomerOrderList(int customSysNo, int pageNum)
        {
            string             orderListHTML = String.Empty;
            int                pageCount     = int.Parse(YoeJoyConfig.MyOrderProductListPagedCount);
            List <OrderModuel> orderList     = OrderService.GetMyOrder(customSysNo, pageNum, pageCount);

            if (orderList != null)
            {
                StringBuilder strb = new StringBuilder();

                string tabRowHTMLTemplate = @"
                             <tr class='orderList'>
                                <td>
                                    <img src='{0}'>
                                </td>
                                <td>
                                    <p><a href='{1}'>{2}</a></p>
                                    <p><b>¥{3}</b>X{4}</p>
                                </td>
                                <th>
                                    <a class='reBuy' href='{5}'>再次购买</a><br>
                                    <a class='reBuy' href='{6}'>发表评论</a>
                                </th>
                            </tr>";

                foreach (var orderListItem in orderList)
                {
                    strb.Append(@"<table class='order' cellSpacing='0' cellPadding='0'><tbody>");

                    string orderDetailDeeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "User/MyOrderDetail.aspx?ID=", orderListItem.SysNo);
                    string orderUpdateDeeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "User/MyOrderDetail.aspx?action=update&ID=", orderListItem.SysNo);
                    string orderCancelDeeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "User/MyOrderDetail.aspx?action=cancel&ID=", orderListItem.SysNo);

                    bool IsNet         = (orderListItem.IsNet == (int)AppEnum.YNStatus.Yes) ? true : false;
                    bool IsPayWhenRecv = (orderListItem.IsPayWhenEcv == (int)AppEnum.YNStatus.Yes) ? true : false;

                    strb.Append("<tr><th class='orderNum' rowSpan='3'>");

                    strb.Append("<p>订单编号:<a href='" + orderDetailDeeplink + "'>" + orderListItem.SysNo + "</a></p>");
                    strb.Append("<p>订购日期:" + orderListItem.OrderDate.ToString("yyyy-mm-dd") + "</p>");
                    if (IsNet)
                    {
                        strb.Append("<p>付款方式:在线支付</p>");
                    }
                    if (IsPayWhenRecv)
                    {
                        strb.Append("<p>订单总计:¥" + orderListItem.TotalCash.ToString("#####0.00") + "</p>");
                    }
                    strb.Append("<p>使用积分:" + orderListItem.PointPay + "</p>");
                    strb.Append("<p>可获积分:" + orderListItem.Pointamt + "</p>");
                    strb.Append("<p><a href='" + orderDetailDeeplink + "'>订单详情</a></p>");

                    strb.Append("</th><td colSpan='3'><h2 class='ordertitlts'><span class='l'><b>");
                    strb.Append(AppEnum.GetSOStatus(Util.TrimIntNull(orderListItem.Status)));
                    strb.Append("</b></span><span class='r'>");

                    bool isPayed = NetPayManager.GetInstance().IsPayed(orderListItem.SysNo);

                    if (orderListItem.Status == (int)AppEnum.SOStatus.Origin && !isPayed)
                    {
                        strb.Append("<a href='MyOrderDetail.aspx?action=cancel&ID=" + orderListItem.SysNo + "'>作废订单</a>");
                        strb.Append("<a href='MyOrderDetail.aspx?action=update&ID=" + orderListItem.SysNo + "'>修改订单</a>");
                    }
                    if (orderListItem.Status == (int)AppEnum.SOStatus.Origin || orderListItem.Status == (int)AppEnum.SOStatus.WaitingPay || orderListItem.Status == (int)AppEnum.SOStatus.WaitingManagerAudit)
                    {
                        if (Util.TrimNull(orderListItem.PagementPage) != AppConst.StringNull && !isPayed && Util.TrimIntNull(orderListItem.IsNet) == (int)AppEnum.YNStatus.Yes)
                        {
                            strb.Append("<a href='../Shopping/" + Util.TrimNull(orderListItem.PagementPage) + "?id=" + orderListItem.SysNo + "&sono=" + orderListItem.SoId + "&soamt=" + orderListItem.TotalCash.ToString("#####0.00") + "'>支付货款</a>");
                        }
                    }

                    DataTable dt = RMARequestManager.GetInstance().GetRMABySO(orderListItem.SysNo);
                    if (dt != null)
                    {
                        strb.Append("<a href='../Account/RMAQuery.aspx?Type=single&ID=" + orderListItem.SysNo + "'>查看返修信息</a>");
                    }
                    strb.Append("<a href='MyOrderDetail.aspx?ID=" + orderListItem.SysNo + "'>查看订单明细</a>");
                    if (Util.TrimNull(orderListItem.Memo) != String.Empty)
                    {
                        strb.Append("<tr><td height=25px align=right bgcolor=#E7F9F9>备注信息:</td><td colspan=5 bgcolor=#ffffff>" + orderListItem.Memo + "</td></tr>");
                    }
                    strb.Append(" </span></h2></td>");
                    strb.Append("</tr>");

                    if (orderListItem.ProductList != null)
                    {
                        foreach (var productListItem in orderListItem.ProductList)
                        {
                            string deeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "Pages/Product.aspx?c1=", productListItem.C1SysNo, "&c2=", productListItem.C2SysNo, "&c3=", productListItem.C3SysNo, "&pid=", productListItem.ProductSysNo);
                            string image    = String.Concat(YoeJoyConfig.ImgVirtualPathBase, productListItem.ImgPath);
                            strb.Append(String.Format(tabRowHTMLTemplate, image, deeplink, productListItem.ProductBriefName, productListItem.Cost, productListItem.Quantity, deeplink, deeplink));
                        }
                    }

                    strb.Append("</tbody></table>");
                }
                orderListHTML = strb.ToString();
            }
            return(orderListHTML);
        }