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); }
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(); }
/// <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; } }
public WinLogin() { InitializeComponent(); coordinator = CoordonnateurLogin.GetInstance(); initialiserFenetre(); }
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); } }