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 ...@@ -29,6 +29,7 @@ public class BillofQuantityConf extends ActionHandlerEJB implements BillofQuanti
ConnDriver connDriver = null; ConnDriver connDriver = null;
String loginEmpCode = ""; String loginEmpCode = "";
String confirm = "" ; String confirm = "" ;
String status = "";
String errString = "" ; String errString = "" ;
ValidatorEJB validatorEJB = null; ValidatorEJB validatorEJB = null;
...@@ -44,45 +45,56 @@ public class BillofQuantityConf extends ActionHandlerEJB implements BillofQuanti ...@@ -44,45 +45,56 @@ public class BillofQuantityConf extends ActionHandlerEJB implements BillofQuanti
conn.setAutoCommit(false); conn.setAutoCommit(false);
loginEmpCode = validatorEJB.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode"); 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 = conn.prepareStatement(sql);
pstmt.setString(1,tranId); pstmt.setString(1,tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
confirm = rs.getString("confirmed"); confirm = rs.getString("confirmed");;
//siteCode = rs.getString("site_code"); status = rs.getString("status");
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(confirm != null && "Y".equalsIgnoreCase(confirm)) if(confirm != null && confirm.equalsIgnoreCase("Y"))
{ {
System.out.println("The Selected transaction is already confirmed"); System.out.println("The Selected transaction is already confirmed");
errString = itmDBAccessEJB.getErrorString("","VTMCONF1","","",conn); errString = itmDBAccessEJB.getErrorString("","VTMCONF1","","",conn);
return errString; 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 = ?"; sql = "update boqhdr set confirmed = 'Y', conf_date = ?,emp_code__aprv = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDate(1, new java.sql.Date(new java.util.Date().getTime())); pstmt.setDate(1, new java.sql.Date(new java.util.Date().getTime()));
pstmt.setString(2, loginEmpCode); pstmt.setString(2, loginEmpCode);
pstmt.setString(3, tranId); pstmt.setString(3, tranId);
int updateCoount = pstmt.executeUpdate(); int updateCoount = pstmt.executeUpdate();
System.out.println("no of row update = "+updateCoount); System.out.println("no of row update = "+updateCoount);
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(updateCoount > 0) if(updateCoount > 0)
{ {
errString = itmDBAccessEJB.getErrorString("","VTCICONF3 ","","",conn); errString = itmDBAccessEJB.getErrorString("","VTCICONF3 ","","",conn);
} }
System.out.println("115 err String from confirm method.....");
} }
} //end of try }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception ::"+e.getMessage()); 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