<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserQuery.aspx.cs" Inherits="Dotnet.Admin.UserQuery" %>

<!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">
    <title>员工查询结果</title>
    <script src="../JavaScript/jquery-1.12.4.min.js"></script>
</head>
<body style=" font-size:12px; font-family:Verdana">
    <form id="form1" runat="server">
    
      <table width="100%">
      <tr valign="top">
      <td width="150px">
      <asp:ListBox runat="server" SelectionMode="Single"
       
      
       ID="lb_lists" Width="145px" Height="320px" AutoPostBack="True" 
              >
      
      
      </asp:ListBox>
      人数:<asp:Literal ID="lt_number" runat="server"></asp:Literal>人
      </td>
      
      <td>
       
    <asp:GridView ID="GridView1" runat="server"
         AllowPaging="True" Width="100%"  PageSize="10"  DataKeyNames="id" AutoGenerateColumns="false"
           DataSourceID="SqlDataSource1">
        <Columns> 
            <asp:BoundField HeaderText="登录名"  DataField="username" HeaderStyle-Width="90px"/>
               <asp:BoundField HeaderText="显示名"  DataField="displayname" HeaderStyle-Width="90px"/>
               <asp:BoundField HeaderText="部门"  DataField="department" HeaderStyle-Width="90px"/>
               <asp:BoundField HeaderText="电话"  DataField="tel" HeaderStyle-Width="90px"/>

            <asp:TemplateField  >
                <HeaderStyle Width="90px" />
                <ItemTemplate>
                    <a href="###" onclick='UserRemoveRole(<%#Eval("id") %>, this)'>移除角色</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>

       <HeaderStyle BackColor="#000000" Height="35" ForeColor="#ffffff" Font-Bold="True" HorizontalAlign="Center" />
       <AlternatingRowStyle BackColor="#F2F2F2" />
      <RowStyle BackColor="#ffffff"  Height="28"/>
      <PagerSettings Mode="NumericFirstLast" />  

    </asp:GridView>


      </td>
      </tr>
      </table>
   




    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:connectionstring %>" 
      
        SelectCommand="SELECT  id, users_users.uid, Username  , DisplayName  ,Department  ,Tel    FROM  users_users  
inner join users_usersinroles on users_users.uid=users_usersinroles.uid
 
 where rolename=@rolename "
       >
        
        <SelectParameters>

            <asp:ControlParameter ControlID="lb_lists" Name="rolename" />
        </SelectParameters>
    </asp:SqlDataSource>




        <script>
            
            function UserRemoveRole(id,obj)
            {
               $.get("UserRemoveRole.aspx?id=" + id+"&R="+Math.random());

                $(obj).parent().parent().remove();
            }

        </script>


    </form>
</body>
</html>
