Esempio n. 1
0
        public static void CompleteOrder(Guid orderId)
        {
            PapaBobDbEntities db = new PapaBobDbEntities();

            var dbOrder = db.Orders.Where(p => p.OrderId == orderId).FirstOrDefault();
            dbOrder.Completed = true;
            db.SaveChanges();
        }
Esempio n. 2
0
        public static void AddOrder(DTO.OrderDTO newOrder)
        {
            PapaBobDbEntities db = new PapaBobDbEntities();

            var dbOrders = db.Orders;

            var dtoOrder = convertToOrder(newOrder);

            dbOrders.Add(dtoOrder);
            db.SaveChanges();
        }