Exemple #1
0
        private void BindOrderInfo(OrderInfo order)
        {
            litAddress.Text = order.ShippingRegion + order.Address;
            litCellPhone.Text = order.CellPhone;
            litTelPhone.Text = order.TelPhone;
            litZipCode.Text = order.ZipCode;
            litOrderId.Text = order.OrderId;
            litOrderDate.Text = order.OrderDate.ToString();
            litPayType.Text = order.PaymentType;
            litRemark.Text = order.Remark;
            litShipperMode.Text = order.RealModeName;
            litShippNo.Text = order.ShipOrderNumber;
            litSkipTo.Text = order.ShipTo;
            litActivity.Text = order.ActivityName;
            string str = string.Empty;
            if (order.OrderOptions.Count > 0)
            {
                IList<OrderOptionInfo> orderOptions = order.OrderOptions;
                str = str + "(";
                foreach (OrderOptionInfo info in orderOptions)
                {
                    string str2 = str;
                    str = str2 + info.ListDescription + ":" + info.ItemDescription + ";" + info.CustomerTitle + ":" + info.CustomerDescription;
                }
                str = str + ")";
                litOptionDes.Text = str;
            }
            switch (order.OrderStatus)
            {
                case OrderStatus.WaitBuyerPay:
                    litOrderStatus.Text = "等待付款";
                    break;

                case OrderStatus.BuyerAlreadyPaid:
                    litOrderStatus.Text = "已付款等待发货";
                    break;

                case OrderStatus.SellerAlreadySent:
                    litOrderStatus.Text = "已发货";
                    break;

                case OrderStatus.Closed:
                    litOrderStatus.Text = "已关闭";
                    break;

                case OrderStatus.Finished:
                    litOrderStatus.Text = "已完成";
                    break;
            }
            litPayMoney.Money = order.AdjustedPayCharge;
            litOptionMoney.Money = order.GetOptionPrice();
            litShippMoney.Money = order.AdjustedFreight;
            litTotalMoney.Money = order.GetTotal();
            litDiscountMoney.Money = order.AdjustedDiscount;
            litCouponMoney.Money = order.CouponValue;
            litItemsMoney.Money = order.GetAmount();
        }
