コード例 #1
0
        public static void GetOrder(DTO.OrdersDto orderDto)
        {
            var db      = new PapaBobDbEntities();
            var dbOrder = db.Orders;


            var orders = new Orders();

            orders.OrderId      = orderDto.OrderId;
            orders.Size         = orderDto.Size;
            orders.Crust        = orderDto.Crust;
            orders.Sausage      = orderDto.Sausage;
            orders.Pepperoni    = orderDto.Pepperoni;
            orders.Onions       = orderDto.Onions;
            orders.GreenPeppers = orderDto.GreenPeppers;
            orders.Name         = orderDto.Name;
            orders.Adress       = orderDto.Adress;
            orders.Zip          = orderDto.Zip;
            orders.Phone        = orderDto.Phone;
            orders.TotalCost    = orderDto.TotalCost;
            orders.PaymentType  = orderDto.PaymentType;
            orders.Completed    = orderDto.Completed;

            dbOrder.Add(orders);
            db.SaveChanges();
        }
コード例 #2
0
        public static void completeOrder(Guid orderId)
        {
            var db    = new PapaBobDbEntities();
            var order = db.Orders.FirstOrDefault(p => p.OrderId == orderId);

            order.Completed = true;
            db.SaveChanges();
        }