posts - 20,comments - 6,trackbacks - 0
<table align="center" width="640">
    
<tr >
        
<td>
            对应网点:
&nbsp;&nbsp;&nbsp;&nbsp;
            
<select name="wangdian" id="wangdian" style="width:80pt;" onchange="window.location='/safety-wxy/ent/wangdian_extend_update.jsp?dwdm=<%=dwdm%>&wxyid=<%=wxyid%>&uuid='+this.value;">
            <option value="0"></option>
            
<%
                String oid 
= "";
                String wdname 
= "";

                Connection connection;
                
try
                
{
                    connection 
= DataFactory.getConnection("wxyinfor");
                }

                
catch(Exception e)
                
{
                    
throw new SQLException(e.toString());
                }

                
                Statement statement
=null;
                ResultSet resultset
=null;
                
//System.out.println("--------"+uuid);
                String sql = "select oid,wdname,wdaddress,wdfzr,wdlxdh from T_xzwdext where dwdm = '"+dwdm+"' and wxyid = '"+wxyid+"'";
                System.out.println(
"----test sql ---"+sql);

                
try
                
{
                    statement 
= connection.createStatement();

                    
//resultset = statement.executeUpdate(sql);
                    resultset=statement.executeQuery(sql);

                    
while (resultset.next()) 
                    
{
                        
//oid = resultset.getString("oid");
            %>

            
<option value="<%=resultset.getString("oid") %>"><%=resultset.getString("wdname"%></option>
            
<%
                
//wdname = resultset.getString("wdname");
                
            }
   
    }

    
catch(Exception e)
    
{
        System.out.println(e.getMessage());
    }

    
finally
    
{
        
try
        
{
            
if(null!=resultset)
            
{
                resultset.close();
                resultset 
= null;
            }

        }
catch(SQLException e1){}

        
try
        
{
            
if(null!=statement)
            
{
                statement.close();
                statement 
= null;
            }

        }

        
catch(SQLException e2){}

        
try
        
{
            
if(null!=connection)
            
{
                connection.close();
                connection 
= null;
            }

        }

        
catch(SQLException e3){}    
    }

    
            
%>

            
<%
                System.out.println(usertype);    
                
if(usertype!=null & !"adm".equals(usertype)){
            
%>
                    
<input name="wadd" type="button" id="wadd"
                        value
="添加网点" onclick="window.location='/safety-wxy/ent/wangdian_extend.jsp?dwdm=<%=dwdm%>&wxyid=<%=wxyid%>'">
            
<%
                }

            
%>
        
        
</td>
    
</tr>
</table>
posted on 2009-07-02 15:07 Johnhe 阅读(150) 评论(0)  编辑  收藏 所属分类: javascript

只有注册用户登录后才能发表评论。


网站导航: