Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String nom=new String(txtNom.getText()),
- prenom= new String(txtPrenom.getText()),
- username= new String(txtUsername.getText()),
- password=new String(txtPassword.getPassword()),
- passwordBis=new String(txtPasswordBis.getPassword());
- String fonction=txtFonction.getText();
- String specialite=txtSpecialite.getText();
- String niveauEtude=txtNiveauEtude.getText();
- String date="";
- if(dateNaissance.getDate()!=null)
- date = new String(dateNaissance.getDate().toString().substring(4,10)+dateNaissance.getDate().toString().substring(23));
- String categorie="";
- if(categorieH.isSelected())
- categorie="Homme";
- else
- if(categorieF.isSelected())
- categorie="Femme";
- if(nom.isEmpty() || prenom.isEmpty() || username.isEmpty()
- || password.isEmpty() || passwordBis.isEmpty() || categorie.isEmpty() || date.isEmpty())
- {
- msgErreur1.setText("Remplissez les champs obligatoires");
- if(nom.isEmpty())
- // txtPrenom.setForeground(Color.RED);
- nomF.setText("*");
- else
- // txtPrenom.setForeground(Color.LIGHT_GRAY);
- nomF.setText("");
- if(prenom.isEmpty())
- //txtPrenom.setForeground(Color.RED);
- prenomF.setText("*");
- else
- //txtPrenom.setForeground(Color.LIGHT_GRAY);
- prenomF.setText("");
- if(username.isEmpty())
- //lblUsername.setForeground(Color.RED);
- userF.setText("*");
- else
- //lblUsername.setForeground(Color.LIGHT_GRAY);
- userF.setText("");
- if(password.isEmpty())
- //lblPassword.setForeground(Color.RED);
- mdpF.setText("*");
- else
- //lblPassword.setForeground(Color.LIGHT_GRAY);
- mdpF.setText("");
- if(passwordBis.isEmpty())
- //lblPasswordBis.setForeground(Color.RED);
- mdpBisF.setText("*");
- else
- //lblPasswordBis.setForeground(Color.LIGHT_GRAY);
- mdpBisF.setText("");
- if(categorie.isEmpty())
- catF.setText("*");
- else
- catF.setText("");
- if(date.isEmpty())
- dateF.setText("*");
- else
- dateF.setText("");
- }else{
- if(!password.equals(passwordBis)){
- msgErreur1.setText("Mots de passe différents");
- }else{
- byte b;
- try {
- b = inscrireAbonne(nom,prenom,date,
- categorie ,username,password,txtFonction.getText(),
- txtSpecialite.getText(),txtNiveauEtude.getText());
- } catch (IOException ex) {
- Logger.getLogger(InscriptionFen.class.getName()).log(Level.SEVERE, null, ex);
- b=2;
- }
- switch(b) {
- case 0:
- {
- try {
- seConnecter(username,password);
- } catch (IOException ex) {
- Logger.getLogger(InscriptionFen.class.getName()).log(Level.SEVERE, null, ex);
- } catch (ClassNotFoundException ex) {
- Logger.getLogger(InscriptionFen.class.getName()).log(Level.SEVERE, null, ex);
- }
- }
- this.dispose();
- break;
- case 1:
- msgErreur1.setText("Username déjà existant");
- break;
- case 2:
- msgErreur1.setText("Problème connexion");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement