employee_list1.aspx
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:4k
源码类别:

OA系统

开发平台:

ASP/ASPX

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="employee_list1.aspx.cs" Inherits="web_approvel_employee_list" %>
  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.     <link href="../../css/style.css" rel="stylesheet" type="text/css" />
  7. </head>
  8. <body>
  9.     <form id="form1" runat="server">
  10.     <div>
  11.     <center>
  12.         <asp:Label ID="LblTitle" runat="server" Style="position: relative; top: 0px;" Font-Bold="True" Font-Size="Medium"></asp:Label>&nbsp;</center>
  13.         <center>
  14.             <br />
  15.         <asp:GridView ID="EmployeeList" runat="server" AllowPaging="True" AllowSorting="True"
  16.             AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None"
  17.             BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource1" GridLines="Vertical"
  18.             Style="position: relative" Width="600px" OnRowCreated="EmployeeList_RowCreated" OnRowDataBound="EmployeeList_RowDataBound">
  19.             <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
  20.             <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
  21.             <Columns>
  22.                 <asp:BoundField DataField="emp_no" HeaderText="工號" SortExpression="emp_no" />
  23.                 <asp:BoundField DataField="emp_name" HeaderText="姓名" SortExpression="emp_name" />
  24.                 <asp:BoundField DataField="position" HeaderText="職位" SortExpression="position" >                   
  25.                     <ItemStyle Width="80px" />
  26.                 </asp:BoundField>
  27.                 <asp:BoundField DataField="tel_extension" HeaderText="分機" SortExpression="tel_extension" />               
  28.                 <asp:TemplateField HeaderText="狀態">
  29.                     <ItemTemplate>
  30.                         <asp:LinkButton ID="LbWhere" runat="server" Style="position: relative"></asp:LinkButton>
  31.                     </ItemTemplate>
  32.                 </asp:TemplateField>
  33.             </Columns>
  34.             <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" Font-Overline="False" Font-Strikeout="False" Wrap="True" />
  35.             <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
  36.             <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
  37.             <AlternatingRowStyle BackColor="Gainsboro" />
  38.             <PagerSettings FirstPageText="第一頁" LastPageText="最后一頁" Mode="NextPrevious" NextPageText="下一頁"
  39.                 PreviousPageText="上一頁" />
  40.         </asp:GridView>
  41.         <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:oaConnection %>"
  42.             SelectCommand="SELECT d.name,e.id, e.emp_no, e.emp_name, p.name AS position,p.sequence ,&#13;&#10; e.tel, e.smart_phone, e.tel_extension FROM dbo.OA_EMPLOYEE AS e INNER JOIN dbo.OA_EMPLOYEE_POSITION AS &#13;&#10;p ON e.position = p.id  left join oa_department as d on e.department_id=d.id WHERE e.dimission_date=''and (e.department_id = @department_id) and&#13;&#10; p.sequence>=(select sequence from oa_employee_position as a inner join oa_employee as b on a.id=b.position where b.id=@user_id)&#13;&#10;  ORDER BY p.sequence asc">
  43.             <SelectParameters>
  44.                 <asp:QueryStringParameter Name="department_id" QueryStringField="department_id" />
  45.                 <asp:SessionParameter Name="user_id" SessionField="user_id" />
  46.             </SelectParameters>
  47.         </asp:SqlDataSource>
  48.         </center>
  49.     </div>
  50.     </form>
  51. </body>
  52. </html>