<%@ Page Title="用户列表" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Users_Lists.aspx.cs" Inherits="Dotnet.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="###" onclick="Pop('Users_EditUser.aspx',980,540,'用户详情');">添加新用户</a> 
         

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

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

             

             &nbsp;|&nbsp;  
       <a href="#" onclick="if(isselect()) openRole(); return false; " class="btn btn-default"   title="批量修改用户的角色" >批量修改角色</a>
       <a  href="#"  onclick="if(isselect()) moveDept(); 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> 

                      &nbsp;|&nbsp;  
  
            <a href="###" class="btn btn-default"  
    onclick="Pop('Users_Xfpinyin.aspx',500,380,'修复拼音，方便用户查询');return false;"
       
       > 修复拼音</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"      AutoPostBack="True"  >
                               
                                 </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 width=60px > <input id="cb_selectall" type="checkbox"    /> 
                      </th>
                        <th width="80px">UID</th>
                        <th width="90px">用户名</th>
                        <th  width="120px">显示名</th>
                        <th  width="180px">部门</th>
                        <th width="100px">员工号</th>
                        <th width="160px">电话</th>
                        <th>邮件</th>
                        <th width="90px">操作</th>
                  </tr>




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


         <ItemTemplate>
             <tr>
               <td>   <input type="checkbox"  class="ck_item"   value='<%# Eval("uid") %>'  />    </td>
               <td><%# Eval("uid") %> </td> 
               <td> <a href="###" onclick="Pop('Users_EditUser.aspx?id=<%#Eval("uid") %>',980,540,'用户详情');"  ><%#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,400,'角色设置');return false;" >角色</a> </td>  
           </tr>
         </ItemTemplate>
      
          
     </asp:ListView>
   

      
     
  <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm"  
       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", "400", "设置角色");

       }

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

       }

       


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

     
</asp:Content>
