public static void CompleteOrder(Guid orderId)
        {
            var db    = new PapaBobsDBEntities();
            var order = db.Orders.FirstOrDefault(p => p.OrderId == orderId);

            order.Completed_ = true;
            db.SaveChanges();
        }
        public static List <DTO.OrderDTO> GetOrders()
        {
            var db        = new PapaBobsDBEntities();
            var orders    = db.Orders.Where(p => p.Completed_ == false).ToList();
            var ordersDTO = convertToDTO(orders);

            return(ordersDTO);
        }
Example #3
0
        public static DTO.PizzaPriceDTO GetPizzaPrices()
        {
            var db     = new PapaBobsDBEntities();
            var prices = db.PizzaPrices.First();
            var dto    = convertToDTO(prices);

            return(dto);
        }
        public static void CreateOrder(DTO.OrderDTO orderDTO)
        {
            var db = new PapaBobsDBEntities();

            var order = convertToEntity(orderDTO);

            db.Orders.Add(order);
            db.SaveChanges();
        }