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