/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package testForms;
import bdd.ClientMySQL;
import jakarta.servlet.http.HttpServletRequest;
import javabeans.Client;
/**
 *
 * @author famille Thevenot
 */
public class NouveauClientForm {
     private String resultat;

    public String getResultat() {
        return resultat;
    }

    public void setResultat(String resultat) {
        this.resultat = resultat;
    }
     
    public int verifierClient(HttpServletRequest request){
        //Créer un client avec les infos en provenance du formulaire
        Client unClient=new Client(request.getParameter("ztNom"),request.getParameter("ztPrenom"),request.getParameter("ztMail"));
        ClientMySQL clibd =new ClientMySQL() ;
        int newNum=clibd.create(unClient);
        //mise à jour de l'attribut resultat
        return newNum;
       
        //setResultat("Nouveau client");
        
    }
}
