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