posts - 10,comments - 5,trackbacks - 0

          ?//=================公司類方法===================//
          public String getDrop(String compid,String dataid) throws Exception{
          ????? if(str.IsEmpty(dataid) )
          ??????? dataid="AAA";
          ??????Compid? com[]=this.readAll(compid,dataid);
          ????? StringBuffer bf = new StringBuffer();
          ????? if(com.length > 0){
          ?????????? for(int i=0;i<com.length ;i++){
          ???????????? if(dataid.equals(com[i].getBh()) )
          ?????????????? bf.append("<option value=" + com[i].getID()? + " selected >" + com[i].getName() + "</option>") ;
          ???????????? else
          ?????????????? bf.append("<option value=" + com[i].getID()? + ">" + com[i].getName() + "</option>") ;
          ?????????? }
          ???????? }
          ??? return bf.toString();
          ??? }
          ?//=================部門類方法同上===================//

          //====================頁面調(diào)用=====================//

          ???Compid?com = new Compid();
          ???Deptid dep = new Deptid();
          ???Deptid [] depAll=bm.readAll("","");

          ??????????<select name="deptid" style="width:120px">
          ???????? ??<option value="">所有公司
          ????????????<%=com.getDrop(compid,deptid)%>
          ???????? ?</select>

          ???????? ?<select name="deptid" style="width:120px">
          ???????? ??<option value="">所有部門
          ????????????<%=dep.getDrop(compid,deptid)%>
          ???????? ?</select>




          <script language=javascript>

          ?var bm= new Array();
          ?<%if(depAll.length>0){
          ???? for(int i=0;i<depAll.length;i++){%>
          ???? bm[<%=i%>] = new Array("<%=depAll[i].getCom()%>","<%=depAll[i].getID()%>","<%=depAll[i].getName()%>");
          ? <%}}%>
          ?function setBm(){
          ??document.form_com_dep.deptid.length = 0;
          ??document.form_com_dep.deptid.options[document.form_com_dep.deptid.length] = new Option("所有部門","");
          ??var comp = document.form_com_dep.compid.value ;
          ??var i=0;
          ??for (i=0;i < <%=depAll.length%> ; i++)? {
          ???? ?if (bm[i][0] == comp ) {
          ???????? document.form_com_dep.deptid.options[document.form_com_dep.deptid.length] = new Option(bm[i][2], bm[i][1]);
          ???????????? }???????
          ???? }
          ?}
          </script>

          posted on 2006-05-14 13:05 Stellar.He 閱讀(1829) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 江口县| 古浪县| 江达县| 望都县| 汽车| 兴山县| 乃东县| 金湖县| 紫金县| 乡宁县| 平邑县| 楚雄市| 大同市| 阿巴嘎旗| 鸡西市| 丰城市| 上杭县| 扎赉特旗| 东山县| 正蓝旗| 泸西县| 平果县| 太仓市| 措勤县| 桃江县| 永嘉县| 皋兰县| 连城县| 洛扎县| 宿州市| 赤水市| 平陆县| 济阳县| 镇原县| 忻州市| 金山区| 余姚市| 霞浦县| 余干县| 丽水市| 福建省|