예제 #1
0
        public bool UpdateGuitar(IProducer producer, string model, int strings, string color)
        {
            var guitar = new Guitar(producer, model, strings);

            if (_guitars.Contains(guitar))
            {
                _guitars.Where(x => x.Equals(guitar)).ToList().ForEach(x => { x.Color = color; });
                return(true);
            }
            return(false);
        }
예제 #2
0
        public bool AddGuitar(string producent, string model, string strings, string color)
        {
            int Intstrings = Int32.Parse(strings);
            var guitar     = new Guitar(_producers.Find(x => x.Name == producent), model, Intstrings, color);

            if (!_guitars.Contains(guitar))
            {
                _guitars.Add(guitar);
                return(true);
            }
            return(false);
        }
예제 #3
0
        public bool DeleteGuitar(string producent, string model, string strings)
        {
            int Intstrings = Int32.Parse(strings);
            var guitar     = new Guitar(_producers.Find(x => x.Name == producent), model);

            if (_guitars.Contains(guitar))
            {
                _guitars.Remove(guitar);
                return(true);
            }
            return(false);
        }