示例#1
0
        //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);
            }
        }
示例#2
0
        //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);
            }
        }
示例#3
0
 //Create
 public void AddContentToList(VehicleContent content)
 {
     _listOfContent.Add(content);
 }