Esempio n. 1
0
        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);
       
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 //returns id of created order
 public int Create(int cid, int lid)
 {
     return(DAL.CreateOrder(cid, lid));
 }
Esempio n. 4
0
 public OrderDTO AddOrder(OrderDTO order)
 {
     return(_orderDAL.CreateOrder(order));
 }