/// <summary> /// Updates a Locations entry in the database to reflect status of inventory and menu changes /// </summary> /// <param name="location">LocationClass object representing the location to be updated</param> public void UpdateLocation(LocationClass location) { var trackedLocation = db.Locations.Find(location.LocationID); trackedLocation.Inventory = location.GetInventory(); trackedLocation.Menu = location.GetMenu(); db.Locations.Update(trackedLocation); }
/// <summary> /// Adds a new location to the database /// </summary> /// <param name="location">LocationClass object to be added to the database</param> public void AddNewLocation(LocationClass location) { Locations trackedLocation = new Locations(); trackedLocation.LocationDescription = location.LocationDescription; trackedLocation.Menu = location.GetMenu(); trackedLocation.Inventory = location.GetInventory(); db.Add(trackedLocation); }