Exemple #2
0
 bool CreatOrder(OrderInfo orderInfo, DbTransaction dbTran)
 {
     DbCommand storedProcCommand = this.database.GetStoredProcCommand("ss_distro_CreateOrder");
     this.database.AddInParameter(storedProcCommand, "OrderId", DbType.String, orderInfo.OrderId);
     this.database.AddInParameter(storedProcCommand, "OrderDate", DbType.DateTime, orderInfo.OrderDate);
     this.database.AddInParameter(storedProcCommand, "UserId", DbType.Int32, orderInfo.UserId);
     this.database.AddInParameter(storedProcCommand, "UserName", DbType.String, orderInfo.Username);
     this.database.AddInParameter(storedProcCommand, "Wangwang", DbType.String, orderInfo.Wangwang);
     this.database.AddInParameter(storedProcCommand, "RealName", DbType.String, orderInfo.RealName);
     this.database.AddInParameter(storedProcCommand, "EmailAddress", DbType.String, orderInfo.EmailAddress);
     this.database.AddInParameter(storedProcCommand, "Remark", DbType.String, orderInfo.Remark);
     this.database.AddInParameter(storedProcCommand, "AdjustedDiscount", DbType.Currency, orderInfo.AdjustedDiscount);
     this.database.AddInParameter(storedProcCommand, "OrderStatus", DbType.Int32, (int) orderInfo.OrderStatus);
     this.database.AddInParameter(storedProcCommand, "DistributorUserId", DbType.Int32, HiContext.Current.SiteSettings.UserId.Value);
     this.database.AddInParameter(storedProcCommand, "ShippingRegion", DbType.String, orderInfo.ShippingRegion);
     this.database.AddInParameter(storedProcCommand, "Address", DbType.String, orderInfo.Address);
     this.database.AddInParameter(storedProcCommand, "ZipCode", DbType.String, orderInfo.ZipCode);
     this.database.AddInParameter(storedProcCommand, "ShipTo", DbType.String, orderInfo.ShipTo);
     this.database.AddInParameter(storedProcCommand, "TelPhone", DbType.String, orderInfo.TelPhone);
     this.database.AddInParameter(storedProcCommand, "CellPhone", DbType.String, orderInfo.CellPhone);
     this.database.AddInParameter(storedProcCommand, "ShippingModeId", DbType.Int32, orderInfo.ShippingModeId);
     this.database.AddInParameter(storedProcCommand, "ModeName", DbType.String, orderInfo.ModeName);
     this.database.AddInParameter(storedProcCommand, "RegionId", DbType.Int32, orderInfo.RegionId);
     this.database.AddInParameter(storedProcCommand, "Freight", DbType.Currency, orderInfo.Freight);
     this.database.AddInParameter(storedProcCommand, "AdjustedFreight", DbType.Currency, orderInfo.AdjustedFreight);
     this.database.AddInParameter(storedProcCommand, "ShipOrderNumber", DbType.String, orderInfo.ShipOrderNumber);
     this.database.AddInParameter(storedProcCommand, "Weight", DbType.Int32, orderInfo.Weight);
     this.database.AddInParameter(storedProcCommand, "ExpressCompanyName", DbType.String, orderInfo.ExpressCompanyName);
     this.database.AddInParameter(storedProcCommand, "ExpressCompanyAbb", DbType.String, orderInfo.ExpressCompanyAbb);
     this.database.AddInParameter(storedProcCommand, "PaymentTypeId", DbType.Int32, orderInfo.PaymentTypeId);
     this.database.AddInParameter(storedProcCommand, "PaymentType", DbType.String, orderInfo.PaymentType);
     this.database.AddInParameter(storedProcCommand, "PayCharge", DbType.Currency, orderInfo.PayCharge);
     this.database.AddInParameter(storedProcCommand, "AdjustedPayCharge", DbType.Currency, orderInfo.AdjustedPayCharge);
     this.database.AddInParameter(storedProcCommand, "RefundStatus", DbType.Int32, (int) orderInfo.RefundStatus);
     this.database.AddInParameter(storedProcCommand, "OrderTotal", DbType.Currency, orderInfo.GetTotal());
     this.database.AddInParameter(storedProcCommand, "OrderPoint", DbType.Int32, orderInfo.GetTotalPoints());
     this.database.AddInParameter(storedProcCommand, "OrderCostPrice", DbType.Currency, orderInfo.GetCostPrice());
     this.database.AddInParameter(storedProcCommand, "OrderProfit", DbType.Currency, orderInfo.GetProfit());
     this.database.AddInParameter(storedProcCommand, "OptionPrice", DbType.Currency, orderInfo.GetOptionPrice());
     this.database.AddInParameter(storedProcCommand, "Amount", DbType.Currency, orderInfo.GetAmount());
     this.database.AddInParameter(storedProcCommand, "ActivityName", DbType.String, orderInfo.ActivityName);
     this.database.AddInParameter(storedProcCommand, "ActivityId", DbType.Int32, orderInfo.ActivityId);
     this.database.AddInParameter(storedProcCommand, "EightFree", DbType.Boolean, orderInfo.EightFree);
     this.database.AddInParameter(storedProcCommand, "ProcedureFeeFree", DbType.Boolean, orderInfo.ProcedureFeeFree);
     this.database.AddInParameter(storedProcCommand, "OrderOptionFree", DbType.Boolean, orderInfo.OrderOptionFree);
     this.database.AddInParameter(storedProcCommand, "DiscountName", DbType.String, orderInfo.DiscountName);
     this.database.AddInParameter(storedProcCommand, "DiscountId", DbType.Int32, orderInfo.DiscountId);
     this.database.AddInParameter(storedProcCommand, "DiscountValue", DbType.Currency, orderInfo.DiscountValue);
     this.database.AddInParameter(storedProcCommand, "DiscountValueType", DbType.Int32, (int) orderInfo.DiscountValueType);
     this.database.AddInParameter(storedProcCommand, "DiscountAmount", DbType.Currency, orderInfo.GetDiscountAmount());
     this.database.AddInParameter(storedProcCommand, "CouponName", DbType.String, orderInfo.CouponName);
     this.database.AddInParameter(storedProcCommand, "CouponCode", DbType.String, orderInfo.CouponCode);
     this.database.AddInParameter(storedProcCommand, "CouponAmount", DbType.Currency, orderInfo.CouponAmount);
     this.database.AddInParameter(storedProcCommand, "CouponValue", DbType.Currency, orderInfo.CouponValue);
     if (orderInfo.GroupBuyId > 0)
     {
         this.database.AddInParameter(storedProcCommand, "GroupBuyId", DbType.Int32, orderInfo.GroupBuyId);
         this.database.AddInParameter(storedProcCommand, "NeedPrice", DbType.Currency, orderInfo.NeedPrice);
         this.database.AddInParameter(storedProcCommand, "GroupBuyStatus", DbType.Int32, 1);
     }
     else
     {
         this.database.AddInParameter(storedProcCommand, "GroupBuyId", DbType.Int32, DBNull.Value);
         this.database.AddInParameter(storedProcCommand, "NeedPrice", DbType.Currency, DBNull.Value);
         this.database.AddInParameter(storedProcCommand, "GroupBuyStatus", DbType.Int32, DBNull.Value);
     }
     return (this.database.ExecuteNonQuery(storedProcCommand, dbTran) == 1);
 }
