Beispiel #1
0
        protected void Envoyer_Click(object sender, EventArgs e)
        {
            string nom       = txtNom.Text;
            string prenom    = txtPrenom.Text;
            string adresse   = txtAdresse.Text;
            string telephone = txtTelephone.Text;
            string courriel  = txtCourriel.Text;
            string mdp       = txtMDP.Text;
            string mdp2      = txtMDP2.Text;
            bool   isDriver  = CheckBoxConducteur.Checked;
            bool   fumeur    = CheckBoxFumeur.Checked;
            bool   animaux   = CheckBoxAnimaux.Checked;
            bool   equipe    = CheckBoxBienEquipe.Checked;

            Membre membre = new Membre(0, nom, prenom, adresse, telephone, courriel, mdp, false, isDriver, fumeur, animaux, equipe);

            MembreFactory.Save(ConfigurationManager.ConnectionStrings["cnnStr"].ConnectionString, membre);
            Response.Redirect("Default.aspx");
        }
Beispiel #2
0
        protected void Envoyer_Click(object sender, EventArgs e)
        {
            string nom       = txtNom.Text;
            string prenom    = txtPrenom.Text;
            string adresse   = txtAdresse.Text;
            string telephone = txtTelephone.Text;
            string courriel  = txtCourriel.Text;
            string mdp       = txtMDP.Text;
            string mdp2      = txtMDP2.Text;

            bool exists = MembreFactory.checkIfExists(((Logements)Master).CnnStr, courriel);      // Vérifie si le courriel est déjà utilisé

            if (!exists)
            {
                Membre membre = new Membre(0, nom, prenom, adresse, telephone, courriel, mdp, false, false, false);
                MembreFactory.Save(((Logements)Master).CnnStr, membre);
                EmailFacilitator.sendEmail("*****@*****.**", "Nouveau membre inscrit", "Un nouveau membre s'est inscrit sur le site des logements");
                Response.Redirect("Default.aspx");
            }
            else
            {
                registerFailed.Visible = true;
            }
        }