Subversion Repositories eFlore/Applications.del

Rev

Rev 234 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
116 benjamin 1
package org.tela_botanica.del.client.vues.plateformedetermination.vote.protocole.personnel;
2
 
3
import java.util.Date;
4
 
5
import org.tela_botanica.del.client.modeles.Protocole;
6
import org.tela_botanica.del.client.modeles.VoteProtocole;
287 benjamin 7
import org.tela_botanica.del.client.services.rest.VoteProtocoleService;
116 benjamin 8
import org.tela_botanica.del.client.utils.MockDatasource;
9
 
10
import com.google.gwt.event.dom.client.ClickEvent;
11
import com.google.gwt.event.dom.client.ClickHandler;
12
import com.google.gwt.user.client.ui.HasWidgets;
13
 
14
public class MonVoteProtocolePresenteur {
15
 
16
	private MonVoteProtocoleVue vue;
17
 
18
	private Protocole protocole;
19
 
287 benjamin 20
	private VoteProtocoleService voteProtocoleService = MockDatasource.getInstance();
116 benjamin 21
 
22
	public MonVoteProtocolePresenteur(Protocole protocole) {
23
		this.protocole = protocole;
24
		vue = new MonVoteProtocoleVue();
25
	}
26
 
27
	public void go(HasWidgets container) {
28
		container.add(vue);
29
	}
30
 
31
	public void gererEvenements() {
32
		vue.getBoutonVote().addClickHandler(new ClickHandler() {
33
 
34
			@Override
35
			public void onClick(ClickEvent event) {
36
				VoteProtocole voteProtocole = new VoteProtocole();
37
				voteProtocole.setDate(new Date());
38
				voteProtocole.setVote(vue.getRating().getValue());
234 gduche 39
				voteProtocole.setProtocole(protocole);
116 benjamin 40
 
41
				vue.getRating();
287 benjamin 42
				voteProtocoleService.saveVote(voteProtocole);
116 benjamin 43
			}
44
		});
45
	}
46
}