usersList.aspx 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="usersList.aspx.cs" Inherits="OA2014.users.usersList" %>
  2. <%@ Register Src="../publicControls/pageControl.ascx" TagName="pageControl" TagPrefix="uc1" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6. <title>员工资料</title>
  7. <link href="../css/all.css" rel="stylesheet" type="text/css" />
  8. <link href="../css/pagination.css" rel="stylesheet" type="text/css" />
  9. <!-- toastr提示框style -->
  10. <link href="../css/toastr.css" rel="stylesheet" />
  11. <!-- autocomplete 内容自动识别style -->
  12. <link href="../js/Customer/jQueryAutocompletePlugin-master/jquery.autocomplete.css" rel="stylesheet" />
  13. </head>
  14. <body>
  15. <form id="form1" runat="server">
  16. <div>
  17. <div class="ps">
  18. <table class="ps" cellpadding="0" cellspacing="0">
  19. <tr>
  20. <td class="ps_font" style="width:480px;">
  21. <asp:DropDownList ID="ddlDepartment" AutoPostBack="true" runat="server" Width="100"
  22. OnTextChanged="ddlDepartment_TextChanged" /> &nbsp;&nbsp;
  23. 员工姓名:
  24. <asp:TextBox ID="txtName" runat="server" Width="120" Style="border: 1px solid #b3b3b3;" change="change()" /> &nbsp;&nbsp;
  25. <asp:Button ID="btnSelect" runat="server" Text="查询" CssClass="btn" ForeColor="White" Style="width: 45px;"
  26. OnClick="btnSelect_Click" />
  27. </td>
  28. <td class="ps_select">
  29. </td>
  30. <td class="ps_add">
  31. <asp:Button ID="btnAdd" runat="server" Text="新增数据" CssClass="btn" Style=" width: 65px; "
  32. OnClick="btnAdd_Click" />
  33. <asp:Button ID="btnUpdate" runat="server" Text="刷新数据" CssClass="btn" Style="width: 65px;"
  34. OnClientClick="location.reload();" />
  35. </td>
  36. </tr>
  37. </table>
  38. </div>
  39. <div class="list">
  40. <table class="list" cellpadding="0" cellspacing="0" border="0">
  41. <tr class="tr_title">
  42. <td class="td">序 号
  43. </td>
  44. <td class="td">员工号
  45. </td>
  46. <td class="td">姓 名
  47. </td>
  48. <td class="td">分属公司
  49. </td>
  50. <td class="td">职 位
  51. </td>
  52. <td class="td">分机号
  53. </td>
  54. <td class="td">手机号
  55. </td>
  56. <td class="td">紧急联络电话
  57. </td>
  58. <td class="td">电子邮箱
  59. </td>
  60. <td class="td_oper">操 作
  61. </td>
  62. </tr>
  63. <asp:Repeater ID="rpData" runat="server" OnItemDataBound="rpData_ItemDataBound">
  64. <ItemTemplate>
  65. <tr class="tr_content">
  66. <td class="td">
  67. <%# Container.ItemIndex + 1%>
  68. </td>
  69. <td class="td">
  70. <%#Eval("Number")%>
  71. </td>
  72. <td class="td">
  73. <%#Eval("CnName")%>
  74. </td>
  75. <td class="td">
  76. <asp:HiddenField ID="HCompany" Value=<%#Eval("Company") %> runat="server" />
  77. <asp:Label ID="lblCompany" runat="server" />
  78. </td>
  79. <td class="td">
  80. <%#Eval("Post")%>
  81. </td>
  82. <td class="td">
  83. <%#Eval("Ext")%>
  84. </td>
  85. <td class="td">
  86. <%#Eval("Phone")%>
  87. </td>
  88. <td class="td">
  89. <%#Eval("UrgentPhone")%>
  90. </td>
  91. <td class="td">
  92. <%#Eval("Email")%>
  93. </td>
  94. <td class="td_oper">
  95. <asp:LinkButton ID="lbtnEdit" runat="server" Text="编 辑" OnClick="lbtnEdit_Click" CommandArgument='<%#Eval("Id")%>' />
  96. |
  97. <asp:LinkButton ID="lbtnDel" runat="server" Text="删 除" OnClick="lbtnDel_Click" OnClientClick='return confirm("温馨提示:确定删除该条数据吗?");' CommandArgument='<%#Eval("Id")%>' />
  98. </td>
  99. </tr>
  100. </ItemTemplate>
  101. </asp:Repeater>
  102. </table>
  103. </div>
  104. <uc1:pageControl ID="pageControl" runat="server" />
  105. </div>
  106. <!-- Jquery -->
  107. <script type="text/javascript" src="../js/Customer/jquery-1.9.1.min.js"></script>
  108. <!-- autocomplete 内容自动识别 -->
  109. <script type="text/javascript" src="../js/Customer/jQueryAutocompletePlugin-master/jquery.autocomplete.min.js"></script>
  110. <script type="text/javascript">
  111. $().ready(function () {
  112. var dates = [];
  113. $.ajax({
  114. type: "POST",
  115. url: "/users/usersList.aspx/GetUsers",
  116. data: {},
  117. dataType: "json",
  118. contentType: "application/json",
  119. success: function (data) {
  120. var ec = JSON.parse(data.d);
  121. if (ec.errorCode != "0") {
  122. var date1 = JSON.parse(ec.msg);
  123. for (var i = 0; i < date1.length; i++) {
  124. dates.push(date1[i]);
  125. }
  126. } else {
  127. taostr.error(err);
  128. }
  129. },
  130. Error: function (ex) {
  131. taostr.error(ex);
  132. }
  133. });
  134. $("#txtName").autocomplete(dates, {
  135. minChars: 1, // 自动完成激活之前填入的最少字符
  136. max: 15, //列表里的条目数
  137. scrollHeight: 220, //提示的高度,溢出显示滚动条
  138. scrollWidth: 500, //提示的宽度,溢出隐藏
  139. //mustMatch: true, //自动填充
  140. matchContains: true, //包含匹配,是否只显示匹配项
  141. autoFill: false, //自动填充
  142. //scroll: true, //是否显示滚动条
  143. // 此处实际请求的URL为"AutoComplete.ashx?q='[你在txtAutoComplete中输入的值]'&action='autoComplete'&value='guo'"
  144. //extraParams: { action: "/finance/proceedsreceived.aspx/getteamname", value: $("#txtTzNames").val() },
  145. //格式化列表中的条目 row:条目对象,i:当前条目index,max:总条目数
  146. formatItem: function (data, i, total) {
  147. return data[0];
  148. },
  149. //配合formatItem使用,作用在于,由于使用了formatItem,所以显示的条目内容有所改变,
  150. //而我们要匹配的是原始的数据,所以用formatMatch做一个调整,使之匹配原始数据
  151. formatMatch: function (data, i, total) {
  152. return data[0];
  153. },
  154. //设置用户选择某一条目后文本框显示的内容
  155. formatResult: function (data) {
  156. return data[0];
  157. }
  158. });
  159. });
  160. </script>
  161. <!-- Toastr -->
  162. <script type="text/javascript" src="../js/toastr.js"></script>
  163. <!-- toastr消息参数处理 -->
  164. <script type="text/javascript" src="../js/PottingToastr.js"></script>
  165. </form>
  166. </body>
  167. </html>