Example #1
0
        /// <summary>
        /// Nuskaito failo duomenis
        /// </summary>
        /// <param name="flats"></param>
        private static void ReadFlatData(FlatContainer flats)
        {
            using (StreamReader reader = new StreamReader(@"Sav.D.1.Data.csv"))
            {
                string line = null;
                line = reader.ReadLine();

                while (null != (line = reader.ReadLine()))
                {
                    string[] values = line.Split(';');
                    int      number = int.Parse(values[0]);
                    double   area   = double.Parse(values[1]);
                    int      rooms  = int.Parse(values[2]);
                    double   price  = double.Parse(values[3]);
                    string   phone  = values[4];

                    Flat flat = new Flat(number, area, rooms, price, phone);

                    flats.AddFlat(flat);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Prideda butą
 /// </summary>
 /// <param name="flat"></param>
 public void AddFlat(Flat flat)
 {
     Flats[Count++] = flat;
 }
Example #3
0
 /// <summary>
 /// Butų konteineris
 /// </summary>
 /// <param name="size"></param>
 public FlatContainer(int size)
 {
     Flats = new Flat[size];
 }