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

.net编程

开发平台:

C#

  1. <%@ page language="C#" autoeventwireup="true" inherits="Workflow_WorkFlowSelectDoc1, App_Web_4afs73eh" 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.                  strValue = ListBox2Object.options[i].value;
  57.                  //var strValue=ReplaceBacksLash(ListBox2Object.options[i].value);
  58.                  UserRoleText=UserRoleText + strText + ",";
  59.                  RoleIDValue=RoleIDValue + strValue + ",";
  60.              }
  61.            document.getElementById("HSelectedText").innerText=UserRoleText;
  62.            document.getElementById("HSelectedValue").innerText=RoleIDValue;
  63.        
  64.        }
  65.       
  66.     }
  67.     function  AddItemAll(ListBox2Object,ListBox1Object)//添加全部
  68.     {
  69.        document.getElementById("HSelectedValue").innerText="";
  70.        document.getElementById("HSelectedText").innerText="";
  71.       for(i=ListBox2Object.options.length-1;i>=0;i--)
  72.        { 
  73.           ListBox2Object.options.remove(i);
  74.           
  75.        }
  76.        var UserRoleText=document.getElementById("HSelectedText").innerText;
  77.        var RoleIDValue=document.getElementById("HSelectedValue").innerText;
  78.     //   alert(ListBox1Object.options.length);
  79.       for(i=0;i<ListBox1Object.options.length;i++)
  80.         { 
  81.              var strText=ListBox1Object.options[i].text;
  82.              var strValue=ListBox1Object.options[i].value;
  83.              ListBox2Object.options.add(new Option(strText,strValue));
  84.             UserRoleText=UserRoleText + strText + ",";
  85.             RoleIDValue=RoleIDValue + strValue + ",";
  86. //            RoleIDValue=RoleIDValue + ReplaceBacksLash(strValue) + ",";
  87.         }
  88.         document.getElementById("HSelectedText").innerText=UserRoleText;
  89.         document.getElementById("HSelectedValue").innerText=RoleIDValue;
  90. //        alert(RoleIDValue);
  91.     }
  92.     function DelItem(ListBox2Object)  //删除指定项
  93.     {
  94.      var selIndex=ListBox2Object.selectedIndex;
  95.      if(selIndex==-1)
  96.          alert("请选择一项后再删除!");
  97.        else  
  98.          {
  99.            var RoleTexxt= ListBox2Object.options[selIndex].text;
  100.            ListBox2Object.options.remove(selIndex);
  101.            var  str= document.getElementById("HSelectedValue").innerText;
  102.            
  103.             var UserRoleText=document.getElementById("HSelectedText").innerText;
  104.            var RoleIDValue=document.getElementById("HSelectedValue").innerText;
  105.             for(i=0;i<ListBox2Object.options.length;i++)
  106.              { 
  107.                  var strText=ListBox2Object.options[i].text;
  108.                  var strValue=ListBox2Object.options[i].value;
  109.                  //var strValue=ReplaceBacksLash(ListBox2Object.options[i].value);
  110.                  UserRoleText=UserRoleText + strText + ",";
  111.                  RoleIDValue=RoleIDValue + strValue + ",";
  112.              }
  113.            document.getElementById("HSelectedText").innerText=UserRoleText;
  114.            document.getElementById("HSelectedValue").innerText=RoleIDValue;
  115.          }
  116.     }
  117.     function  DelAllItem(ListBox2Object)  //删除全部
  118.     {
  119.      var rows=ListBox2Object.options.length;
  120.      for(i=rows-1;i>=0;i--)
  121.        { 
  122.           ListBox2Object.options.remove(i);
  123.          
  124.        }
  125.          document.getElementById("HSelectedValue").innerText="";
  126.          document.getElementById("HSelectedText").innerText="";
  127.     if(rows==0)
  128.       alert("已全部删除!");
  129.     }
  130.     function modelesswin(url,mwidth,mheight)
  131.      { 
  132.       var a=new  Array(2);
  133.        if (document.all&&window.print) 
  134.         { var re= window.showModalDialog(url,"","help:0;dialogWidth=350px;dialogHeight=400px,status=no;scroll=no;");
  135.          }
  136.          if (re!=undefined) 
  137.          {
  138.           a= re.split(',');
  139.           document.getElementById("TB_employe").innerText=a[1];
  140.           document.getElementById("txt_employeid").innerText=a[0];
  141.         }
  142.    }
  143.    
  144.     </script>
  145. </head>
  146. <body>
  147.     <form id="form1" runat="server">
  148.     <div>
  149.     
  150. <table cellspacing="0" cellpadding="0" width="480" border="0" style="text-align:center;" >
  151.     <tr>
  152.         <td>
  153.             <fieldset>
  154.             <legend style="text-align:left;">
  155. <img alt="本活动选择可编辑的文挡模板" src="image/DateTime.gif" style="text-align:center; border:0;"/>本活动选择可编辑的文挡模板
  156. </legend>
  157.             <table>
  158.                 <tr>
  159.             <td style="height:10; width:10;"></td>
  160.             <td align="left" style="width:400;"></td>
  161.             </tr>
  162.             <tr style="height:18;">
  163.             <td style="height:18;">
  164.             <table>
  165.                 
  166.             </table>
  167.             </td>
  168.             </tr>
  169.             <tr style="height:18;">
  170.             <td style="height:18;">
  171.             <table>
  172.                 <tr>
  173.                 <td>可选择
  174.                 </td>
  175.                 <td>
  176.                 
  177.                 </td>
  178.                 <td>已选择
  179.                 </td>
  180.                 <td>
  181.                 </td>
  182.                 <td>
  183.                 </td>
  184.                 <td>
  185.                 </td>
  186.                 </tr>
  187.                 <tr>
  188.                 <td>
  189.                     <asp:listbox id="lbDoc" runat="server" Height="350px" Width="300px" SelectionMode="Multiple"
  190. CssClass="input"></asp:listbox>
  191.                 </td>
  192. <td align="center">
  193. <input id="HListDoc" type="hidden" name="ListDoc" runat="server"/>
  194.                             <input id="HEditDoc" type ="hidden" name ="HEditDoc" runat="server" />
  195.                             <input id="BT_AddAll" type="button" runat="server" style="width:75px;" value="添加全部>>" onclick="javascript:AddItemAll(body.all.LstDoc,body.all.lbDoc)"/><br/> 
  196.                             <input id="BT_AddOne" type="button" runat="server" style="width:75px;" value="添加>" onclick="javascript:AddItem(body.all.LstDoc,body.all.lbDoc)" /><br/>
  197.                             <input id="BT_DelOne" type="button" runat="server" style="width:75px;" value="<删除" onclick="javascript:DelItem(body.all.LstDoc)" /><br/>
  198.                             <input id="BT_DelAll" type="button" runat="server" style="width:75px;" value="<<删除全部" onclick="javascript:DelAllItem(body.all.LstDoc)" />
  199.                             <input id="HSelectedValue" type="hidden" runat="server" name="HSelectedValue" />
  200.                             <input id="HSelectedText" type="hidden" runat="server" name="HSelectedText" />
  201.                             </td>
  202.                 <td>
  203.                     <asp:listbox id="LstDoc" runat="server" Height="350px" Width="300px" SelectionMode="Multiple"
  204. CssClass="input"></asp:listbox>
  205.                 </td>
  206.                 <%--<td>
  207.                     <asp:ImageButton id="ImgDoc" runat="server" ImageUrl="image/ch.gif" OnClick="ImgDoc_Click"></asp:ImageButton>
  208.                 </td>
  209.                 <td>
  210.                     <asp:ImageButton id="DeleteDoc" runat="server" ImageUrl="image/deleteb.gif" OnClientClick="javascript:return DeleteDoc();"></asp:ImageButton>
  211.                 </td>
  212.                 <td>
  213.                     <asp:ImageButton id="EditDoc" runat="server" ImageUrl="image/handle.gif" OnClientClick="javascript:return OpenWindowDoc();"></asp:ImageButton>
  214.                 </td>--%>
  215.                 </tr>
  216.             </table>
  217.             </td>
  218.             </tr>
  219.             </table> 
  220.           </fieldset>
  221.        </td>
  222.             </tr>
  223.             <tr style="height:20px;"></tr>
  224.             <tr>
  225.        <td>
  226.            <table cellspacing="0" cellpadding="0" width="100%" border="0">
  227.     <tr>
  228.     <td colspan="2" style="height:10"></td>
  229.     </tr>
  230.     <tr>
  231.     <td align="right">
  232.     <asp:ImageButton id="ImgOK" runat="server" ImageUrl="image/confirm.gif" OnClick="ImgOK_Click" ></asp:ImageButton></td>
  233.     <td align="center">
  234.     <asp:ImageButton id="ImgCancel" runat="server" ImageUrl="image/cancel.gif" OnClientClick="javascript:if(confirm('系统提示:您确定退出选择吗?')) window.close();"></asp:ImageButton></td>
  235.     </tr>
  236.     </table>
  237.        </td>
  238.             </tr>
  239.     </table> 
  240.     </div>
  241.     </form>
  242. </body>
  243. </html>