Exemplo n.º 1
0
        protected void btnValider_Click(object sender, EventArgs e)
        {
            try
            {
                string    email          = this.txtEmail.Text;
                string    password       = this.txtPassword.Text;
                DaoClient DaoUtilisateur = new DaoClient();
                Client    Utilisateur    = DaoUtilisateur.GetUtilisateur(email, password);

                if (Utilisateur != null)
                {
                    Session["Client"] = Utilisateur;
                    if (Session["Reservation"] != null)
                    {
                        Response.Redirect("Paiement.aspx");
                    }
                    else
                    {
                        Response.Redirect("BackendEspaceClient.aspx");
                    }
                }
                else
                {
                    this.lblClient.Visible = true;
                }
            }
            catch (Exception ex)
            {
                ((SiteMaster)Page.Master).AddError(ex);
            }
        }
Exemplo n.º 2
0
        protected void btnValider_Click(object sender, EventArgs e)
        {
            try
            {
                string nom       = this.txtNom.Text.Trim().ToUpper();
                string prenom    = this.txtPrenom.Text.Trim();
                string login     = this.TxtLogin.Text.Trim();
                string password  = this.txtPassword2.Text.Trim();
                string email     = this.txtEmail2.Text.Trim();
                string telephone = this.txtTelephone.Text.Trim();
                bool   type      = this.CbxProprietaire.Checked;

                string nomAdresse = this.TxtNomAdresse.Text;
                string numero     = this.TextNumero.Text;
                string voie       = this.txtVoie.Text;
                string codepostal = this.txtCodePostal.Text;
                string ville      = this.txtVille.Text;

                DaoClient daoClient = new DaoClient();
                daoClient.InsertClient(nom, prenom, login, password, email, telephone, type, nomAdresse, numero, voie, codepostal, ville);
                Client client = daoClient.GetUtilisateur(login, password);
                Session["Client"] = client;
                if (Session["Reservation"] != null)
                {
                    Response.Redirect("Paiement.aspx");
                }
                else
                {
                    Response.Redirect("Default.aspx");
                }
            }
            catch (Exception ex)
            {
                ((SiteMaster)Page.Master).AddError(ex);
            }
        }