com.evasion.common.controler.Don Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.evasion.common.controler;
import com.evasion.exception.PersistenceViolationException;
import com.evasion.ejb.local.DonationManagerLocal;
import javax.annotation.ManagedBean;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
/**
*
* @author sebastien.glon
*/
@ManagedBean
@RequestScoped
public class Don {
@EJB
DonationManagerLocal ejb;
private Long somme = 5L;
private String description;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Long getSomme() {
return somme;
}
public void setSomme(Long somme) {
this.somme = somme;
}
public String validPromesse() throws PersistenceViolationException {
ejb.savePromesse(null, somme, description);
FacesContext.getCurrentInstance().addMessage("FormPromDon", new FacesMessage(FacesMessage.SEVERITY_INFO,
"Promesse de don enregistré avec succès", null));
return "Succes";
}
}