public void UpisiUBazuVozace()
 {
     try
     {
         using (TextWriter tw = new StreamWriter(@"D:\TaxiService\WEBTaxiService\WEBTaxiService\TaxiService\App_Data\vozaci.txt"))
         {
             foreach (var item in Vozaci)
             {
                 tw.Write(item.Username);
                 tw.Write(";");
                 tw.Write(item.Password);
                 tw.Write(";");
                 tw.Write(item.Ime);
                 tw.Write(";");
                 tw.Write(item.Prezime);
                 tw.Write(";");
                 tw.Write(item.Pol);
                 tw.Write(";");
                 tw.Write(item.Jmbg);
                 tw.Write(";");
                 tw.Write(item.Telefon);
                 tw.Write(";");
                 tw.Write(item.Email);
                 tw.Write(";");
                 tw.Write(item.Lokacija.Adresa.Ulica);
                 tw.Write(";");
                 tw.Write(item.Lokacija.Adresa.Broj);
                 tw.Write(";");
                 tw.Write(item.Lokacija.Adresa.NaseljenoMesto);
                 tw.Write(";");
                 tw.Write(item.Lokacija.Adresa.PozivniBrojMesta);
                 tw.Write(";");
                 tw.Write(item.Automobil.Vozac);
                 tw.Write(";");
                 tw.Write(item.Automobil.IdVozila);
                 tw.Write(";");
                 tw.Write(item.Automobil.BrojRegistarskeOznake);
                 tw.Write(";");
                 tw.Write(item.Automobil.GodisteAutomobila);
                 tw.Write(";");
                 tw.Write(item.Automobil.TipAutomobila);
                 if (Vozaci.IndexOf(item) != Vozaci.Count - 1)
                 {
                     tw.Write("\n");
                 }
             }
         }
     }
     catch
     {
     }
 }
Exemple #2
0
 public void UpisiUBazuVozace()
 {
     using (TextWriter tw = new StreamWriter(@"C:\Users\Nemanja\Desktop\FAKS\3.GODINA\WEB\TaxiSluzbaWebApp\TaxiService\TaxiSluzbaWebApi\App_Data\Vozaci.txt"))
     {
         foreach (var item in Vozaci)
         {
             tw.Write(item.KorisnickoIme);
             tw.Write(";");
             tw.Write(item.Sifra);
             tw.Write(";");
             tw.Write(item.Ime);
             tw.Write(";");
             tw.Write(item.Prezime);
             tw.Write(";");
             tw.Write(item.Pol);
             tw.Write(";");
             tw.Write(item.JMBG);
             tw.Write(";");
             tw.Write(item.KontaktTelefon);
             tw.Write(";");
             tw.Write(item.Email);
             tw.Write(";");
             tw.Write(item.Automobil.BrojRegistarskeOznake);
             tw.Write(";");
             tw.Write(item.Automobil.Godiste);
             tw.Write(";");
             tw.Write(item.Automobil.BrojTaksiVozila);
             tw.Write(";");
             tw.Write(item.Automobil.TipAutomobila.ToString());
             tw.Write(";");
             tw.Write(item.Blokiran.ToString());
             if (Vozaci.IndexOf(item) != Vozaci.Count() - 1)
             {
                 tw.Write("\n");
             }
         }
     }
 }