Beispiel #1
0
        public string modify(int id, string name, string waterType)
        {
            // A constant for error message. Avoids a magic value.
            const string NAME_IS_EMPTY_MSG       = "Fish name must have a value";
            const string WATER_TYPE_IS_EMPTY_MSG = "Fish must have a water type";

            // Trim any leading or trailing blanks
            name = name.Trim();
            // Make sure it is not empty
            if (String.IsNullOrEmpty(name))
            {
                return(NAME_IS_EMPTY_MSG);
            }

            waterType = waterType.Trim();
            if (String.IsNullOrEmpty(waterType))
            {
                return(WATER_TYPE_IS_EMPTY_MSG);
            }
            FishStore fishStore = new FishStore();

            return(fishStore.modify(id, name, waterType));
        }
Beispiel #2
0
        public string waterByFishName(string name)
        {
            FishStore fishStore = new FishStore();

            return(fishStore.getFishByName(name).getWater());
        }
Beispiel #3
0
        public List <Fish> getAll()
        {
            FishStore fishStore = new FishStore();

            return(fishStore.getAll());
        }