SelectReceiver.aspx
上传用户:xuming1973
上传日期:2014-02-27
资源大小:17511k
文件大小:10k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

C#

  1. <%@ Page language="c#" Codebehind="SelectReceiver.aspx.cs" AutoEventWireup="false" Inherits="MaiSystem.SelectReceiver" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
  3. <HTML>
  4. <HEAD>
  5. <title>选择收件人 </title>
  6. <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
  7. <meta content="C#" name="CODE_LANGUAGE">
  8. <meta content="JavaScript" name="vs_defaultClientScript">
  9. <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
  10. <LINK href="../../../css/BasicLayout.css" type="text/css" rel="stylesheet">
  11. <base target="_self">
  12. <script language="javascript">
  13. function RemoveItem(ControlName)
  14.     { 
  15. Control = null;
  16. switch (ControlName){
  17.  case "btnReceSendToLeft" : 
  18.    Control=eval("document.SelectReceiver.listSendTo");  
  19.    break;
  20.  case "btnCcSendToLeft" : 
  21.    Control=eval("document.SelectReceiver.listCcTo");  
  22.    break;
  23.  case "btnBccSendToLeft" : 
  24.    Control=eval("document.SelectReceiver.listBccTo");  
  25.    break;
  26.   } 
  27. var j=Control.length;
  28. if(j==0) return;
  29. for(j;j>0;j--)
  30. {
  31. if(Control.options[j-1].selected==true)
  32.   Control.remove(j-1);
  33. }
  34. }
  35.    
  36. }
  37. function AddItem(ControlName)
  38. {
  39. Control = null;
  40. switch (ControlName){
  41.  case "btnReceSendToRight" : 
  42.    Control=eval("document.SelectReceiver.listSendTo");  
  43.    break;
  44.  case "btnCcSendToRight" : 
  45.    Control=eval("document.SelectReceiver.listCcTo");  
  46.    break;
  47.  case "btnBccSendToRight" : 
  48.    Control=eval("document.SelectReceiver.listBccTo");  
  49.    break;
  50. var i=0;
  51. listAccount=eval("document.SelectReceiver.listAccount");
  52. var j=listAccount.length;
  53. for(i=0;i<j;i++)
  54. {
  55. if(listAccount.options[i].selected==true)
  56.      
  57. Control.add(new Option(listAccount[i].text,listAccount.options[i].value));          
  58. }
  59. }
  60. }
  61. function setStatusright()
  62. {
  63. document.SelectReceiver.btnReceSendToRight.disabled = false;
  64. document.SelectReceiver.btnCcSendToRight.disabled=false;
  65. document.SelectReceiver.btnBccSendToRight.disabled=false;
  66. }
  67. function setStatusleft()
  68. {
  69. document.SelectReceiver.btnReceSendToLeft .disabled =false;
  70. document.SelectReceiver.btnCcSendToLeft.disabled=false;
  71. document.SelectReceiver.btnBccSendToLeft.disabled=false;
  72. }
  73. function PopulateData()
  74. {
  75.    if (window.dialogArguments != null) 
  76. {
  77. var parwin = window.dialogArguments;
  78. if(parwin.document.all.hdnTxtSendTo.value!="")
  79. {
  80.     Control=eval("document.SelectReceiver.listSendTo");  
  81. var SendToValueArray = parwin.document.all.hdnTxtSendTo.value.split(",");
  82. var SendToTxtArray = parwin.document.all.txtSendTo.value.split(",");
  83. for(i=0;i<SendToValueArray.length-1;i++)
  84. {
  85. Control.add(new Option(SendToTxtArray[i],SendToValueArray[i]));
  86. }
  87. }
  88. if(parwin.document.all.hdnTxtCcTo.value!="")
  89. {
  90.     Control=eval("document.SelectReceiver.listCcTo");  
  91. var CcToValueArray = parwin.document.all.hdnTxtCcTo.value.split(",");
  92. var CcToTxtArray = parwin.document.all.txtCcTo.value.split(",");
  93. for(i=0;i<CcToValueArray.length-1;i++)
  94. {
  95. Control.add(new Option(CcToTxtArray[i],CcToValueArray[i]));
  96. }
  97. }
  98. if(parwin.document.all.hdnTxtSendTo.value!="")
  99. {
  100.     Control=eval("document.SelectReceiver.listBccTo");  
  101. var BccToValueArray = parwin.document.all.hdnTxtBccTo.value.split(",");
  102. var BccToTxtArray = parwin.document.all.txtBccTo.value.split(",");
  103. for(i=0;i<BccToValueArray.length-1;i++)
  104. {
  105. Control.add(new Option(BccToTxtArray[i],BccToValueArray[i]));
  106. }
  107. }
  108. }
  109. }
  110. function ReturnValue()
  111. {
  112. if (window.dialogArguments != null) 
  113. {
  114. var parwin = window.dialogArguments;
  115. }
  116.  var listSendToTxtStr = "";
  117.  var listSendToValueStr = "";
  118.  var listCcToTxtStr = "";
  119.  var listCcToValueStr = "";
  120.  var listBccToTxtStr = "";
  121.  var listBccToValueStr = "";
  122.  var listSendToCompleteStr = "";
  123.  
  124.  listSendTo = eval("document.SelectReceiver.listSendTo"); 
  125.  listCcTo = eval("document.SelectReceiver.listCcTo"); 
  126.  listBccTo = eval("document.SelectReceiver.listBccTo"); 
  127.  
  128.  
  129.  for(i=0;i<listSendTo.length;i++)
  130.  {
  131.   listSendToTxtStr+=listSendTo.options[i].text+",";
  132.   listSendToValueStr+=listSendTo.options[i].value+","; 
  133.  }
  134.      parwin.document.all.Compose.txtSendTo.value = listSendToTxtStr;
  135.      parwin.document.all.Compose.hdnTxtSendTo.value = listSendToValueStr;
  136.      
  137.  for(i=0;i<listCcTo.length;i++)
  138.  {
  139.   listCcToTxtStr+=listCcTo.options[i].text+",";
  140.   listCcToValueStr+=listCcTo.options[i].value+","; 
  141.  }
  142.  parwin.document.all.Compose.txtCcTo.value = listCcToTxtStr;
  143.      parwin.document.all.Compose.hdnTxtCcTo.value = listCcToValueStr;
  144.      
  145.  for(i=0;i<listBccTo.length;i++)
  146.  {
  147.   listBccToTxtStr+=listBccTo.options[i].text+",";
  148.   listBccToValueStr+=listBccTo.options[i].value+","; 
  149.  }
  150.  parwin.document.all.Compose.txtBccTo.value = listBccToTxtStr;
  151.      parwin.document.all.Compose.hdnTxtBccTo.value = listBccToValueStr;
  152.      
  153. window.close();
  154. }
  155. function SaveValue()
  156. {
  157. if (window.dialogArguments != null) 
  158. {
  159. var parwin = window.dialogArguments;
  160. }
  161.  var listSendToTxtStr = "";
  162.  var listSendToValueStr = "";
  163.  var listCcToTxtStr = "";
  164.  var listCcToValueStr = "";
  165.  var listBccToTxtStr = "";
  166.  var listBccToValueStr = "";
  167.  var listSendToCompleteStr = "";
  168.  
  169.  listSendTo = eval("document.SelectReceiver.listSendTo"); 
  170.  listCcTo = eval("document.SelectReceiver.listCcTo"); 
  171.  listBccTo = eval("document.SelectReceiver.listBccTo"); 
  172.  
  173.  
  174.  for(i=0;i<listSendTo.length;i++)
  175.  {
  176.   listSendToTxtStr+=listSendTo.options[i].text+",";
  177.   listSendToValueStr+=listSendTo.options[i].value+","; 
  178.  }
  179.      parwin.document.all.Compose.txtSendTo.value = listSendToTxtStr;
  180.      parwin.document.all.Compose.hdnTxtSendTo.value = listSendToValueStr;
  181.      
  182.  for(i=0;i<listCcTo.length;i++)
  183.  {
  184.   listCcToTxtStr+=listCcTo.options[i].text+",";
  185.   listCcToValueStr+=listCcTo.options[i].value+","; 
  186.  }
  187.  parwin.document.all.Compose.txtCcTo.value = listCcToTxtStr;
  188.      parwin.document.all.Compose.hdnTxtCcTo.value = listCcToValueStr;
  189.      
  190.  for(i=0;i<listBccTo.length;i++)
  191.  {
  192.   listBccToTxtStr+=listBccTo.options[i].text+",";
  193.   listBccToValueStr+=listBccTo.options[i].value+","; 
  194.  }
  195.  parwin.document.all.Compose.txtBccTo.value = listBccToTxtStr;
  196.      parwin.document.all.Compose.hdnTxtBccTo.value = listBccToValueStr;
  197.      
  198. }
  199. </script>
  200. </HEAD>
  201. <body onload="PopulateData()" MS_POSITIONING="GridLayout" background="../../../Images/mailuserbg.gif">
  202. <form id="SelectReceiver" method="post" runat="server">
  203. <SELECT id="listBccTo" style="Z-INDEX: 110; LEFT: 376px; WIDTH: 181px; POSITION: absolute; TOP: 293px; HEIGHT: 105px" multiple size="6" name="listBccTo">
  204. </SELECT><INPUT class="buttoncss" style="Z-INDEX: 109; LEFT: 258px; WIDTH: 81px; POSITION: absolute; TOP: 300px; HEIGHT: 24px" onclick="AddItem(this.name)" type="button" value=">>>>" name="btnBccSendToRight"><INPUT class="buttoncss" style="Z-INDEX: 108; LEFT: 257px; WIDTH: 81px; POSITION: absolute; TOP: 324px; HEIGHT: 24px" onclick="RemoveItem(this.name)" type="button" value="<<<<" name="btnBccSendToLeft"><SELECT id="listCcTo" style="Z-INDEX: 107; LEFT: 375px; WIDTH: 181px; POSITION: absolute; TOP: 168px; HEIGHT: 92px" multiple size="5" name="listCcTo"></SELECT><INPUT class="buttoncss" style="Z-INDEX: 106; LEFT: 256px; WIDTH: 81px; POSITION: absolute; TOP: 185px; HEIGHT: 24px" onclick="AddItem(this.name)" type="button" value=">>>>" name="btnCcSendToRight"><INPUT class="buttoncss" style="Z-INDEX: 105; LEFT: 256px; WIDTH: 81px; POSITION: absolute; TOP: 209px; HEIGHT: 24px" onclick="RemoveItem(this.name)" type="button" value="<<<<" name="btnCcSendToLeft"><SELECT id="listSendTo" style="Z-INDEX: 104; LEFT: 374px; WIDTH: 182px; POSITION: absolute; TOP: 43px; HEIGHT: 90px;" multiple size="5" name="listSendTo"></SELECT><INPUT class="buttoncss" style="Z-INDEX: 103; LEFT: 256px; WIDTH: 81px; POSITION: absolute; TOP: 59px; HEIGHT: 24px" onclick="AddItem(this.name)" type="button" value=">>>>" name="btnReceSendToRight"><INPUT class="buttoncss" style="Z-INDEX: 102; LEFT: 256px; WIDTH: 81px; POSITION: absolute; TOP: 83px; HEIGHT: 24px" onclick="RemoveItem(this.name)" type="button" value="<<<<" name="btnReceSendToLeft"><asp:dropdownlist id="listAccount" ondblclick="AddItem('btnReceSendToRight')" style="Z-INDEX: 101; LEFT: 73px; POSITION: absolute; TOP: 43px" runat="server" Width="148px" Height="356px" multiple onchange="setStatusright()"></asp:dropdownlist>
  205. <asp:label id="lblReceiver" style="Z-INDEX: 111; LEFT: 375px; POSITION: absolute; TOP: 18px" runat="server" Font-Size="X-Small">收件人</asp:label><asp:label id="lblCc" style="Z-INDEX: 112; LEFT: 376px; POSITION: absolute; TOP: 143px" runat="server" Font-Size="X-Small">抄送人</asp:label><asp:label id="lblBcc" style="Z-INDEX: 113; LEFT: 380px; POSITION: absolute; TOP: 272px" runat="server" Font-Size="X-Small">秘抄人</asp:label><asp:dropdownlist id="listAddressBook" style="Z-INDEX: 114; LEFT: 93px; POSITION: absolute; TOP: 430px" runat="server" Visible="False"></asp:dropdownlist><asp:label id="lblAddressBook" style="Z-INDEX: 115; LEFT: 41px; POSITION: absolute; TOP: 434px" runat="server" Font-Size="X-Small" Visible="False">地址薄</asp:label><input class="buttoncss" style="Z-INDEX: 116; LEFT: 221px; WIDTH: 61px; POSITION: absolute; TOP: 421px; HEIGHT: 24px" onclick="ReturnValue()" type="button" value="确定">
  206. <input class="buttoncss" style="Z-INDEX: 117; LEFT: 356px; WIDTH: 61px; POSITION: absolute; TOP: 421px; HEIGHT: 24px" onclick="window.close()" type="button" value="取消">
  207. <asp:DropDownList id="listDept" style="Z-INDEX: 118; LEFT: 76px; POSITION: absolute; TOP: 16px" runat="server" OnSelectedIndexChanged="DeptListChange" AutoPostBack="True"></asp:DropDownList></form>
  208. </body>
  209. </HTML>