public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException, CommunicationException, NamingException
{
String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
AccountFacadeHome accountFacadeHome = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome","AccountFacade");
try
{
PurchaseOrderForm purchaseForm = (PurchaseOrderForm)form;
purchaseForm.convertItemLines();
ItemLines itemLines = null;
HttpSession session = request.getSession(true);
UserObject userobjectd = (UserObject)session.getAttribute( "userobject" );//get the user object
int individualID = userobjectd.getIndividualID();
request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.PURCHASEORDER);
request.setAttribute("body",AccountConstantKeys.EDIT);
String typeOfOperation = request.getParameter(AccountConstantKeys.TYPEOFOPERATION);
if ( typeOfOperation != null && typeOfOperation.equals("ShowPurchaseOrder"))
{
int purchaseID = 0;
String purchaseIDStr = (String)request.getParameter("rowId");
if(purchaseIDStr != null && !purchaseIDStr.equals(""))
purchaseID = Integer.parseInt(purchaseIDStr);
// for getting data from EJB
AccountFacade remote =(AccountFacade)accountFacadeHome.create();
remote.setDataSource(dataSource);
PurchaseOrderVO vo = remote.getPurchaseOrderVO(purchaseID,individualID);
purchaseForm.setPurchaseOrderid(vo.getPurchaseOrderId()+"");