public void CreateOrder(string userID, List<ShoppingCartItem> items,decimal total, bool payed) { List<OrderItem> orderItems = new List<OrderItem>(); foreach(var item in items) { orderItems.Add(new OrderItem { Amount = item.Amount, Product = item.Product }); } _IOrderDAL.CreateOrder(userID, orderItems,total, payed); this.SendEmail(_IOrderDAL.GetUserByID(userID), orderItems, payed); }
public OrderDTO AddOrder(OrderDTO order) { DateTime date = new DateTime(); Console.WriteLine("Enter NEW ORDER DETAILS (CUSTOMER ID, SHIPPER ID, DESCRIPTION"); Console.WriteLine("CustomerID, ShipperID, Description "); order = new OrderDTO { CustomerIDKEY = Convert.ToInt32(Console.ReadLine()), ShipperIDKEY = Convert.ToInt32(Console.ReadLine()), Price = 0, Date = date.Date, Comment = Console.ReadLine() }; return(_orderDAL.CreateOrder(order)); }
//returns id of created order public int Create(int cid, int lid) { return(DAL.CreateOrder(cid, lid)); }
public OrderDTO AddOrder(OrderDTO order) { return(_orderDAL.CreateOrder(order)); }