示例#1
0
 internal void AddNewOrder(tblOrder newOrder)
 {
     using (var conn = new PizzaRestaurantEntities())
     {
         conn.tblOrders.Add(newOrder);
         conn.SaveChanges();
     }
 }
示例#2
0
        internal void UpdateOrder(tblOrder orderToUpdate)
        {
            using (var context = new PizzaRestaurantEntities())
            {
                context.tblOrders.First(e => e.OrderID == orderToUpdate.OrderID).IsApproved = orderToUpdate.IsApproved;

                context.SaveChanges();
            }
        }