1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| try {
Fenetre a = new Fenetre();
Annexe p = new Annexe();
if(a.jTextAreaNatureIntervention!=null){
Connexion connexion = new Connexion();
String sql = "" +
"UPDATE Annexe " +
"SET NatureIntervention = '"+annexe.getNatureIntervention().replace("'", "''")+"'" +
", DateCreation = '"+Utilitaire.dateToDB(annexe.getDateCreation())+"'" +
", DateDeb = '"+Utilitaire.dateToDB(annexe.getDateDeb())+"'" +
", DateFin = '"+Utilitaire.dateToDB(annexe.getDateFin())+"'" +
", Effectif = "+annexe.getEffectif()+"" +
", Upload = "+annexe.getUpload()+"" +
", Matricule = '"+annexe.getMatricule()+"'" +
", IdZone = "+annexe.getIdZone()+" " +
"WHERE IdAnnexe = "+annexe.getIdAnnexe()+";";
connexion.execSql(sql);
connexion.closeConn();
FichierExcel excel1 = new FichierExcel(jTextFieldNumAnnexe.getText());
try {
log.UpdateLog("insertion table annexe!");
} catch (FileNotFoundException ex) {
Logger.getLogger(Fenetre.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Fenetre.class.getName()).log(Level.SEVERE, null, ex);
}
} else{
log.UpdateLog("pas de nature d'intervention");
try {
log.UpdateLog("pas de nature d'interventione!");
} catch (FileNotFoundException ex) {
Logger.getLogger(Fenetre.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(Fenetre.class.getName()).log(Level.SEVERE, null, ex);
}
}
} catch(Exception e) {
e.printStackTrace();
log.UpdateLog("excel non envoyer car Etat vide");
System.out.println("Fenetre : Erreur update Annexe! "+e.getMessage());
Annexe.deleteAnnexeEnCours(Integer.parseInt(jTextFieldNumAnnexe.getText()));
log.UpdateLog("supprimer l'annexe vide dans la base");
} |
Partager