//Update public bool UpdateExistingContent(VehicleType Originalvehicle, VehicleContent newContent) { //Find the content VehicleContent oldContent = GetContentByTypeofVehicle(Originalvehicle); //update the content if (oldContent != null) { oldContent.CarName = newContent.CarName; oldContent.Information = newContent.Information; oldContent.PriceValue = newContent.PriceValue; return(true); } else { return(false); } }
//Delete public bool RemoveContentFromList(VehicleType Vehicle) { VehicleContent content = GetContentByTypeofVehicle(Vehicle); if (content == null) { return(false); } int initialCount = _listOfContent.Count; _listOfContent.Remove(content); if (initialCount > _listOfContent.Count) { return(true); } else { return(false); } }
//Create public void AddContentToList(VehicleContent content) { _listOfContent.Add(content); }