Exemplo n.º 1
0
 public void EnregistrerCommerciaux(Commerciaux commercial)
 {
     if (!this.commerciaux.Contains(commercial))
     {
         this.commerciaux.Add(commercial);
     }
     this.EcrireFichierCommerciaux();
     //EcrireFichierCommerciaux();
 }
Exemplo n.º 2
0
        private void LireFichierCommerciaux()
        {
            var lignes = File.ReadAllLines(CheminFichierComm);

            foreach (var ligne in lignes)
            {
                var champs = ligne.Split(SeparateurChamps);

                var commercial = new Commerciaux();
                commercial.Nom        = champs[0];
                commercial.Prenom     = champs[1];
                commercial.Pseudo     = champs[2];
                commercial.MotDePasse = champs[3];


                //client.Civilite = champs[4]);  Pseudo ? Mot de passe ?

                commerciaux.Add(commercial);
            }
        }
Exemplo n.º 3
0
        // ========================= GESTION DE CONNEXION =======================//
        // ========================= === = ======== ========= ===== ===== ==========//

        public bool Connexion(string pseudo, string mdp)
        {
            Commerciaux George = new Commerciaux();

            George.Pseudo     = pseudo;
            George.MotDePasse = mdp;
            George.Nom        = "Doggo";
            George.Prenom     = "George";

            commerciaux.Add(George);

            foreach (Commerciaux com in commerciaux)
            {
                Console.WriteLine(com.Pseudo);
            }
            foreach (ILogger log in commerciaux)
            {
                if (log.Connexion(pseudo, mdp))
                {
                    return(true);
                }
            }
            return(false);
        }