Exemple #1
0
        public static void CompleteOrder(Guid orderId)
        {
            var db    = new PapaBobsPizzaEntities();
            var order = db.Orders.FirstOrDefault(p => p.Id == orderId);

            order.OrderCompleted = true;
            db.SaveChanges();
        }
Exemple #2
0
        public static void SaveOrder(DTOOrder newOrder)
        {
            var db = new PapaBobsPizzaEntities();

            var orderDB = new Order();

            orderDB.Id           = newOrder.Id;
            orderDB.Name         = newOrder.Name;
            orderDB.Address      = newOrder.Address;
            orderDB.Zip          = newOrder.Zip;
            orderDB.Phone        = newOrder.Phone;
            orderDB.Size         = newOrder.Size;
            orderDB.Crust        = newOrder.Crust;
            orderDB.Sausage      = newOrder.Sausage;
            orderDB.Pepperoni    = newOrder.Pepperoni;
            orderDB.Onions       = newOrder.Onions;
            orderDB.GreenPeppers = newOrder.GreenPeppers;
            orderDB.PaymentType  = newOrder.PaymentType;
            orderDB.TotalCost    = newOrder.TotalCost;
            db.Orders.Add(orderDB);
            db.SaveChanges();
        }