Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 public override bool UpdateOrderAmount(OrderInfo order, DbTransaction dbTran)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("UPDATE Hishop_Orders SET OrderTotal = @OrderTotal, OrderProfit=@OrderProfit, AdjustedFreight = @AdjustedFreight, AdjustedPayCharge = @AdjustedPayCharge, AdjustedDiscount=@AdjustedDiscount, OrderPoint=@OrderPoint, Amount=@Amount,OrderCostPrice=@OrderCostPrice WHERE OrderId = @OrderId");
     database.AddInParameter(sqlStringCommand, "OrderTotal", DbType.Currency, order.GetTotal());
     database.AddInParameter(sqlStringCommand, "AdjustedFreight", DbType.Currency, order.AdjustedFreight);
     database.AddInParameter(sqlStringCommand, "AdjustedPayCharge", DbType.Currency, order.AdjustedPayCharge);
     database.AddInParameter(sqlStringCommand, "OrderCostPrice", DbType.Currency, order.GetCostPrice());
     database.AddInParameter(sqlStringCommand, "AdjustedDiscount", DbType.Currency, order.AdjustedDiscount);
     database.AddInParameter(sqlStringCommand, "OrderPoint", DbType.Int32, order.GetTotalPoints());
     database.AddInParameter(sqlStringCommand, "OrderProfit", DbType.Currency, order.GetProfit());
     database.AddInParameter(sqlStringCommand, "OrderId", DbType.String, order.OrderId);
     database.AddInParameter(sqlStringCommand, "Amount", DbType.Currency, order.GetAmount());
     if (dbTran != null)
     {
         return (database.ExecuteNonQuery(sqlStringCommand, dbTran) == 1);
     }
     return (database.ExecuteNonQuery(sqlStringCommand) == 1);
 }
Ejemplo n.º 3
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();
 }
Ejemplo n.º 4
0
 private void BindTatolAmount(OrderInfo order)
 {
     decimal amount = order.GetAmount();
     lblAllPrice.Money = amount;
     lblWeight.Text = order.Weight.ToString(CultureInfo.InvariantCulture);
     litIntegral.Text = order.GetTotalPoints().ToString(CultureInfo.InvariantCulture);
     litTotal.Text = Globals.FormatMoney(order.GetTotal());
 }
Ejemplo n.º 5
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();
        }