コード例 #1
0
        public static void CompleteOrder(Guid orderId)
        {
            var db    = new PapaBobsEntities();
            var order = db.Orders.FirstOrDefault(p => p.OrderId == orderId);

            order.Completed = true;
            db.SaveChanges();
        }
コード例 #2
0
        public static void CreateOrder(DTO.OrderDTO orderDTO)
        {
            var db    = new PapaBobsEntities();
            var order = ConvertToEntity(orderDTO);

            db.Orders.Add(order);
            db.SaveChanges();
        }
コード例 #3
0
        public static List <DTO.OrderDTO> GetOrders()
        {
            var db        = new PapaBobsEntities();
            var orders    = db.Orders.Where(p => p.Completed == false).ToList();
            var ordersDTO = convertToDTO(orders);

            return(ordersDTO);
        }
コード例 #4
0
        public static DTO.PizzaPriceDTO GetPizzaPrices()
        {
            var db     = new PapaBobsEntities();
            var prices = db.PizzaPrices.First();

            var dto = convertToDTO(prices);

            return(dto);
        }