public bool AddContentToDirectory(GreenPlanContent content) { int startingCount = _contentDirectory.Count; _contentDirectory.Add(content); bool wasAdded = (_contentDirectory.Count > startingCount) ? true : false; return(wasAdded); }
public bool UpdateExistingContent(string originalcartype, GreenPlanContent newContent) { GreenPlanContent oldContent = FindCarByName(originalcartype); if (oldContent != null) { oldContent.CarType = newContent.CarType; oldContent.PriceEstimate = newContent.PriceEstimate; oldContent.FuelCost = newContent.FuelCost; oldContent.Mileage = newContent.Mileage; return(true); } else { { return(false); } } }
public bool DeleteVehicleByName(GreenPlanContent existingContent) { bool deleteResult = _contentDirectory.Remove(existingContent); return(deleteResult); }