WorkFlowSelectTable.aspx
上传用户:tiancihang
上传日期:2014-03-12
资源大小:21387k
文件大小:8k
- <%@ page language="C#" autoeventwireup="true" inherits="Workflow_WorkFlowSelectTable, App_Web_4afs73eh" theme="Normal" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <link href="style/formbody.css" rel="stylesheet" type="text/css" />
- <base target="_self" />
- <title>关联表单选择</title>
- <script language="javascript" type="text/javascript">
- <!--
- function AddItem (ListBox2Object,ListBox1Object) //添加指定项
- {
- var selIndex=ListBox1Object.selectedIndex; //选定行的索引
- if(selIndex==-1)
- alert("请选择一项");
- else
- {
- var strText=ListBox1Object.options[selIndex].text;
- var strValue=ListBox1Object.options[selIndex].value;
- for(i=0;i < ListBox2Object.options.length;i++)
- {
- if(strText==ListBox2Object.options[i].text || strValue==ListBox2Object.options[i].value)
- {
- alert("不可添加重复的项!");
- return;
- }
- }
-
- var oItem=document.createElement("option");
- oItem.text=strText;
- oItem.value=strValue;
- ListBox2Object.add(oItem);
- var UserRoleText=document.getElementById("TB_UserRole").innerText;
- var RoleIDValue=document.getElementById("txt_RoleID").innerText;
- for(i=0;i<ListBox2Object.options.length;i++)
- {
- var strText=ListBox2Object.options[i].text;
- var strValue=ListBox2Object.options[i].value;
- UserRoleText=UserRoleText + strText + ",";
- RoleIDValue=RoleIDValue + strValue + ",";
- }
- document.getElementById("TB_UserRole").innerText=UserRoleText;
- document.getElementById("txt_RoleID").innerText=RoleIDValue;
-
- }
-
- }
- function AddItemAll(ListBox2Object,ListBox1Object)//添加全部
- {
- document.getElementById("txt_RoleID").innerText="";
- document.getElementById("TB_UserRole").innerText="";
- for(i=ListBox2Object.options.length-1;i>=0;i--)
- {
- ListBox2Object.options.remove(i);
-
- }
- var UserRoleText=document.getElementById("TB_UserRole").innerText;
- var RoleIDValue=document.getElementById("txt_RoleID").innerText;
- // alert(ListBox1Object.options.length);
- for(i=0;i<ListBox1Object.options.length;i++)
- {
- var strText=ListBox1Object.options[i].text;
- var strValue=ListBox1Object.options[i].value;
- ListBox2Object.options.add(new Option(strText,strValue));
- UserRoleText=UserRoleText + strText + ",";
- RoleIDValue=RoleIDValue + strValue + ",";
- }
- document.getElementById("TB_UserRole").innerText=UserRoleText;
- document.getElementById("txt_RoleID").innerText=RoleIDValue;
-
- }
- function DelItem(ListBox2Object) //删除指定项
- {
- var selIndex=ListBox2Object.selectedIndex;
- if(selIndex==-1)
- alert("请选择一项后再删除!");
- else
- {
- var RoleTexxt= ListBox2Object.options[selIndex].text;
- ListBox2Object.options.remove(selIndex);
- var str= document.getElementById("txt_RoleID").innerText;
-
- var UserRoleText=document.getElementById("TB_UserRole").innerText;
- var RoleIDValue=document.getElementById("txt_RoleID").innerText;
- for(i=0;i<ListBox2Object.options.length;i++)
- {
- var strText=ListBox2Object.options[i].text;
- var strValue=ListBox2Object.options[i].value;
- UserRoleText=UserRoleText + strText + ",";
- RoleIDValue=RoleIDValue + strValue + ",";
- }
- document.getElementById("TB_UserRole").innerText=UserRoleText;
- document.getElementById("txt_RoleID").innerText=RoleIDValue;
- }
- }
- function DelAllItem(ListBox2Object) //删除全部
- {
- var rows=ListBox2Object.options.length;
- for(i=rows-1;i>=0;i--)
- {
- ListBox2Object.options.remove(i);
-
- }
- document.getElementById("txt_RoleID").innerText="";
- document.getElementById("TB_UserRole").innerText="";
- if(rows==0)
- alert("已全部删除!");
- }
- function modelesswin(url,mwidth,mheight)
- {
- var a=new Array(2);
- if (document.all&&window.print)
- { var re= window.showModalDialog(url,"","help:0;dialogWidth=350px;dialogHeight=400px,status=no;scroll=no;");
- }
- if (re!=undefined)
- {
- a= re.split(',');
- document.getElementById("TB_employe").innerText=a[1];
- document.getElementById("txt_employeid").innerText=a[0];
- }
- }
-
- // -->
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <table cellspacing="0" cellpadding="0" width="400" border="0">
- <tr>
- <td style="width:5; height:5;"></td>
- <td></td>
- <td style="width:5"></td>
- </tr>
- <tr>
- <td></td>
- <td>
- <fieldset><legend>请选择</legend>
- <table cellspacing="0" cellpadding="0" width="400" border="0">
- <tr>
- <td style="width:10;height:10" ></td>
- <td style="width:150"></td>
- <td style="width:10"></td>
- <td style="width:60"></td>
- <td style="width:10"></td>
- <td style="width:150"></td>
- <td style="width:10"></td>
- </tr>
- <tr>
- <td style="height:200"></td>
- <td><asp:listbox id="lbTable" runat="server" Height="200px" Width="160px" SelectionMode="Multiple"
- CssClass="input"></asp:listbox></td>
- <td></td>
- <td>
- <table cellspacing="0" cellpadding="0" width="100%" border="0">
- <tr align="center">
- <td align="center">
- <input type="hidden" id="TB_UserRole" name="TB_UserRole" runat="server"/>
- <input type="hidden" id="txt_RoleID" name="txt_RoleID" runat="server"/>
- <input id="BT_AddAll" type="button" runat="server" style="width:75px;" value="添加全部>>" onclick="javascript:AddItemAll(body.all.lbTableSelected,body.all.lbTable)"/><br/>
- <input id="BT_AddOne" type="button" runat="server" style="width:75px;" value="添加>" onclick="javascript:AddItem(body.all.lbTableSelected,body.all.lbTable)" /><br/>
- <input id="BT_DelOne" type="button" runat="server" style="width:75px;" value="<删除" onclick="javascript:DelItem(body.all.lbTableSelected)" /><br/>
- <input id="BT_DelAll" type="button" runat="server" style="width:75px;" value="<<删除全部" onclick="javascript:DelAllItem(body.all.lbTableSelected)" />
- </td>
- </tr>
- </table>
- </td>
- <td></td>
- <td><asp:listbox id="lbTableSelected" runat="server" Height="200px" Width="160px" SelectionMode="Multiple"
- CssClass="input"></asp:listbox></td>
- <td></td>
- </tr>
- <tr>
- <td style="height:10"></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- </table>
- </fieldset>
- <table cellspacing="0" cellpadding="0" width="400" border="0">
- <tr>
- <td colspan="2" style="height:10"></td>
- </tr>
- <tr>
- <td align="center">
- <asp:ImageButton id="ImageButton1" runat="server" ImageUrl="image/confirm.gif" OnClick="ImageButton1_Click"></asp:ImageButton></td>
- <td align="center">
- <asp:ImageButton id="ImageButton2" runat="server" ImageUrl="image/cancel.gif" OnClientClick="javascript:if(confirm('系统提示:您确定退出选择吗?')) window.close();"></asp:ImageButton></td>
- </tr>
- </table>
- </td>
- <td></td>
- </tr>
- <tr>
- <td style="height:5;"></td>
- <td></td>
- <td></td>
- </tr>
- </table>
- </div>
- </form>
- </body>
- </html>