public static void CompleteOrder(Guid orderId) { PapaBobDbEntities db = new PapaBobDbEntities(); var dbOrder = db.Orders.Where(p => p.OrderId == orderId).FirstOrDefault(); dbOrder.Completed = true; db.SaveChanges(); }
public static void AddOrder(DTO.OrderDTO newOrder) { PapaBobDbEntities db = new PapaBobDbEntities(); var dbOrders = db.Orders; var dtoOrder = convertToOrder(newOrder); dbOrders.Add(dtoOrder); db.SaveChanges(); }