Commit a584c3d5 authored by asikarwar's avatar asikarwar

bill of quantity initial version


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91962 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cf78d311
/**
* @author : Akhilesh Sikarwar
* @Version : 1.0
* Date : 03/10/12
*/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import java.sql.*;
import ibase.webitm.ejb.*;
import ibase.system.config.*;
import javax.ejb.Stateless;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
@Stateless
public class BillofQuantityConf extends ActionHandlerEJB implements BillofQuantityConfLocal,BillofQuantityConfRemote //SessionBean
{
public String confirm(String tranId,String xtraParams,String forcedFlag) throws RemoteException,ITMException
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
String sql = "";
ConnDriver connDriver = null;
String loginEmpCode = "";
String confirm = "" ;
String errString = "" ;
ValidatorEJB validatorEJB = null;
ITMDBAccessEJB itmDBAccessEJB = null;
try
{
itmDBAccessEJB = new ITMDBAccessEJB();
validatorEJB = new ValidatorEJB();
connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
sql =" select confirmed from boqhdr where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
confirm = rs.getString("confirmed");
//siteCode = rs.getString("site_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(confirm != null && "Y".equalsIgnoreCase(confirm))
{
System.out.println("The Selected transaction is already confirmed");
errString = itmDBAccessEJB.getErrorString("","VTMCONF1","","",conn);
return errString;
}
else
{
sql = "update boqhdr set confirmed = 'Y', conf_date = ?,emp_code__aprv = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDate(1, new java.sql.Date(new java.util.Date().getTime()));
pstmt.setString(2, loginEmpCode);
pstmt.setString(3, tranId);
int updateCoount = pstmt.executeUpdate();
System.out.println("no of row update = "+updateCoount);
pstmt.close();
pstmt = null;
if(updateCoount > 0)
{
errString = itmDBAccessEJB.getErrorString("","VTCICONF3 ","","",conn);
}
}
} //end of try
catch(Exception e)
{
System.out.println("Exception ::"+e.getMessage());
errString = GenericUtility.getInstance().createErrorString(e);
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(errString != null && errString.trim().length() > 0)
{
if(errString.indexOf("VTCICONF3") > -1)
{
conn.commit();
}
else
{
conn.rollback();
}
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
conn.close();
}
catch(Exception e)
{
System.out.println("Exception : "+e);e.printStackTrace();
throw new ITMException(e);
}
}
return errString;
}//end of confirm method
} //class
/**
* @author : Akhilesh Sikarwar
* @Version : 1.0
* Date : 03/10/12
*/
package ibase.webitm.ejb.dis;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
import java.sql.*;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.Local; // added for ejb3
@Local
public interface BillofQuantityConfLocal extends ActionHandlerLocal//,EJBObject
{
public String confirm(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
/**
* @author : Akhilesh Sikarwar
* @Version : 1.0
* Date : 03/10/12
*/
package ibase.webitm.ejb.dis;
import ibase.webitm.utility.ITMException;
import ibase.webitm.ejb.*;
import java.rmi.RemoteException;
import java.sql.*;
//import javax.ejb.EJBObject;
import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface BillofQuantityConfRemote extends ActionHandlerRemote//, EJBObject
{
public String confirm(String tranID, String xtraParams, String forcedFlag) throws RemoteException,ITMException;
}
This diff is collapsed.
/********************************************************
Title : BillofQuantityICLocal
Date : 20/09/2012
Developer: Akhilesh Sikarwar
********************************************************/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local; // added for ejb3
@Local // added for ejb3
public interface BillofQuantityICLocal extends ValidatorLocal
{
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
/********************************************************
Title : BillofQuantityICRemote
Date : 22/09/2012
Developer: Akhilesh Sikarwar
********************************************************/
package ibase.webitm.ejb.dis;
import java.rmi.RemoteException;
import org.w3c.dom.*;
import ibase.webitm.ejb.*;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote; // added for ejb3
@Remote // added for ejb3
public interface BillofQuantityICRemote extends ValidatorRemote {
public String wfValData(String xmlString, String xmlString1, String xmlString2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String wfValData(Document dom, Document dom1, Document dom2, String objContext, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException,ITMException;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment