public void InitialiserListe() { if (this.commerciaux == null) { this.commerciaux = new List <Commercial>(); List <string[]> listeChamp = OutilsFichier.LireFichier(GetCheminFichier()); foreach (string[] champs in listeChamp) { Commercial commercial = new Commercial() { Id = champs[0], Nom = champs[1], Prenom = champs[2], Email = champs[3], }; this.commerciaux.Add(commercial); } } }
public void InitialiserListe() { if (this.destinations == null) { this.destinations = new List <Destination>(); List <string[]> listeChamp = OutilsFichier.LireFichier(GetCheminFichier()); foreach (string[] champs in listeChamp) { Destination destination = new Destination() { Id = champs[0], Continent = champs[1], Pays = champs[2], Region = champs[3], Description = champs[4], }; this.destinations.Add(destination); } } }
public void InitialiserListe() { if (this.voyages == null) { DestinationDonnees destinationDonnees = new DestinationDonnees(); this.voyages = new List <Voyage>(); List <string[]> listeChamp = OutilsFichier.LireFichier(GetCheminFichier()); foreach (string[] champs in listeChamp) { Voyage voyage = new Voyage() { Id = champs[0], DateAller = DateTime.Parse(champs[1]), DateRetour = DateTime.Parse(champs[2]), Tarif = double.Parse(champs[3]), Destination = destinationDonnees.RecupererDestinationParId(champs[4]), }; this.voyages.Add(voyage); } } }
public void InitialiserListe() { if (this.clients == null) { this.clients = new List <Client>(); List <string[]> listeChamp = OutilsFichier.LireFichier(GetCheminFichier()); foreach (string[] champs in listeChamp) { Client client = new Client() { Id = champs[0], Civilite = champs[1], Nom = champs[2], Prenom = champs[3], Adresse = champs[4], Email = champs[5], DateNaissance = DateTime.Parse(champs[6]), Telephone = champs[7] }; this.clients.Add(client); } } }
public void InitialiserListe() { if (this.reservations == null) { this.reservations = new List <Reservation>(); List <string[]> listeChamp = OutilsFichier.LireFichier(GetCheminFichier()); foreach (string[] champs in listeChamp) { // Pour convertir la valeur en enumération Enum.TryParse(champs[2], out StatutEtatDossier etat); Reservation reservation = new Reservation() { NumeroReservation = champs[0], NumeroCb = champs[1], EtatDossier = etat, Client = new ClientDonnees().RecupererClientParId(champs[3]), Voyage = new VoyageDonnees().RecupererVoyageParId(champs[4]), Accompagnant = (from accompagnantId in champs[5].Split(',') select new ClientDonnees().RecupererClientParId(accompagnantId)).ToList() }; this.reservations.Add(reservation); } } }