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); }
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(); }
public static papaBobs.DTO.PizzaPriceDTO GetPizzaPrices() { var db = new papaBobsDBEntities1(); var prices = db.PizzaPrices.First(); var dto = convertToDTO(prices); return(dto); }
public static void CreateOrder(papaBobs.DTO.OrderDTO orderDTO) { var db = new papaBobsDBEntities1(); var order = convertToEntity(orderDTO); db.tbl_orders.Add(order); db.SaveChanges(); }