本文整理汇总了C#中OrderInfo.AddStore方法的典型用法代码示例。如果您正苦于以下问题:C# OrderInfo.AddStore方法的具体用法?C# OrderInfo.AddStore怎么用?C# OrderInfo.AddStore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderInfo
的用法示例。
在下文中一共展示了OrderInfo.AddStore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateOrder
public OrderInfo CreateOrder(Store store)
{
if (store == null)
{
throw new Exception("Trying to create order without store");
}
if (string.IsNullOrEmpty(store.Alias))
{
throw new Exception("Store without alias. Please (re)publish store and re-index examine External index");
}
var order = new OrderInfo();
order.CreatedInTestMode = store.EnableTestmode;
order.CustomerInfo.CustomerIPAddress = HttpContext.Current.Request.UserHostAddress;
order.ShippingCostsMightBeOutdated = true;
order.VATCheckService = IO.Container.Resolve<IVATCheckService>();
InitializeNewOrder(order);
UseDatabaseDiscounts(order);
order.CustomerInfo.CountryCode = !string.IsNullOrEmpty(store.DefaultCountryCode) ? store.DefaultCountryCode : store.CountryCode;
var currentMember = Membership.GetUser(); // TODO: dip
if (currentMember != null)
{
//uWebshopOrders.SetCustomer(order.UniqueOrderId, currentMember.UserName); heeft toch geen effect (geen row in db)
order.CustomerInfo.LoginName = currentMember.UserName;
if (currentMember.ProviderUserKey != null)
{
//uWebshopOrders.SetCustomerId(order.UniqueOrderId, (int)currentMember.ProviderUserKey); heeft toch geen effect (geen row in db)
order.CustomerInfo.CustomerId = (int)currentMember.ProviderUserKey;
}
}
order.Localization = StoreHelper.CurrentLocalization; // todo clean
order.AddStore(store);
order.Save();
return order;
}
示例2: ChangeLocalization
public void ChangeLocalization(OrderInfo order, ILocalization localization)
{
if (order.Status != OrderStatus.Incomplete)
{
Log.Instance.LogError("ChangeLocalization for NOT incomplete order: " + order.UniqueOrderId + " status: " + order.Status);
}
order.Localization = localization;
order.AddStore(localization.Store);
ReloadOrderData(order, localization);
}