コード例 #1
0
        public static List <papaBobs.DTO.OrderDTO> GetOrders()
        {
            var db        = new papaBobsDBEntities1();
            var orders    = db.tbl_orders.Where(P => P.completed == false).ToList();
            var ordersDTO = convertToDTO(orders);

            return(ordersDTO);
        }
コード例 #2
0
        public static void CompleteOrder(Guid orderId)
        {
            var db    = new papaBobsDBEntities1();
            var order = db.tbl_orders.FirstOrDefault(p => p.orderID == orderId);

            order.completed = true;
            db.SaveChanges();
        }
コード例 #3
0
        public static papaBobs.DTO.PizzaPriceDTO GetPizzaPrices()
        {
            var db     = new papaBobsDBEntities1();
            var prices = db.PizzaPrices.First();
            var dto    = convertToDTO(prices);

            return(dto);
        }
コード例 #4
0
        public static void CreateOrder(papaBobs.DTO.OrderDTO orderDTO)
        {
            var db = new papaBobsDBEntities1();


            var order = convertToEntity(orderDTO);

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