Ejemplo n.º 1
0
 public void Init()
 {
     MembreDAO.TestMode = true;
     coord = CoordonnateurLogin.GetInstance();
     Console.WriteLine(MembreDAO.TestMode);
     //coord.Register("Mel", "Balvin", "*****@*****.**", "mel007", "mel007", Genre.FEMALE, null, null, 0);
     //coord.Register("Olivier", "Castro", "*****@*****.**", "castropeo", "monPassword", Genre.MALE, null, null, 0);
     //coord.Register("Mel", "Balvin", "*****@*****.**", "mel0007", "mel007", Genre.FEMALE, null, null, 0);
     //coord.Register("Mel", "Balvin", "*****@*****.**", "mel00007", "mel007", Genre.FEMALE, null, null, 0);
     coord.Register("Mel", "Balvin", "*****@*****.**", "mel007", "mel007", Genre.FEMALE, null, null, 0);
 }
Ejemplo n.º 2
0
        public void Init()
        {
            MembreDAO.TestMode = true;
            coordMembre        = CoordonateurMembreCourant.GetInstance();
            coord = CoordonnateurLogin.GetInstance();

            coord.Register("FakeFirst", "FakeLast", "*****@*****.**", "FakeUser", "FakePass", Genre.MALE, null, null, 0);
            coord.Register("FakeFirst", "FakeLast", "*****@*****.**", "Amis1", "FakePass", Genre.MALE, null, null, 0);
            coord.Register("FakeFirst", "FakeLast", "*****@*****.**", "Amis2", "FakePass", Genre.MALE, null, null, 0);

            coord.Login("FakeUser", "FakePass");
            mdtoCourant = coordMembre.GetMembreCourant();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Appel le coordonnateurLogin pour
 /// vérifier si le email existe puis
 /// récupère le password et l'envoi par email.
 /// Ferme la fenêtre après l'envoie.
 /// </summary>
 /// <param name="sender">Bouton send password</param>
 /// <param name="e"></param>
 private void BtnSendPassWord_Click(object sender, RoutedEventArgs e)
 {
     coordinator = CoordonnateurLogin.GetInstance();
     if (TxtEmail.Text.ToString() != "")
     {
         if (coordinator.VerifierEmail(TxtEmail.Text.ToString()))
         {
             string password = coordinator.RecoverPassword(TxtEmail.Text.ToString());
             coordinator.EnvoyerPassword(password, TxtEmail.Text.ToString());
             LblEmailError.Visibility = Visibility.Hidden;
             this.Close();
         }
         else
         {
             LblEmailError.Visibility = Visibility.Visible;
         }
     }
     else
     {
         LblEmailError.Visibility = Visibility.Visible;
     }
 }
Ejemplo n.º 4
0
 public WinLogin()
 {
     InitializeComponent();
     coordinator = CoordonnateurLogin.GetInstance();
     initialiserFenetre();
 }
Ejemplo n.º 5
0
        public string this[string columnName]
        {
            get
            {
                string             result             = null;
                CoordonnateurLogin coordonnateurLogin = CoordonnateurLogin.GetInstance();
                switch (columnName)
                {
                case "username":
                    if (String.IsNullOrEmpty(this.username))
                    {
                        result = ERR_USERNAME_EMPTY;
                    }
                    else if (coordonnateurLogin.VerifierNomUtilisateurBD(this.username))
                    {
                        result = ERR_USERNAME_ALREADY_EXIST;
                    }
                    break;

                case "password":
                    if (string.IsNullOrEmpty(this.password))
                    {
                        result = ERR_PASSWORD_EMPTY;
                    }
                    break;

                case "confirmPassword":
                    if (this.confirmPassword != null && !this.confirmPassword.Equals(this.password))
                    {
                        result = ERR_CONFIRM_PASSWORD_NOT_MATCH;
                    }
                    break;

                case "firstName":
                    if (String.IsNullOrEmpty(this.firstName))
                    {
                        result = ERR_FIRST_NAME_EMPTY;
                    }
                    else if (!Regex.IsMatch(this.firstName, NAMES_PATTERN))
                    {
                        result = ERR_FIRST_NAME_INVALID;
                    }
                    break;

                case "lastName":
                    if (String.IsNullOrEmpty(this.lastName))
                    {
                        result = ERR_LAST_NAME_EMPTY;
                    }
                    else if (!Regex.IsMatch(this.lastName, NAMES_PATTERN))
                    {
                        result = ERR_LAST_NAME_INVALID;
                    }
                    break;

                case "email":
                    if (String.IsNullOrEmpty(this.email))
                    {
                        result = ERR_EMAIL_EMPTY;
                    }
                    else if (!Regex.IsMatch(this.email, EMAIL_PATTERN))
                    {
                        result = ERR_EMAIL_INVALID;
                    }
                    break;

                default:
                    result = null;
                    break;
                }
                return(result);
            }
        }