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 44 45 46 47 48 49 50 51 52
| protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("btn.editLibelleFonction", "editLibelleFonction");
map.put("btn.addLibelleFonction", "addLibelleFonction");
map.put("btn.editLibelleService", "editLibelleService");
map.put("btn.addLibelleService", "addLibelleService");
map.put("btn.editLibelleStatut", "editLibelleStatut");
map.put("btn.addLibelleStatut", "addLibelleStatut");
return map;
}
/** Action called on Add button click
*/
public ActionForward addLibelleFonction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws java.lang.Exception {
OptionsForm f = (OptionsForm) form;
FonctionAgentBean fct = new FonctionAgentBean();
fct.setLibelleFonction(f.getLibFonctionAdd());
fct.setGradeFonction(f.getGradeChoisi2());
ActionMessages messages=new ActionMessages();
if (new FonctionAgentDAO().addFonctionAgent(fct)>0)
messages.add("msg",new ActionMessage("msg.options.fct.ajoutOk"));
else
messages.add("msg",new ActionMessage("msg.options.fct.ajoutEchec"));
this.saveMessages(request,messages);
return mapping.findForward("retourOptions");
}
/** Action called on Edit button click
*/
public ActionForward editLibelleFonction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
OptionsForm f = (OptionsForm) form;
FonctionAgentBean fct = new FonctionAgentBean();
fct.setLibelleFonction(f.getLibFonctionEdit());
fct.setLibelleFonction(f.getLibFonctionEdit());
fct.setCodeFonction(f.getCodeFonction());
ActionMessages messages=new ActionMessages();
if (new FonctionAgentDAO().updateFonctionAgent(fct)>0)
messages.add("msg",new ActionMessage("msg.options.fct.editOk"));
else
messages.add("msg",new ActionMessage("msg.options.echec"));
this.saveMessages(request,messages);
return mapping.findForward("retourOptions");
} |