<%@ Page Title="" Language="C#" MasterPageFile="~/Car/car.Master" AutoEventWireup="true" CodeBehind="drivers_mgr.aspx.cs" Inherits="Car.Car.drivers_mgr" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    
    <div style="padding:10px; width:95%; text-align:right">
    <a href="###" onclick="Pop('driver_addedit.aspx',920,600,'添加司机')" class="btn btn-primary btn-flat">添加司机</a>
        </div>



    
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
  <div class="content">

     


      <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
          <ContentTemplate>


              <asp:GridView ID="GridView1" runat="server"  
                   AllowSorting="false"
                   GridLines="None" CssClass="table table-hover "  
                   AutoGenerateColumns="false" DataKeyNames="uid" 
                  DataSourceID="SqlDataSource1">
                 
                 <Columns>

                     <asp:BoundField DataField="Uid" HeaderText="UID" />
                    <asp:BoundField DataField="displayname" HeaderText="姓名" />
                      <asp:BoundField DataField="Department" HeaderText="部门" />
                       <asp:BoundField DataField="mobile" HeaderText="手机" />

                    <asp:BoundField DataField="drivercartype" HeaderText="准驾车型" />
                    <asp:BoundField DataField="birthday" DataFormatString="{0:yyyy-MM-dd}" HeaderText="出生日期" />

                       <asp:BoundField DataField="firstdriver" DataFormatString="{0:yyyy-MM-dd}" HeaderText="初次领证日期" />
                       <asp:BoundField DataField="from1" DataFormatString="{0:yyyy-MM-dd}" HeaderText="驾照有效期从" />
                        <asp:BoundField DataField="to1" DataFormatString="{0:yyyy-MM-dd}" HeaderText="驾照有效期到" />
                       <asp:BoundField DataField="note" DataFormatString="{0:yyyy-MM-dd}" HeaderText="备注" />


                      <asp:TemplateField>
                          <HeaderTemplate>编辑</HeaderTemplate>
                          <HeaderStyle Width="60px" />
                          <ItemTemplate>

                              <a href="###" onclick=Pop("driver_addedit.aspx?uid=<%#Eval("uid")%>",920,600,'编辑司机')   
                                    >编辑</a> 
                          </ItemTemplate>

                      </asp:TemplateField>

        <asp:CommandField   DeleteText="<span onclick=&quot;JavaScript:return confirm('确定移除吗？移除并不会删除账户')&quot;>移除</span> "
             ItemStyle-Width="60px" HeaderText="移除"
             ShowDeleteButton="true" ControlStyle-Width="60px"    />

                     

                 </Columns>









              </asp:GridView>


      
              <asp:SqlDataSource 
                  
                   ConnectionString="<%$ ConnectionStrings:Connectionstring %>"
                  ID="SqlDataSource1" runat="server" 
                  DeleteCommand="delete  from users_usersinroles where rolename='Drivers' and uid=@uid"
               　SelectCommand="  select uid,username,displayname,Department,mobile,avtor,drivercartype,firstdriver,from1,to1,birthday,drivers_info.note 
from users_users left  join drivers_info   on users_users.uid=drivers_info.duid
where uid  in (select uid from users_usersinroles where rolename='drivers') 
  order by uid desc 
                  " 
               >
                  <DeleteParameters>
                      <asp:Parameter Name="uid" Type="Int32" />
                  </DeleteParameters>
                  
                 
              </asp:SqlDataSource>
          </ContentTemplate>

      </asp:UpdatePanel>
      
      
      
      
      
      
      
      
      
       </div>

</asp:Content>
