Commit 2bc6212b authored by Satish's avatar Satish

Provide feedback Ic component with lineno itemchange

parent 50394f72
package ibase.webitm.ejb.vhb.msq1;
import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import ibase.utility.BaseLogger;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.ITMException;
public class ProvideFeedbackIC extends ValidatorEJB{
E12GenericUtility genericUtility = new E12GenericUtility();
public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
{
BaseLogger.log("3", getUserInfo(), null,"Inside itemchanged method");
ResultSet rs=null;
PreparedStatement pstmt=null;
String sql="",loginSite="",hospCode="",hospName= "",custCode="",custName="",currCode="", siteCode="", QuotNo="", ls_line_no="";
long ls_line_no1=0l;
double exchRate= 1.0;
Timestamp quoDate=null;
double lineNo1=0.0 , quantity=0.0 , rate=0.0 , quantityOld=0.0;
int amendmentCount=0;
String ll_line_no="", quotNo="";
String itemCode = "";
String itemName = "";
String unit ="";
double quantity1 = 0.0;
double rate1 = 0.0;
double newRate =0.0;
double oldRate = 0.0;
Timestamp ldt_date = new Timestamp(System.currentTimeMillis());
Connection conn = null;
try {
conn = getConnection();
switch(objContext)
{
case "1":
{
switch(currentColumn)
{
case "itm_default":
{
break;
}
}
break;
}
case "2":
{
switch(currentColumn)
{
case "itm_default":
{
String QuotNo1= whenNull(getItemString(dom1, 1, "quot_no"));
setItem(dom, 1, "quot_no", QuotNo1);
break;
}
case "quot_line_no":
{
ls_line_no = getItemString(dom, 1, "quot_line_no");
if(ls_line_no != null && ls_line_no.length() > 0)
{
ls_line_no1 = Long.parseLong(ls_line_no);
}
else
{
ls_line_no1 = 0;
}
String quotNo1 = whenNull(getItemString(dom1, 1, "quot_no"));
sql=" select quot_no , item_code , descr , unit, " +
" quantity , aprv_rate " +
" from sales_quotdet " +
" where quot_no = ? and line_no = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1, quotNo1);
pstmt.setLong(2, ls_line_no1);
rs=pstmt.executeQuery();
if(rs.next())
{
quotNo = rs.getString("quot_no");
itemCode = rs.getString("item_code");
itemName = rs.getString("descr");
unit = rs.getString("unit");
quantity1 = rs.getDouble("quantity");
rate = rs.getDouble("aprv_rate");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
setItem(dom, 1, "quot_no", quotNo);
setItem(dom, 1, "item_code", itemCode);
setItem(dom, 1, "item_name", itemName);
setItem(dom, 1, "quantity", String.valueOf(quantity1));
setItem(dom, 1, "aprv_rate", rate);
break;
}
}
break;
}
}
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt!= null)
{
pstmt.close();
pstmt = null;
}
if( conn != null )
{
conn.close();
conn = null;
}
}
catch(Exception d)
{
d.printStackTrace();
}
}
return "";
}
}
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