}
@Override
public Resultat saveEvents(List<DetailEvent> listDetailEvent,
List<Taxes> listTaxe) {
Events events=listDetailEvent.get(0).getEvents();
EntityManager em=getEntityManager();
EntityTransaction tx=em.getTransaction();
tx.begin();
try{
this.persist(events, em);
for(int i=0;i<listDetailEvent.size();i++){
listDetailEvent.get(i).setEvents(events);
listDetailEvent.get(i).setId(new DetailEventId(events.getIdLot(),i));
this.persist(listDetailEvent.get(i), em);
}
new SysEcritsDao(listDetailEvent,listTaxe,em).persistAllEcrits();
tx.commit();
return new Resultat(true,"Validation effectuee avec succes.",events.getIdLot());
}catch(Exception e){
e.printStackTrace();
tx.rollback();
return new Resultat(false,"Erreur fatale: "+e.getMessage());
}finally{