public SortedDictionary <string, int> GetSortedDictionaryCity() { // מחזירה משתנה מסוג מילון ממוין עם ערכים רלוונטיים לדוח SortedDictionary <string, int> dictionary = new SortedDictionary <string, int>(); CityArr cityArr = new CityArr(); cityArr.Fill(); foreach (City curCity in cityArr) { dictionary.Add(curCity.Name, this.Filter(Position.Empty, curCity).Count); } return(dictionary); }
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); }
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); }