<%@ 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">
             <span class="span_help">说明</span>:对公司员工进行管理，包括员工批量导入，域集成，员工角色等。
     </div>




        <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> 


 

             
  
         &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> 

 </div>

            </div>
     





     
 
     
      


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

    

  <asp:Repeater runat="server"  EnableViewState="false"  ClientIDMode="Static"  DataSourceID="SqlDataSource1" ID="rpt_userlists">
    
      <HeaderTemplate>
          <table id="tbl_userlists"   class="table table-hover " >
              <thead>
                  <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>
              </thead>
         <tbody>
      </HeaderTemplate>
        <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>

      <FooterTemplate>
 </tbody>
  </table>
      </FooterTemplate>

  </asp:Repeater>
  


      

      

  </div>
  
  
  
  
  
  
  
  
  
  
    <asp:SqlDataSource ID="SqlDataSource1" 
    
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
    runat="server"  
       SelectCommand="SELECT [uid], [username], [displayname], [Tel], [email], [StaffCode],   [Department] FROM [users_users]    where  (@dept='' or department=@dept)  ORDER BY [uid] DESC" 
        >
        <DeleteParameters>
            <asp:Parameter Name="uid" Type="Int32" />
        </DeleteParameters>
       
      <SelectParameters> 
        <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", "修改部门");
           

       }



       $(document).ready(function () {
           $('#tbl_userlists').dataTable({
               "autoWidth": false,
               "lengthMenu": [[20, 50, 100, -1], [20, 50, 100, "All"]],
               "columnDefs": [{ "targets": [0, 7], "orderable": false, "searchable": false }] 
           });
       });
   </script>
      
    
    <input type="hidden" name="hf_ids" id="hf_ids" />




</asp:Content>
