Commit 7269eeaf authored by pshinde's avatar pshinde

Lock_type should be non-editable at time of edit if value is entered in it


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96847 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bc542f32
...@@ -15,6 +15,9 @@ import java.rmi.RemoteException; ...@@ -15,6 +15,9 @@ import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
import java.sql. PreparedStatement; import java.sql. PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import javax.ejb.LockType;
import org.w3c.dom.*; import org.w3c.dom.*;
@javax.ejb.Stateless @javax.ejb.Stateless
...@@ -100,6 +103,7 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI ...@@ -100,6 +103,7 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI
String lockCode = null; String lockCode = null;
String sql = null; String sql = null;
String refSer = null; String refSer = null;
String lockType=null;//added by priyanka on 19/11/14
int count = 0; int count = 0;
...@@ -184,6 +188,7 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI ...@@ -184,6 +188,7 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI
break; break;
} }
} }
break; break;
case 2: case 2:
...@@ -355,9 +360,17 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI ...@@ -355,9 +360,17 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI
*/ */
public String itemChanged( Document currDom, Document hdrDom, Document allDom, String objContext, String currentColumn, String editFlag, String xtraParams ) throws RemoteException,ITMException public String itemChanged( Document currDom, Document hdrDom, Document allDom, String objContext, String currentColumn, String editFlag, String xtraParams ) throws RemoteException,ITMException
{ {
int ctr = 0;
String errString = ""; String errString = "";
String lockCode = ""; String lockCode = "";
String lockType="";
int currentFormNo = 0; int currentFormNo = 0;
NodeList parentNodeList = null;
NodeList childNodeList = null;
Node parentNode = null;
Node childNode = null;
int childNodeListLength = 0;
String childNodeName = null;
StringBuffer valueXmlString = new StringBuffer(); StringBuffer valueXmlString = new StringBuffer();
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
try try
...@@ -372,6 +385,47 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI ...@@ -372,6 +385,47 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI
} }
switch(currentFormNo) switch(currentFormNo)
{ {
case 1:
System.out.println("State itemchanged case 1");
parentNodeList = hdrDom.getElementsByTagName("Detail1");
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
do
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
if (childNodeName.equals(currentColumn))
{
childNode.getFirstChild();
}
ctr++;
}
while ((ctr < childNodeListLength) && (!childNodeName.equals(currentColumn)));
if ( currentColumn.trim().equalsIgnoreCase( "itm_defaultedit" ))
{
//added by priyanka on 19/11/14
//if value entered in lock_type then its should be non-editable during edit
lockType = genericUtility.getColumnValue("lock_type",hdrDom);
System.out.println("lockType=============>"+lockType);
//To set default lock_code as entered in form 1
if(lockType!=null && lockType.trim().length()>0)
{
valueXmlString.append( "<lock_type protect ='1'><![CDATA[" ).append( lockType ).append( "]]></lock_type>\r\n" );
}
else
{
valueXmlString.append( "<lock_type protect ='0'><![CDATA[" ).append( lockType ).append( "]]></lock_type>\r\n" );
}
}
valueXmlString.append("</Detail1>");
break;
case 2: case 2:
valueXmlString.append("<Detail2>\r\n"); valueXmlString.append("<Detail2>\r\n");
if ( currentColumn.trim().equalsIgnoreCase( "itm_default" )) if ( currentColumn.trim().equalsIgnoreCase( "itm_default" ))
...@@ -380,6 +434,8 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI ...@@ -380,6 +434,8 @@ public class InvLockIC extends ValidatorEJB implements InvLockICRemote, InvLockI
//To set default lock_code as entered in form 1 //To set default lock_code as entered in form 1
valueXmlString.append( "<lock_code protect ='1'><![CDATA[" ).append( lockCode ).append( "]]></lock_code>\r\n" ); valueXmlString.append( "<lock_code protect ='1'><![CDATA[" ).append( lockCode ).append( "]]></lock_code>\r\n" );
} }
valueXmlString.append("</Detail2>\r\n"); valueXmlString.append("</Detail2>\r\n");
} }
} }
......
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