Exemple #3
0
 private void BindOtherAmount(OrderInfo order)
 {
     if (order.ProcedureFeeFree)
     {
         txtAdjustedPayCharge.ReadOnly = true;
     }
     if (order.EightFree)
     {
         txtAdjustedFreight.ReadOnly = true;
     }
     txtAdjustedFreight.Text = order.AdjustedFreight.ToString("F", CultureInfo.InvariantCulture);
     txtAdjustedPayCharge.Text = order.AdjustedPayCharge.ToString("F", CultureInfo.InvariantCulture);
     oderItemAmount.Text = Globals.FormatMoney(order.GetOptionPrice());
     txtAdjustedDiscount.Text = order.AdjustedDiscount.ToString("F", CultureInfo.InvariantCulture);
     if (!string.IsNullOrEmpty(order.PaymentType))
     {
         litPayName.Text = "(" + order.PaymentType + ")";
     }
     if (!string.IsNullOrEmpty(order.ModeName))
     {
         litShipModeName.Text = "(" + order.ModeName + ")";
     }
     string str = string.Empty;
     if (order.OrderOptions.Count > 0)
     {
         foreach (OrderOptionInfo info in order.OrderOptions)
         {
             string str2 = str;
             str = str2 + info.ListDescription + ":" + info.ItemDescription + ";" + info.CustomerTitle + ":" + info.CustomerDescription;
         }
     }
     litOderItem.Text = str;
     fullDiscountAmount.Text = "-" + Globals.FormatMoney(order.GetDiscountAmount());
     if ((!string.IsNullOrEmpty(order.DiscountName) && (order.DiscountValue > 0M)) && Enum.IsDefined(typeof(DiscountValueType), order.DiscountValueType))
     {
         lkbtnFullDiscount.Text = order.DiscountName;
         lkbtnFullDiscount.NavigateUrl = string.Format(Globals.GetSiteUrls().UrlData.FormatUrl("FavourableDetails"), order.DiscountId);
     }
     else
     {
         fullDiscountAmount.Text = "暂无";
         lkbtnFullDiscount.Enabled = false;
     }
     if (!string.IsNullOrEmpty(order.ActivityName))
     {
         lkbtnFullFree.Text = order.ActivityName;
         lkbtnFullFree.NavigateUrl = string.Format(Globals.GetSiteUrls().UrlData.FormatUrl("FavourableDetails"), order.ActivityId);
     }
     else
     {
         lkbtnFullFree.Text = "暂无";
         lkbtnFullFree.Enabled = false;
     }
     if (!string.IsNullOrEmpty(order.CouponName))
     {
         couponAmount.Text = "[" + order.CouponName + "]-" + Globals.FormatMoney(order.CouponValue);
     }
     else
     {
         couponAmount.Text = "-" + Globals.FormatMoney(order.CouponValue);
     }
 }
Exemple #4
0
 void BindOrderItems(OrderInfo order)
 {
     this.orderItems.DataSource = order.LineItems.Values;
     this.orderItems.DataBind();
     if (order.Gifts.Count > 0)
     {
         this.plOrderGift.Visible = true;
         this.grdOrderGift.DataSource = order.Gifts;
         this.grdOrderGift.DataBind();
     }
     this.lblCartMoney.Money = order.GetAmount();
     this.litWeight.Text = order.Weight.ToString();
     this.lblPayCharge.Money = order.AdjustedPayCharge;
     this.lblOptionPrice.Money = order.GetOptionPrice();
     this.lblFreight.Money = order.AdjustedFreight;
     this.lblAdjustedDiscount.Money = order.AdjustedDiscount;
     this.litCouponValue.Text = order.CouponName + " -" + Globals.FormatMoney(order.CouponValue);
     this.lblDiscount.Money = order.GetAmount() - order.GetDiscountedAmount();
     if (order.OrderStatus == OrderStatus.WaitBuyerPay)
     {
         this.litPoints.Text = order.GetTotalPoints().ToString(CultureInfo.InvariantCulture);
     }
     else
     {
         this.litPoints.Text = order.Points.ToString(CultureInfo.InvariantCulture);
     }
     this.litTotalPrice.Money = order.GetTotal();
 }