Search in sources :

Example 1 with PersonnelNoteActionForm

use of org.mifos.customers.personnel.struts.actionforms.PersonnelNoteActionForm in project head by mifos.

the class PersonnelNoteAction method load.

@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    clearActionForm(form);
    PersonnelNoteActionForm actionForm = (PersonnelNoteActionForm) form;
    Short personnelId = getShortValue(actionForm.getPersonnelId());
    PersonnelBO personnelBO = this.personnelDao.findPersonnelById(personnelId);
    actionForm.setPersonnelName(personnelBO.getDisplayName());
    actionForm.setOfficeName(personnelBO.getOffice().getOfficeName());
    actionForm.setGlobalPersonnelNum(personnelBO.getGlobalPersonnelNum());
    actionForm.setCommentDate(DateUtils.getCurrentDate(getUserContext(request).getPreferredLocale()));
    SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
    SessionUtils.setAttribute(Constants.BUSINESS_KEY, personnelBO, request);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : PersonnelBO(org.mifos.customers.personnel.business.PersonnelBO) PersonnelNoteActionForm(org.mifos.customers.personnel.struts.actionforms.PersonnelNoteActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with PersonnelNoteActionForm

use of org.mifos.customers.personnel.struts.actionforms.PersonnelNoteActionForm in project head by mifos.

the class PersonnelNoteAction method create.

@CloseSession
@TransactionDemarcate(validateAndResetToken = true)
public ActionForward create(ActionMapping mapping, ActionForm form, @SuppressWarnings("unused") HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    PersonnelNoteActionForm actionForm = (PersonnelNoteActionForm) form;
    Short personnelId = getShortValue(actionForm.getPersonnelId());
    this.centerServiceFacade.addNoteToPersonnel(personnelId, actionForm.getComment());
    return mapping.findForward(ActionForwards.create_success.toString());
}
Also used : PersonnelNoteActionForm(org.mifos.customers.personnel.struts.actionforms.PersonnelNoteActionForm) CloseSession(org.mifos.framework.util.helpers.CloseSession) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

PersonnelNoteActionForm (org.mifos.customers.personnel.struts.actionforms.PersonnelNoteActionForm)2 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)2 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)1 CloseSession (org.mifos.framework.util.helpers.CloseSession)1