we are currently workin on a RFID project and we need to generate the RFID serial numbers which is in a specific format (eg: 0101i0010001).
in this the 1st 4 numbers are constant (0101)
the next 4 digit numbers are item id which is got from the JSP textbox(i001)
the last 4 digit numbers are the RFID serial numbers which needs to be generated automatically.. depending upon the item id the series wil vary..
for eg:
for i001 - the seires wil start from 0000
and the number needs to get incremented according to the ordered qty which is another textbox in the same JSP page(eg: if ordered qty is 5 ... then the RFID start no sud be
0101i0010000 and the end no sud be 0101i0010004
this value sud get inserted in the database.. we are using ACCESS..
and the next value for the same item no sud be incremented by 1 from the RFID end no
tat value sud be the start no of the same item only....
CODE FOR AUTOMATIC NO GENERATION
<%@ page import="java.io.*" %>
<HTML>
<head>
<script language = "javascript">
function call(itemno, qty)
{
//String itemno;
//int qty;
var a="0101";
var b=a+itemno;
var start;
var end;
if(itemno.equals('i001'))
{
start=b+"0000";
}
else if(itemno.equals('i002'))
{
start=b+"0200";
}
else if(itemno.equals('i003'))
{
start=b+"0400";
}
else if(itemno.equals('i004'))
{
start=b+"0600";
}
else if(itemno.equals('i005'))
{
start=b+"0800";
}
else
{
start=b+"1000";
}
end=start+qty;
window.open("purchaserequisition.jsp?start=" + start + "&end=" + end);
}
</script>
</head>
<%
String itemno=request.getParameter("itemno");
int qty=Integer.parseInt(request.getParameter("qty"));
%>
<BODY>
<form name=frm onload="call(itemno,qty);">
</form>
</BODY>
</HTML>