Example #1
0
 public void SaveZakupZdarzenia(IEnumerable <Zdarzenie> kontener, string filename)
 {
     File.WriteAllText(filename, string.Empty);
     foreach (Zakup iterator in kontener)
     {
         Stream stream = new FileStream(filename, FileMode.Append, FileAccess.Write);
         FormatterCSV <Zakup> fromatterCSV = new FormatterCSV <Zakup>();
         fromatterCSV.Serialize(stream, iterator);
         stream.Close();
     }
 }
Example #2
0
 public void SaveClient(IEnumerable <Client> kontener, string filename)
 {
     File.WriteAllText(filename, string.Empty);
     foreach (Client iterator in kontener)
     {
         Stream stream = new FileStream(filename, FileMode.Append, FileAccess.Write);
         FormatterCSV <Client> fromatterCSV = new FormatterCSV <Client>();
         fromatterCSV.Serialize(stream, iterator);
         stream.Close();
     }
 }
Example #3
0
 public void SaveOpisStanu(IEnumerable <OpisStanu> kontener, string filename)
 {
     File.WriteAllText(filename, string.Empty);
     foreach (OpisStanu iterator in kontener)
     {
         Stream stream = new FileStream(filename, FileMode.Append, FileAccess.Write);
         FormatterCSV <Katalog> fromatterCSV = new FormatterCSV <Katalog>();
         fromatterCSV.Serialize(stream, iterator);
         stream.Close();
     }
 }
Example #4
0
        public void ReadZdarzeniaZakup(string filename)
        {
            String line;
            FormatterCSV <Zakup> formatterCSV = new FormatterCSV <Zakup>();
            // Read the file and display it line by line.
            StreamReader file = new System.IO.StreamReader(filename);

            while ((line = file.ReadLine()) != null)
            {
                Zakup obj = (Zakup)formatterCSV.Deserialize(GenerateStreamFromString(line));
                dataRepository.AddZdarzenie(obj);
            }

            file.Close();
        }
Example #5
0
        public void ReadClient(string filename)
        {
            String line;
            FormatterCSV <Client> formatterCSV = new FormatterCSV <Client>();
            // Read the file and display it line by line.
            StreamReader file = new System.IO.StreamReader(filename);

            while ((line = file.ReadLine()) != null)
            {
                Client obj = (Client)formatterCSV.Deserialize(GenerateStreamFromString(line));
                dataRepository.AddClient(obj);
            }

            file.Close();
        }