本文整理汇总了C#中OrderInfo.SetOrderReferenceOnOrderLinesAndProductInfos方法的典型用法代码示例。如果您正苦于以下问题:C# OrderInfo.SetOrderReferenceOnOrderLinesAndProductInfos方法的具体用法?C# OrderInfo.SetOrderReferenceOnOrderLinesAndProductInfos怎么用?C# OrderInfo.SetOrderReferenceOnOrderLinesAndProductInfos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderInfo
的用法示例。
在下文中一共展示了OrderInfo.SetOrderReferenceOnOrderLinesAndProductInfos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateOrderInfo
public static OrderInfo CreateOrderInfo(params ProductInfo[] productInfo)
{
var orderInfo = new OrderInfo();
orderInfo.PricesAreIncludingVAT = IOC.SettingsService.Resolve().IncludingVat;
orderInfo.Localization = StoreHelper.CurrentLocalization;
orderInfo.Status = OrderStatus.Confirmed;
orderInfo.OrderLines = productInfo.Select(pi => new OrderLine(pi, orderInfo)).ToList();
orderInfo.SetOrderReferenceOnOrderLinesAndProductInfos();
orderInfo.VATCheckService = new FixedValueIvatChecker(false);
orderInfo.EventsOn = true;
orderInfo.StoreInfo.CountryCode = "NL";
orderInfo.CustomerInfo.ShippingCountryCode = "NL";
orderInfo.CustomerInfo.CountryCode = "NL";
orderInfo.CustomerInfo.VATNumber = "12345NL";
orderInfo.VatCalculationStrategy = IOC.VatCalculationStrategy.Resolve();
return orderInfo;
}
示例2: ToOrderInfo
public OrderInfo ToOrderInfo()
{
var orderInfo = new OrderInfo();
orderInfo.CreatedInTestMode = CreatedInTestMode.GetValueOrDefault();
orderInfo.PaidDate = PaidDate;
orderInfo.FulfillDate = FulfillDate;
orderInfo.ConfirmDate = ConfirmDate;
orderInfo.OrderLines = OrderLines.Select(line => line.ToOrderLine(orderInfo)).ToList();
orderInfo.SetOrderReferenceOnOrderLinesAndProductInfos();
orderInfo.CouponCodesData = CouponCodes;
orderInfo.CustomerInfo = CustomerInfo;
orderInfo.ShippingInfo = ShippingInfo;
orderInfo.PaymentInfo = PaymentInfo;
orderInfo.StoreInfo = StoreInfo;
orderInfo.Name = Name;
if (CurrencyCode == null)
{
orderInfo.Localization = StoreHelper.GetLocalization(StoreInfo.Alias, null);
}
if (orderInfo.Localization == null)
{
orderInfo.Localization = Localization.ForceCreateLocalization(StoreInfo.Store, CurrencyCode);
}
if (orderInfo.Localization == null)
{
throw new Exception();
}
Discounts.ForEach(d => d.Localization = orderInfo.Localization);
orderInfo.TermsAccepted = TermsAccepted;
IO.Container.Resolve<IOrderService>().UseStoredDiscounts(orderInfo, new List<IOrderDiscount>(Discounts));
orderInfo.VatCalculationStrategy = VatCalculatedOverParts.GetValueOrDefault() ?
(IVatCalculationStrategy)new OverSmallestPartsVatCalculationStrategy() : new OverTotalVatCalculationStrategy();
orderInfo.VATCheckService = new FixedValueIvatChecker(!VATCharged);
orderInfo.PricesAreIncludingVAT = IncludingVAT;
orderInfo.PaymentProviderAmount = PaymentProviderPrice;
orderInfo.PaymentProviderOrderPercentage = PaymentProviderOrderPercentage.GetValueOrDefault();
orderInfo.ShippingProviderAmountInCents = ShippingProviderPrice;
orderInfo.RegionalVatInCents = RegionalVatAmount;
orderInfo.EventsOn = true;
orderInfo.OrderNodeId = CorrespondingOrderDocumentId.GetValueOrDefault(0);
orderInfo.RevalidateOrderOnLoad = RevalidateOrderOnLoad; // version 2.1 hack
orderInfo.ReValidateSaveAction = ReValidateSaveAction;
orderInfo.StockUpdated = StockUpdated.GetValueOrDefault();
return orderInfo;
}