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
|
public String butAjouter_action() {
try
{
Compte nouveau = new Compte();
nouveau.setCUserCreation(new String(getSessionBean1().getUtilisateur().getNom()));
nouveau.setDDateCreation(new Date());
nouveau.setCUserModification(new String(getSessionBean1().getUtilisateur().getNom()));
nouveau.setDDateModification(new Date());
getSessionBean1().getCompteDataProvider().getList().add(nouveau);
getSessionBean1().getCompteDataProvider().cursorLast();
getSessionBean1().setCompteDataProvider(getSessionBean1().getCompteDataProvider());
}
catch(Exception ex)
{
log("administration.jsp (compte) : Ajouter Compte", ex);
FacesContext context = FacesContext.getCurrentInstance();
FacesMessage msg = JSFMessageHelper.getNewMessage(
FacesMessage.SEVERITY_ERROR,
"comptes.compte.ajout",
null);
context.addMessage(null,msg);
}
return null;
} |