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();
          ??? }
          ?//=================部門類方法同上===================//

          //====================頁面調用=====================//

          ???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)  編輯  收藏

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


          網站導航:
           
          主站蜘蛛池模板: 大城县| 福州市| 南涧| 浠水县| 磴口县| 林周县| 九江县| 托里县| 武山县| 威海市| 红原县| 正宁县| 于田县| 河北省| 延吉市| 四平市| 黎川县| 洪江市| 治县。| 孟津县| 厦门市| 金山区| 溧阳市| 夏河县| 马关县| 定南县| 陇南市| 平度市| 板桥市| 新安县| 手游| 冕宁县| 怀安县| 马山县| 景东| 灯塔市| 海门市| 巫山县| 大竹县| 页游| 鄂尔多斯市|