Beispiel #1
0
        public bool AddContentToDirectory(GreenContent content)
        {
            int startingCount = _contentDirectory.Count;



            _contentDirectory.Add(content);

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

            return(wasAdded);
        }
Beispiel #2
0
        public bool UpdateExistingContent(string originalTitle, GreenContent newContent)
        {
            GreenContent oldContent = GetContentByTitle(originalTitle);

            if (oldContent != null)
            {
                oldContent.CarName         = newContent.CarName;
                oldContent.MileageToRefill = newContent.MileageToRefill;
                oldContent.YearMade        = newContent.YearMade;
                oldContent.CarPrice        = newContent.CarPrice;
                oldContent.CarType         = newContent.CarType;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        public bool DeleteExistingContent(GreenContent existingContent)
        {
            bool deleteResult = _contentDirectory.Remove(existingContent);

            return(deleteResult);
        }