Commit 96a8a191 authored by ysawant's avatar ysawant

Added Updated component of Department master[14-01-2020]

DeptIC.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@215092 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 999fd54c
......@@ -13,6 +13,7 @@ import org.w3c.dom.NodeList;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.ejb.sys.UtilMethods;
import ibase.webitm.utility.ITMException;
......@@ -67,9 +68,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
String objContext, String currentColumn, String editFlag,
String xtraParams) throws RemoteException, ITMException
{
String colName = " ", mcode = " ", mdescr = " ", mdescr1 = " ";
String mcode = " ", mdescr = " ", mdescr1 = " ";
String deptCodeParent = " ", deptCode = " ";
colName = currentColumn;
Connection connectionObject = null;
int currentFormNo = 0;
StringBuffer valueXmlString = null;
......@@ -300,6 +300,9 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
if (deptCodeParent != null && deptCodeParent.trim().length() > 0)
{
deptCode = genericUtility.getColumnValue("dept_code",dom);
if (deptCode != null && deptCode.trim().length() > 0)
{
if (!deptCodeParent.trim().equalsIgnoreCase(deptCode.trim()))
{
sql = "select FN_GET_DEPT_DESCR(?) from dual";
......@@ -321,7 +324,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
pstmt.close();
pstmt = null;
}
}
else
{
......@@ -330,6 +332,9 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
valueXmlString.append("<parent_dept_descr>").append(mdescr).append("</parent_dept_descr>\r\n");
}
}
}
else if (currentColumn.trim().equals("bu_code"))
......@@ -560,8 +565,10 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
E12GenericUtility genericUtility = new E12GenericUtility();
UtilMethods utilmethod = new UtilMethods();
try {
try
{
connectionObject = getConnection();
ITMDBAccessEJB itmdbaccess = new ITMDBAccessEJB();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginCode");
System.out.println("Line no--468");
if(objContext != null && objContext.trim().length() > 0) {
......@@ -591,7 +598,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
{
if(mVal == null || mVal.length() == 0)
{
errString = getErrorString("dept_code","VEDEP2", userId);
errString = itmdbaccess.getErrorString("dept_code","VEDEP2", userId, "", connectionObject);
return errString;
}
else
{
......@@ -605,7 +613,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt > 0)
{
errString = getErrorString("dept_code","VMDUPL1", userId);
errString = itmdbaccess.getErrorString("dept_code","VMDUPL1", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -626,7 +635,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
mVal = genericUtility.getColumnValue("descr", dom);
if(mVal == null || mVal.length() == 0)
{
errString = getErrorString("descr", "VTDESC1",userId);
errString = itmdbaccess.getErrorString("descr","VTDESC1", userId, "", connectionObject);
return errString;
}
}
else if(childNodeName.equalsIgnoreCase("dept_head"))
......@@ -645,7 +655,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("dept_head","VMEMP1", userId);
errString = itmdbaccess.getErrorString("dept_head","VMEMP1", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -675,7 +686,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("dept_head_1","VMDEPTHD01", userId);
errString = itmdbaccess.getErrorString("dept_head_1","VMDEPTHD01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -705,7 +717,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("acct_code", "VMACCT1",userId);
errString = itmdbaccess.getErrorString("acct_code","VMACCT1", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -735,7 +748,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if (cnt == 0)
{
errString = getErrorString("cctr_code","VMCCTR1", userId);
errString = itmdbaccess.getErrorString("cctr_code","VMCCTR1", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -751,7 +765,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
else if(childNodeName.equalsIgnoreCase("acct_code__ap"))
{
//cnt = 0;
System.out.println(":::::::::acct_code__ap::::::::::");
acctCodeAp = genericUtility.getColumnValue("acct_code__ap", dom);
if(acctCodeAp != null && acctCodeAp.trim().length() > 0)
......@@ -766,7 +779,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("acct_code__ap", "VMDEPTAC01",userId);
errString = itmdbaccess.getErrorString("acct_code__ap","VMDEPTAC01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -782,7 +796,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
else if(childNodeName.equalsIgnoreCase("cctr_code__ap"))
{
//cnt = 0;
System.out.println(":::::::::::cctr_code__ap::::::::::::");
cctrCodeAp = genericUtility.getColumnValue("cctr_code__ap", dom);
if(cctrCodeAp !=null && cctrCodeAp.trim().length() > 0)
......@@ -797,7 +810,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if (cnt == 0)
{
errString = getErrorString("cctr_code__ap","VMDEPTCC01", userId);
errString = itmdbaccess.getErrorString("cctr_code__ap","VMDEPTCC01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -827,7 +841,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("pay_table","VMPYTAB2", userId);
errString = itmdbaccess.getErrorString("pay_table","VMPYTAB2", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -861,7 +876,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("dept_code__parent", "VMDEPTPD01",userId);
errString = itmdbaccess.getErrorString("dept_code__parent","VMDEPTPD01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -894,7 +910,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt > 0)
{
errString = getErrorString("dept_code__parent","VMDEPTPD02", userId);
errString = itmdbaccess.getErrorString("dept_code__parent","VMDEPTPD02", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -912,7 +929,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
else
{
errString = getErrorString("dept_code__parent","VMDEPTPD03", userId);
errString = itmdbaccess.getErrorString("dept_code__parent","VMDEPTPD03", userId, "", connectionObject);
return errString;
}
}
else if(childNodeName.equalsIgnoreCase("bu_code"))
......@@ -932,7 +950,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if (cnt == 0)
{
errString = getErrorString("bu_code","VMDEPTBU01", userId);
errString = itmdbaccess.getErrorString("bu_code","VMDEPTBU01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -963,7 +982,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("func_code","VMDEPTFU01", userId);
errString = itmdbaccess.getErrorString("func_code","VMDEPTFU01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......@@ -995,9 +1015,20 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
{
cnt = resultSet.getInt("cnt");
}
if (resultSet != null)
{
resultSet.close();
resultSet = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errString = getErrorString("emp_code__funchead", "VMDEPTFH01",userId);
errString = itmdbaccess.getErrorString("emp_code__funchead","VMDEPTFH01", userId, "", connectionObject);
return errString;
}
else
{
......@@ -1010,15 +1041,6 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
mVal1 = resultSet.getString("status");
mdate1 = resultSet.getTimestamp("relieve_date");
}
if(mVal1 != null && mVal1.trim().equalsIgnoreCase("S"))
{
errString = getErrorString("emp_code__funchead", "VMDEPTFH02",userId);
}
else if(mdate1 != null &&( utilmethod.date(mdate1).equals(utilmethod.today()) || utilmethod.date(mdate1).before(utilmethod.today())))
{
errString = getErrorString("emp_code__funchead", "VMDEPTFH03",userId);
System.out.println("relieve_date line 835>>>>"+mdate1);
}
if (resultSet != null)
{
resultSet.close();
......@@ -1029,16 +1051,16 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
pstmt.close();
pstmt = null;
}
}
if (resultSet != null)
if(mVal1 != null && mVal1.trim().equalsIgnoreCase("S"))
{
resultSet.close();
resultSet = null;
errString = itmdbaccess.getErrorString("emp_code__funchead","VMDEPTFH02", userId, "", connectionObject);
return errString;
}
if (pstmt != null)
else if(mdate1 != null &&( utilmethod.date(mdate1).equals(utilmethod.today()) || utilmethod.date(mdate1).before(utilmethod.today())))
{
pstmt.close();
pstmt = null;
errString = itmdbaccess.getErrorString("emp_code__funchead","VMDEPTFH03", userId, "", connectionObject);
return errString;
}
}
}
......@@ -1060,7 +1082,8 @@ public class DeptIC extends ValidatorEJB implements DeptICRemote, DeptICLocal
}
if(cnt == 0)
{
errString = getErrorString("item_ser", "VMDEPTIS01",userId);
errString = itmdbaccess.getErrorString("item_ser","VMDEPTIS01", userId, "", connectionObject);
return errString;
}
if (resultSet != null)
{
......
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