Пример #1
0
        public CityArr ToCityArr()
        {
            CityArr cityArr = new CityArr();
            Nominee nominee;

            for (int i = 0; i < this.Count; i++)
            {
                nominee = this[i] as Nominee;
                if (!cityArr.IsContains(nominee.City.Id))
                {
                    cityArr.Add(nominee.City);
                }
            }
            return(cityArr);
        }
Пример #2
0
        public CityArr Filter(string name, int id = 0)
        {
            CityArr cityArr = new CityArr();

            City city;

            name = name.ToLower();
            for (int i = 0; i < this.Count; i++)
            {
                city = (this[i] as City);
                if ((name == "" || city.Name.ToLower().StartsWith(name)) && (id == 0 || city.Id == id))
                {
                    cityArr.Add(city);
                }
            }

            return(cityArr);
        }