public abstract int InsertOrderItem(OrderItemDetails orderItem);
public abstract int InsertOrderItem(OrderItemDetails orderItem);
/// <summary> /// Creates a new order /// </summary> public static int InsertOrder(ShoppingCart shoppingCart, string shippingMethod, decimal shipping, string shippingFirstName, string shippingLastName, string shippingStreet, string shippingPostalCode, string shippingCity, string shippingState, string shippingCountry, string customerEmail, string customerPhone, string customerFax, string transactionID) { using (TransactionScope scope = new TransactionScope()) { string userName = BizObject.CurrentUserName; // insert the master order OrderDetails order = new OrderDetails(0, DateTime.Now, userName, 1, "", shippingMethod, shoppingCart.Total, shipping, shippingFirstName, shippingLastName, shippingStreet, shippingPostalCode, shippingCity, shippingState, shippingCountry, customerEmail, customerPhone, customerFax, DateTime.MinValue, transactionID, ""); int orderID = SiteProvider.Store.InsertOrder(order); // insert the child order items foreach (ShoppingCartItem item in shoppingCart.Items) { OrderItemDetails orderItem = new OrderItemDetails(0, DateTime.Now, userName, orderID, item.ID, item.Title, item.SKU, item.UnitPrice, item.Quantity); SiteProvider.Store.InsertOrderItem(orderItem); } BizObject.PurgeCacheItems("store_order"); scope.Complete(); return orderID; } }