示例#1
0
 public void UpdateOrderStatus(int orderId, OrderStatus orderStatus)
 {
     using (var db = new SQLiteDBContext())
     {
         var order = db.Orders.Single(x => x.Id == orderId);
         order.OrderStatus = orderStatus;
         db.SaveChanges();
     }
 }
示例#2
0
 public void LoadOrders(Order[] orders)
 {
     using (var db = new SQLiteDBContext())
     {
         foreach (var order in orders)
         {
             db.Orders.Add(order);
             db.SaveChanges();
         }
     }
 }
示例#3
0
        public List <Order> GetNewOrders()
        {
            var result = new List <Order>();

            using (var db = new SQLiteDBContext())
            {
                result = db.Orders.Include("Address").Include("Products")
                         .Where(x => x.OrderStatus == OrderStatus.New || x.OrderStatus == OrderStatus.Unknown)
                         .ToList();
            }

            return(result);
        }