Commit f6885657 authored by asikarwar's avatar asikarwar

add validation cancel record cannot be confirm .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92973 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 70c106f5
......@@ -29,6 +29,7 @@ public class BillofQuantityConf extends ActionHandlerEJB implements BillofQuanti
ConnDriver connDriver = null;
String loginEmpCode = "";
String confirm = "" ;
String status = "";
String errString = "" ;
ValidatorEJB validatorEJB = null;
......@@ -44,45 +45,56 @@ public class BillofQuantityConf extends ActionHandlerEJB implements BillofQuanti
conn.setAutoCommit(false);
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
sql =" select confirmed from boqhdr where tran_id = ?";
sql = "select confirmed ,status 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");
confirm = rs.getString("confirmed");;
status = rs.getString("status");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if(confirm != null && "Y".equalsIgnoreCase(confirm))
if(confirm != null && confirm.equalsIgnoreCase("Y"))
{
System.out.println("The Selected transaction is already confirmed");
errString = itmDBAccessEJB.getErrorString("","VTMCONF1","","",conn);
return errString;
}
else
else if(status != null && status.equalsIgnoreCase("X"))
{
System.out.println("The Selected transaction is cancle");
errString = itmDBAccessEJB.getErrorString("","VTINDCONF1","","",conn);
return errString;
}
else /*(confirm != null && confirm.equalsIgnoreCase("N") && !status.equalsIgnoreCase("C"))*/
{
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);
}
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);
}
System.out.println("115 err String from confirm method.....");
}
} //end of try
}
catch(Exception e)
{
System.out.println("Exception ::"+e.getMessage());
......
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