<%@ Page Title="用户列表" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Users_Lists.aspx.cs" Inherits="Vote.Admin.Users_Lists" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">



 

<div class="result-wrap">
      
  




        <div class="result-title">
          <a  class="btn btn-primary"   href="Users_EditUser.aspx">添加新用户</a> 
         

            <a href="javascript:void(0);" class="btn btn-default"  
    onclick="Pop('Imports_AD_Users.aspx',500,380,'从AD域服务器里导入用户');return false;"
       
       >
      AD导入用户</a> 
 

<a href="javascript:void(0);" class="btn btn-default"  
    onclick="Pop('Imports_AD_Users2.aspx',600,380,'从AD域服务器里导入用户');return false;"
       
       >
     AD部分导</a>



            
       <a href="#" onclick="if(isselect()) openRole(); return false; " class="btn btn-default"   title="批量修改用户的角色" >修改角色</a>
       <a  href="#"  onclick="if(isselect()) openUser(); return false; "     class="btn btn-default" title="批量修改部门" >转移部门</a>


             <asp:LinkButton ID="btn_del" runat="server" CssClass="btn btn-danger"  OnClientClick="if(isselect()) return true; return false;"   onclick="btn_del_Click" >批量删除</asp:LinkButton>

            
             &nbsp;|&nbsp;  
            
            
                <a href="javascript:void(0);"  onclick='ept("Users_Export_Data.aspx?types=users")'  class="btn btn-success "> Excel导出</a> 

                 <a href="javascript:void(0);"  onclick='ept("Users_Import_Data.aspx?types=users")'  class="btn btn-default "> Excel导入</a> 


  
   

 </div>




    
  <div class="result-title">
        用户名或显示名：<asp:TextBox runat="server" ID="txt_username" CssClass="form-control"  style="width:120px;  display:inline-block"></asp:TextBox> 
       &nbsp;&nbsp; 
      
         部门过滤 <asp:DropDownList runat="server" CssClass="form-control" style="width:200px; display:inline-block" ID="ddl_dept"   AppendDataBoundItems="true"    AutoPostBack="True"  >
                               <asp:ListItem Text="所有部门" Value="" ></asp:ListItem>
                                 </asp:DropDownList>

      <asp:Button runat="server" ID="btnsearch"  CssClass="btn btn-primary"  Text="搜索" OnClick="btnsearch_Click"/>
      </div>
            </div>
     





     
 
     
      


  
 <div class="thelist"   id="thetable">

    
  
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="uid" DataSourceID="SqlDataSource1">
            

           <LayoutTemplate>
              
                       <table id="tbl_userlists"   class="table table-hover " >
                           
                               <tr>
                      <th style="width:50px"  > 
                          <input id="chk_SelectedHeader" type="checkbox"    onclick="selectall(this);" />  
                      </th>
                       <th>UID</th>
                      <th>用户名</th>
                       <th>显示名</th>
                        <th>部门</th>
                         <th>员工号</th>
                          <th>电话</th>
                         <th>邮件</th>
                        <th>操作</th>
                  </tr>

                             <tr id="itemPlaceholder" runat="server">
                             </tr>
                         </table>
                     
            
         </LayoutTemplate>


         <ItemTemplate>
             <tr>
               <td>
               <input type="checkbox"  class="ck_item"   title=<%# Eval("uid") %> value='<%# Eval("uid") %>'  /> 
            <asp:HiddenField runat="server" ID="hf_id" Value=<%# Eval("uid") %> /> 
               </td>

                 <th><%# Eval("uid") %> </th>

               <td>
                      <a href='Users_EditUser.aspx?id=<%#Eval("uid") %>' ><%#Eval("username") %></a>
               </td>


                 <td><%#Eval("displayname") %></td>
                 <td><%#Eval("department") %></td>
                        <td><%#Eval("staffcode") %></td>
                         <td><%#Eval("tel") %></td>
                          <td><%#Eval("email") %></td>
                      <td>
                  
      <a href="#" onclick="Pop('Users_SetRight.aspx?id=<%#Eval("uid") %>',500,380,'角色设置');return false;" >角色</a>   
          

                      </td>  
           </tr>
         </ItemTemplate>
      
          
     </asp:ListView>
   

      
     
                    <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm" EnableViewState="false"
       PagedControlID="ListView1" runat="server" PageSize=30>
 <Fields>
           
     
            <asp:NextPreviousPagerField 
                PreviousPageText="<" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="true" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />

            <asp:NumericPagerField 
                ButtonType="Link" 
                CurrentPageLabelCssClass="btn btn-primary disabled"  
                RenderNonBreakingSpacesBetweenControls="false"
                NumericButtonCssClass="btn btn-default" 
                ButtonCount="10" 
                NextPageText="..." 
                NextPreviousButtonCssClass="btn btn-default" />
            
           <asp:NextPreviousPagerField 
               NextPageText=">" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="true" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
               ButtonCssClass="btn btn-default" 
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
      

  </div>
  
  
  
  
  
  
  
  
  
  
    <asp:SqlDataSource ID="SqlDataSource1" 
    
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    runat="server"  
       SelectCommand="SELECT [uid], [username], [displayname], [Tel], [email], [StaffCode],   [Department] FROM [users_users]    where (@username='' or username+displayname like '%'+@username+'%') and (@dept='' or department=@dept)  ORDER BY [uid] DESC" ProviderName="System.Data.SqlClient" 
        >
       
      <SelectParameters> 
            <asp:ControlParameter ControlID="txt_username" ConvertEmptyStringToNull=false Name="username" /> 
        <asp:ControlParameter ControlID="ddl_dept" ConvertEmptyStringToNull=false Name="dept" /> 
        </SelectParameters>


    </asp:SqlDataSource>
   


   <script>



       function openRole() {
           var _uid = $("#hf_ids").val();
           Pop("Users_SetRight.aspx?uids=" + _uid, "500", "380", "设置角色");

       }

       function openUser() {
           var _uid = $("#hf_ids").val();
           Pop("EditUser_batch.aspx?uids=" + _uid, "500", "380", "修改部门");
           

       }




   </script>
      
    
    <input type="hidden" name="hf_ids" id="hf_ids" />




</asp:Content>
