WorkFlowSelectDoc.aspx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:10k
源码类别:

.net编程

开发平台:

C#

  1. <%@ page language="C#" autoeventwireup="true" inherits="Workflow_WorkFlowSelectDoc, App_Web_-rs7x2pk" theme="Normal" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4. <head runat="server">
  5.     <title>选择所属文挡</title>
  6.     <base target="_self" />
  7.     <link type="text/css" href="style/formbody.css" rel="stylesheet" />
  8.     <link type="text/css" href="style/gridStyle.css" rel="Stylesheet" />
  9.     <script language="javascript" type="text/javascript">
  10.     
  11.     function ReplaceBacksLash(sDoc)
  12.     {
  13.        var a= sDoc.split('\');
  14.        for (var i=0;i<a.length;i++)
  15.        {
  16.             if (i==0)
  17.             {
  18.                 sDoc = a[i];
  19.             }
  20.             else 
  21.             {
  22.                 sDoc = sDoc + "^" + a[i];
  23.              }
  24.          }
  25. //         alert(sDoc);
  26.          return sDoc;   
  27.     }
  28.     
  29.     function AddItem (ListBox2Object,ListBox1Object) //添加指定项
  30.     {
  31.          var selIndex=ListBox1Object.selectedIndex; //选定行的索引
  32.      if(selIndex==-1)
  33.             alert("请选择一项");
  34.     else
  35.     {
  36.         var strText=ListBox1Object.options[selIndex].text;
  37.         var strValue=ListBox1Object.options[selIndex].value;
  38.         for(i=0;i < ListBox2Object.options.length;i++)
  39.           {
  40.             if(strText==ListBox2Object.options[i].text || strValue==ListBox2Object.options[i].value)
  41.             {
  42.                 alert("不可添加重复的项!");
  43.                 return;
  44.             }
  45.            }  
  46.     
  47.         var oItem=document.createElement("option");
  48.         oItem.text=strText;
  49.         oItem.value=strValue;
  50.         ListBox2Object.add(oItem);
  51.            var UserRoleText=document.getElementById("HSelectedText").innerText;
  52.            var RoleIDValue=document.getElementById("HSelectedValue").innerText;
  53.             for(i=0;i<ListBox2Object.options.length;i++)
  54.              { 
  55.                  var strText=ListBox2Object.options[i].text;
  56.                  var strValue=ReplaceBacksLash(ListBox2Object.options[i].value);
  57.                  UserRoleText=UserRoleText + strText + ",";
  58.                  RoleIDValue=RoleIDValue + strValue + ",";
  59.              }
  60.            document.getElementById("HSelectedText").innerText=UserRoleText;
  61.            document.getElementById("HSelectedValue").innerText=RoleIDValue;
  62.        
  63.        }
  64.       
  65.     }
  66.     function  AddItemAll(ListBox2Object,ListBox1Object)//添加全部
  67.     {
  68.        document.getElementById("HSelectedValue").innerText="";
  69.        document.getElementById("HSelectedText").innerText="";
  70.       for(i=ListBox2Object.options.length-1;i>=0;i--)
  71.        { 
  72.           ListBox2Object.options.remove(i);
  73.           
  74.        }
  75.        var UserRoleText=document.getElementById("HSelectedText").innerText;
  76.        var RoleIDValue=document.getElementById("HSelectedValue").innerText;
  77.     //   alert(ListBox1Object.options.length);
  78.       for(i=0;i<ListBox1Object.options.length;i++)
  79.         { 
  80.              var strText=ListBox1Object.options[i].text;
  81.              var strValue=ListBox1Object.options[i].value;
  82.              ListBox2Object.options.add(new Option(strText,strValue));
  83.             UserRoleText=UserRoleText + strText + ",";
  84.             RoleIDValue=RoleIDValue + ReplaceBacksLash(strValue) + ",";
  85.         }
  86.         document.getElementById("HSelectedText").innerText=UserRoleText;
  87.         document.getElementById("HSelectedValue").innerText=RoleIDValue;
  88. //        alert(RoleIDValue);
  89.     }
  90.     function DelItem(ListBox2Object)  //删除指定项
  91.     {
  92.      var selIndex=ListBox2Object.selectedIndex;
  93.      if(selIndex==-1)
  94.          alert("请选择一项后再删除!");
  95.        else  
  96.          {
  97.            var RoleTexxt= ListBox2Object.options[selIndex].text;
  98.            ListBox2Object.options.remove(selIndex);
  99.            var  str= document.getElementById("HSelectedValue").innerText;
  100.            
  101.             var UserRoleText=document.getElementById("HSelectedText").innerText;
  102.            var RoleIDValue=document.getElementById("HSelectedValue").innerText;
  103.             for(i=0;i<ListBox2Object.options.length;i++)
  104.              { 
  105.                  var strText=ListBox2Object.options[i].text;
  106.                  var strValue=ReplaceBacksLash(ListBox2Object.options[i].value);
  107.                  UserRoleText=UserRoleText + strText + ",";
  108.                  RoleIDValue=RoleIDValue + strValue + ",";
  109.              }
  110.            document.getElementById("HSelectedText").innerText=UserRoleText;
  111.            document.getElementById("HSelectedValue").innerText=RoleIDValue;
  112.          }
  113.     }
  114.     function  DelAllItem(ListBox2Object)  //删除全部
  115.     {
  116.      var rows=ListBox2Object.options.length;
  117.      for(i=rows-1;i>=0;i--)
  118.        { 
  119.           ListBox2Object.options.remove(i);
  120.          
  121.        }
  122.          document.getElementById("HSelectedValue").innerText="";
  123.          document.getElementById("HSelectedText").innerText="";
  124.     if(rows==0)
  125.       alert("已全部删除!");
  126.     }
  127.     function modelesswin(url,mwidth,mheight)
  128.      { 
  129.       var a=new  Array(2);
  130.        if (document.all&&window.print) 
  131.         { var re= window.showModalDialog(url,"","help:0;dialogWidth=350px;dialogHeight=400px,status=no;scroll=no;");
  132.          }
  133.          if (re!=undefined) 
  134.          {
  135.           a= re.split(',');
  136.           document.getElementById("TB_employe").innerText=a[1];
  137.           document.getElementById("txt_employeid").innerText=a[0];
  138.         }
  139.    }
  140.    
  141.     </script>
  142. </head>
  143. <body>
  144.     <form id="form1" runat="server">
  145.     <div>
  146.     
  147. <table cellspacing="0" cellpadding="0" width="480" border="0" style="text-align:center;" >
  148.     <tr>
  149.         <td>
  150.             <fieldset>
  151.             <legend style="text-align:left;">
  152. <img alt="本活动选择可编辑的文挡模板" src="image/DateTime.gif" style="text-align:center; border:0;"/>本活动选择可编辑的文挡模板
  153. </legend>
  154.             <table>
  155.                 <tr>
  156.             <td style="height:10; width:10;"></td>
  157.             <td align="left" style="width:400;"></td>
  158.             </tr>
  159.             <tr style="height:18;">
  160.             <td style="height:18;">
  161.             <table>
  162.                 
  163.             </table>
  164.             </td>
  165.             </tr>
  166.             <tr style="height:18;">
  167.             <td style="height:18;">
  168.             <table>
  169.                 <tr>
  170.                 <td>可选择
  171.                 </td>
  172.                 <td>
  173.                 
  174.                 </td>
  175.                 <td>已选择
  176.                 </td>
  177.                 <td>
  178.                 </td>
  179.                 <td>
  180.                 </td>
  181.                 <td>
  182.                 </td>
  183.                 </tr>
  184.                 <tr>
  185.                 <td>
  186.                     <asp:listbox id="lbDoc" runat="server" Height="350px" Width="300px" SelectionMode="Multiple"
  187. CssClass="input"></asp:listbox>
  188.                 </td>
  189. <td align="center">
  190. <input id="HListDoc" type="hidden" name="ListDoc" runat="server"/>
  191.                             <input id="HEditDoc" type ="hidden" name ="HEditDoc" runat="server" />
  192.                             <input id="BT_AddAll" type="button" runat="server" style="width:75px;" value="添加全部>>" onclick="javascript:AddItemAll(body.all.LstDoc,body.all.lbDoc)"/><br/> 
  193.                             <input id="BT_AddOne" type="button" runat="server" style="width:75px;" value="添加>" onclick="javascript:AddItem(body.all.LstDoc,body.all.lbDoc)" /><br/>
  194.                             <input id="BT_DelOne" type="button" runat="server" style="width:75px;" value="<删除" onclick="javascript:DelItem(body.all.LstDoc)" /><br/>
  195.                             <input id="BT_DelAll" type="button" runat="server" style="width:75px;" value="<<删除全部" onclick="javascript:DelAllItem(body.all.LstDoc)" />
  196.                             <input id="HSelectedValue" type="hidden" runat="server" name="HSelectedValue" />
  197.                             <input id="HSelectedText" type="hidden" runat="server" name="HSelectedText" />
  198.                             </td>
  199.                 <td>
  200.                     <asp:listbox id="LstDoc" runat="server" Height="350px" Width="300px" SelectionMode="Multiple"
  201. CssClass="input"></asp:listbox>
  202.                 </td>
  203.                 <%--<td>
  204.                     <asp:ImageButton id="ImgDoc" runat="server" ImageUrl="image/ch.gif" OnClick="ImgDoc_Click"></asp:ImageButton>
  205.                 </td>
  206.                 <td>
  207.                     <asp:ImageButton id="DeleteDoc" runat="server" ImageUrl="image/deleteb.gif" OnClientClick="javascript:return DeleteDoc();"></asp:ImageButton>
  208.                 </td>
  209.                 <td>
  210.                     <asp:ImageButton id="EditDoc" runat="server" ImageUrl="image/handle.gif" OnClientClick="javascript:return OpenWindowDoc();"></asp:ImageButton>
  211.                 </td>--%>
  212.                 </tr>
  213.             </table>
  214.             </td>
  215.             </tr>
  216.             </table> 
  217.           </fieldset>
  218.        </td>
  219.             </tr>
  220.             <tr style="height:20px;"></tr>
  221.             <tr>
  222.        <td>
  223.            <table cellspacing="0" cellpadding="0" width="100%" border="0">
  224.     <tr>
  225.     <td colspan="2" style="height:10"></td>
  226.     </tr>
  227.     <tr>
  228.     <td align="right">
  229.     <asp:ImageButton id="ImgOK" runat="server" ImageUrl="image/confirm.gif" OnClick="ImgOK_Click" ></asp:ImageButton></td>
  230.     <td align="center">
  231.     <asp:ImageButton id="ImgCancel" runat="server" ImageUrl="image/cancel.gif" OnClientClick="javascript:if(confirm('系统提示:您确定退出选择吗?')) window.close();"></asp:ImageButton></td>
  232.     </tr>
  233.     </table>
  234.        </td>
  235.             </tr>
  236.     </table> 
  237.     </div>
  238.     </form>
  239. </body>
  240. </html>