private void InitRates() { IList <Rate> rdList = DALFactory.CreateRateDao(database).FindAll(); tariffList = new Dictionary <string, TariffData>(); foreach (Rate rd in rdList) { if (!tariffList.ContainsKey(rd.Tariff.Id)) { tariffList.Add(rd.Tariff.Id, new TariffData(rd.Tariff.Id, rd.Tariff.Name)); } tariffList[rd.Tariff.Id].SetRate(rd.Zone.Id, rd.PeakRate, rd.OffPeakRate); } }