X
xiaotianwangzi
Unregistered / Unconfirmed
GUEST, unregistred user!
if语句是用来控制以下的语句不要出现哟未填项,但是好象没有在控制之中,请指点
i=zgjt.length()*zgyb.length()*sbjj.length()*yljj.length()*yhjb.length()*sfje.length();
String sql2=new String();
%><%
if(i!=0){
String ss=new String();
ss="select * from rs_ygzxx where zgbh='"+zgbh+"'";
ResultSet rs=hyg.executeQuery(ss);
int flag=1;
if(rs.next()){
flag=0;
}
rs.close();
if(flag==1){
sql2="insert into rs_ygzls(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
sql="insert into rs_ygzxx(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt=conn.createStatement();
stmt.executeUpdate(sql2);
stmt.executeUpdate(sql);
// ResultSet rs=hhh.executeQuery(sql);
stmt.close();
conn.close();
%>
<h3><font ><%=zgxm1%>你好,工资设置成功</font></h3>
<br>
<br>
<div align="center">
<table width="80%" border="1" align="center" cellspacing="0" cellpadding="0">
<tr><td>部门编号:</td><td><%=bmbh%>
<td>部门名称:</td><td><%=bmmc1%></tr>
<tr><td>序号:</td><td><%=xh%>
<td>职工姓名:</td><td><%=zgxm1%></tr>
<tr><td>用户级别:</td><td><%=yhjb1%>
<td>岗位类别:</td><td><%=gwlb%></tr>
<tr><td>职工津贴:</td><td><%=zgjt1%>
<td>职工月补:</td><td><%=zgyb1%></tr>
<tr><td>社保基金:</td><td><%=sbjj1%>
<td>医疗基金:</td><td><%=yljj%></tr>
<tr><td>应发金额:</td><td><%=yfje1%>
<td>实发金额:</td><td><%=sfje1%></tr>
</table>
<p>
如果设置完成,请<a href="jxglxt.html">返回首页</a>
<br><a href="yggz.html">继续设置</a>
</div>
<%
}
else
{
%>
<div align="center">
<h3><font align="center">对不起,这个用户已经设置,请重新选择用户。</font></h3>
<br>
<font align="center"><a href="mmxg1.jsp">返回</a></font>
<%
}
}else
{
%>
<b>请检查是否有未填项</b>
<%
}
%>
</body>
</html>
i=zgjt.length()*zgyb.length()*sbjj.length()*yljj.length()*yhjb.length()*sfje.length();
String sql2=new String();
%><%
if(i!=0){
String ss=new String();
ss="select * from rs_ygzxx where zgbh='"+zgbh+"'";
ResultSet rs=hyg.executeQuery(ss);
int flag=1;
if(rs.next()){
flag=0;
}
rs.close();
if(flag==1){
sql2="insert into rs_ygzls(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
sql="insert into rs_ygzxx(bmbh,bmmc,xh,zgbh,xm,zbsj,zbnf,zbyf,gwlb,ryjt,zgyb,sbjj,yljj,jb,sfje,yfje)values('"+bmbh+"','"+bmmc1+"','"+xh+"','"+zgbh+"','"+zgxm1+"','"+zbsj+"','"+zbnf+"','"+zbyf+"','"+gwlb+"','"+zgjt1+"','"+zgyb1+"','"+sbjj1+"','"+yljj1+"','"+yhjb1+"','"+sfje1+"','"+yfje1+"')";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection conn=DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;User=sa;Password=rj;DatabaseName=mjgl001");
Statement stmt=conn.createStatement();
stmt.executeUpdate(sql2);
stmt.executeUpdate(sql);
// ResultSet rs=hhh.executeQuery(sql);
stmt.close();
conn.close();
%>
<h3><font ><%=zgxm1%>你好,工资设置成功</font></h3>
<br>
<br>
<div align="center">
<table width="80%" border="1" align="center" cellspacing="0" cellpadding="0">
<tr><td>部门编号:</td><td><%=bmbh%>
<td>部门名称:</td><td><%=bmmc1%></tr>
<tr><td>序号:</td><td><%=xh%>
<td>职工姓名:</td><td><%=zgxm1%></tr>
<tr><td>用户级别:</td><td><%=yhjb1%>
<td>岗位类别:</td><td><%=gwlb%></tr>
<tr><td>职工津贴:</td><td><%=zgjt1%>
<td>职工月补:</td><td><%=zgyb1%></tr>
<tr><td>社保基金:</td><td><%=sbjj1%>
<td>医疗基金:</td><td><%=yljj%></tr>
<tr><td>应发金额:</td><td><%=yfje1%>
<td>实发金额:</td><td><%=sfje1%></tr>
</table>
<p>
如果设置完成,请<a href="jxglxt.html">返回首页</a>
<br><a href="yggz.html">继续设置</a>
</div>
<%
}
else
{
%>
<div align="center">
<h3><font align="center">对不起,这个用户已经设置,请重新选择用户。</font></h3>
<br>
<font align="center"><a href="mmxg1.jsp">返回</a></font>
<%
}
}else
{
%>
<b>请检查是否有未填项</b>
<%
}
%>
</body>
</html>