String typeOfSave = "saveclose";
if (request.getParameter("buttonpress") != null)
typeOfSave = request.getParameter("buttonpress");
AccountFacade remote = (AccountFacade)accountFacadeHome.create();
remote.setDataSource(dataSource);
PurchaseOrderVOX vox = new PurchaseOrderVOX(purchaseForm);
PurchaseOrderVO vo = vox.getVO();
if (typeOfSave != null && typeOfSave.equals("save"))
{
remote.updatePurchaseOrder(vo,IndividualId);
FORWARD_final = FORWARD_save;
request.setAttribute(AccountConstantKeys.TYPEOFOPERATION, AccountConstantKeys.EDIT);
}// end of if (typeOfSave != null && typeOfSave.equals("save"))
else if (typeOfSave != null && typeOfSave.equals("savenew"))
{
remote.updatePurchaseOrder(vo,IndividualId);
FORWARD_final = FORWARD_savenew;
request.setAttribute("clearform", "true");
request.setAttribute(AccountConstantKeys.TYPEOFOPERATION, AccountConstantKeys.ADD);
}// end of else if (typeOfSave != null && typeOfSave.equals("savenew"))
else if (typeOfSave != null && typeOfSave.equals("saveclose"))
{
remote.updatePurchaseOrder(vo,IndividualId);
FORWARD_final = FORWARD_saveclose;
request.setAttribute("body", "list");
}// end of else if (typeOfSave != null && typeOfSave.equals("saveclose"))
else if (typeOfSave != null && typeOfSave.equals("delete"))
{
remote.deletePurchaseOrder(vo.getPurchaseOrderId(),IndividualId);
FORWARD_final = FORWARD_saveclose;
request.setAttribute("body", "list");
}// end of else if (typeOfSave != null && typeOfSave.equals("delete"))
request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.PURCHASEORDER);