JSP实现树型组织架构(7)--修改orgManage.jsp

 

<%@ page contentType="text/html;charset=Big5"%>
<%@ include file="orgConnInclude.jsp"%>

<%
request.setCharacterEncoding("big5");
PreparedStatement ps=null;
ResultSet rs=null;

String  queryCount=" select count(*) "+
                   " from ngb_org "+
                   " where total like ? ORDER BY TOTAL  ";
             
String queryName=" select * "+
                 " from ngb_org "+
                 " where total like ? ORDER BY TOTAL ";
%>


 
 
    管理組織架構
   
 
 
   


     

       
          新增組織架構
       

       

所  屬   部  門
  
   
   
   
  


       

新增部門名稱
       
      
       


     

   

 
 

 
 
 
******有限公司組織架構圖

 


   
     
     
     
     
     
     
   
    <%
    try{
     int i=1;
     ps=conn.prepareStatement(queryCount);
     ps.setString(1, "A10%");
     rs=ps.executeQuery();
     int result=1;
     while(rs.next())
     { result++;}
     //out.println(result);
    
     for( i=1; i<=result; i++){
     ps=conn.prepareStatement(queryName) ;
     String queryNameCondition="A"+(9+i)+"%";
     //out.println(queryNameCondition);
     ps.setString(1, queryNameCondition);
     ResultSet rs1=ps.executeQuery();
     String qa=null;
     String qaTemp=null;
     String qaTemp1=null;
    
     while( rs1.next()){
      qa=rs1.getString("total");
     qaTemp=qa.substring(3,5);
     qaTemp1=qa.substring(3,6);
   
     %>
    
   
     
     
     
     
     
   
   
    <%
  
     queryNameCondition=qaTemp1+"%";
     //out.println(queryNameCondition);
     ps.setString(1, queryNameCondition);
     ResultSet rs2=ps.executeQuery();
     int result1=1;
     while(rs2.next())
     { result1++;}
     //out.println(result1);
     for(  i=1; i<=result1; i++){
     ps=conn.prepareStatement(queryName) ;
     ps.setString(1, queryNameCondition);
     ResultSet rs3=ps.executeQuery();
     String qb=null;
     String qbTemp=null;
     String qbTemp1=null;
     while( rs3.next()){
    
     qb=rs3.getString("total");
     qbTemp=qb.substring(3,5);
     qbTemp1=qb.substring(3,6);
      %>
   
     
     
     
     
     
   
     <%
     ps=conn.prepareStatement(queryCount);
    
      queryNameCondition=qbTemp1+"%";
   
     
    
     //out.println(queryNameCondition);
     ps.setString(1, queryNameCondition);
     ResultSet rs4=ps.executeQuery();
     int result2=1;
     while(rs4.next())
     { result2++;}
     //out.println(result);
     for(  i=1; i<=result2; i++){
     ps=conn.prepareStatement(queryName) ;
     ps.setString(1, queryNameCondition);
     ResultSet rs5=ps.executeQuery();
     String qc=null;
     String qcTemp=null;
     String qcTemp1=null;
     while( rs5.next()){
     qc=rs5.getString("total");
     qcTemp=qc.substring(3,5);
     qcTemp1=qc.substring(3,6);
     %>
       
   
     
     
     
     
     
   
    <%
    

     ps=conn.prepareStatement(queryCount);
   
       queryNameCondition=qcTemp1+"%";
 
    //out.println(queryNameCondition);
     ps.setString(1, queryNameCondition);
     ResultSet rs6=ps.executeQuery();
     int result3=1;
     while(rs6.next())
     { result3++;}
     //out.println(result3);
     for(  i=1; i<=result3; i++){
     ps=conn.prepareStatement(queryName) ;
     ps.setString(1, queryNameCondition);
     ResultSet rs7=ps.executeQuery();
     while( rs7.next()){
    %>
   


     
     
     
     
     
   
     <%
     ps=conn.prepareStatement(queryCount);
     queryNameCondition="E"+(i+9)+"%";
     //out.println(queryNameCondition);
     ps.setString(1, queryNameCondition);
     ResultSet rs8=ps.executeQuery();
     int result4=1;
     while(rs8.next())
     { result4++;}
     //out.println(result3);
     for(  i=1; i<=result4; i++){
     ps=conn.prepareStatement(queryName) ;
     ps.setString(1, queryNameCondition);
     ResultSet rs9=ps.executeQuery();
     while(rs9.next()){
     rs9.getString("name");    %>
    <%}}%>
    <%}}%>
   <% }}%>
   <% }}%>
      <%}}%>
       
 
總經理總經理直屬處級所屬部級所屬刪除部門
<%=rs1.getString("name")%>    
 <%=rs3.getString("name")%>  ">刪除部門
  <%=rs5.getString("name")%> ">刪除部門
   <%=rs7.getString("name")%>">刪除部門

 
  <%}
  catch(SQLException se1)
  {se1.printStackTrace();}
  finally{conn.close();}%>

修改后添加的时候可以动态显示父部门了

你可能感兴趣的:(JSP实现树型组织架构(7)--修改orgManage.jsp)