Exemplo n.º 1
0
        public bool AddContentToDirectory(GreenPlanContent content)
        {
            int startingCount = _contentDirectory.Count;

            _contentDirectory.Add(content);

            bool wasAdded = (_contentDirectory.Count > startingCount) ? true : false;

            return(wasAdded);
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        public bool DeleteVehicleByName(GreenPlanContent existingContent)
        {
            bool deleteResult = _contentDirectory.Remove(existingContent);

            return(deleteResult);
        }