<%@ Page Language="C#" ValidateRequest="false"  EnableEventValidation="false"  AutoEventWireup="true" CodeBehind="pc_login_scan_hardware_export.aspx.cs" Inherits="Helpdesk.Helpdesk.pc_login_scan_hardware_export" %>

<!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 id="Head1" runat="server">
    <title></title>
    
    
       <style>
 
 
  
   .btn{border:1px solid #919699; 
  background:#fcfcfc;  
  text-align:center; 
  text-decoration:none; 
  padding:1px 5px; 
  cursor:pointer; 
  margin-right:2px;
  font-size:12px;
  width: 78px;
 height: 25px;
}


 </style>
 
 
</head>
<body style=" font-family:Verdana; font-size:12px;">
    <form id="form1" runat="server">
    
    扫描结果
    
          <asp:Button ID="Button1" runat="server" Text="导出"    CssClass="btn"
            onclick="Button1_Click"/>
            
            
                  
             机器名/使用者/BIOS/主板序列号 <asp:TextBox ID="txt_search" runat="server" ></asp:TextBox>
               <asp:Button ID="Button2" runat="server" Text="搜索"    CssClass="btn"
         />
            
             
 <div style="   ">

    <asp:GridView runat="server" ID="gv_list" AllowPaging="True" 
     PageSize=50    onrowdatabound="gv_list_RowDataBound"     AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
                
            <asp:BoundField DataField="pcname" HeaderText="机器名" 
                SortExpression="pcname" />
                                
                
            <asp:BoundField DataField="loginname" HeaderText="使用者" 
                SortExpression="loginname" />
                
               <asp:BoundField DataField="department" HeaderText="使用部门" 
                SortExpression="department" />
                  
                
     
            <asp:BoundField DataField="bios_caption" HeaderText="BIOS名称" 
                SortExpression="bios_caption" />
                
            <asp:BoundField DataField="bios_manufacturer" HeaderText="BISO制造商" 
                SortExpression="bios_manufacturer" />
            <asp:BoundField DataField="bios_serialnumber" HeaderText="BISO序列号" 
                SortExpression="bios_serialnumber" />
                
            <asp:BoundField DataField="bios_smbiosbiosversion" 
                HeaderText="BIOS smb版本" SortExpression="bios_smbiosbiosversion" />
            <asp:BoundField DataField="bios_version" HeaderText="BIOS版本" 
                SortExpression="bios_version" />
           
                
                
            <asp:BoundField DataField="board_caption" HeaderText="主板名称" 
                SortExpression="board_caption" />
            <asp:BoundField DataField="board_manufacturer" HeaderText="主板制造商" 
                SortExpression="board_manufacturer" />
            <asp:BoundField DataField="board_serialnumber" HeaderText="主板序列号" 
                SortExpression="board_serialnumber" />
            <asp:BoundField DataField="board_tag" HeaderText="主板标记" 
                SortExpression="board_tag" />
                
            <asp:BoundField DataField="board_product" HeaderText="主板产品" 
                SortExpression="board_product" />
            <asp:BoundField DataField="os_caption" HeaderText="操作系统名称" 
                SortExpression="os_caption" />
         
                <asp:TemplateField>
                <HeaderTemplate>安装日期</HeaderTemplate>
                <ItemTemplate>
                <%#getdate(Eval("os_installdate")) %>
                </ItemTemplate>
                 </asp:TemplateField>
                 
                   <asp:TemplateField>
                <HeaderTemplate>上次启动</HeaderTemplate>
                <ItemTemplate>
                <%#getdate(Eval("os_lastbootuptime"))%>
                </ItemTemplate>
                 </asp:TemplateField>
                 
              
        
            <asp:BoundField DataField="os_totalvirtualmemorysize" 
                HeaderText="内存" 
                SortExpression="os_totalvirtualmemorysize" />
                
        
            <asp:BoundField DataField="os_windowsdirectory" 
                HeaderText="系统目录" SortExpression="os_windowsdirectory" />
            <asp:BoundField DataField="createdate" HeaderText="扫描时间" 
                SortExpression="createdate" />
                
                    <asp:BoundField DataField="os_version" HeaderText="OS版本" 
                SortExpression="os_version" />
                
            <asp:BoundField DataField="os_csdversion" HeaderText="SP包" 
                SortExpression="os_csdversion" />
                
              <asp:BoundField DataField="ip" HeaderText="IP" SortExpression="ip" />
                 <asp:BoundField DataField="MAC" HeaderText="MAC" SortExpression="MAC" />
                            
                    </Columns>
                
  
                  <HeaderStyle BackColor="#E0E0E0" Font-Bold="True" Height="30" HorizontalAlign="Center" />
    <AlternatingRowStyle BackColor="#F2F2F2" />
      <RowStyle BackColor="#ffffff"  Height="28"/>
    <PagerSettings Mode="NumericFirstLast" />    
     
       
        </asp:GridView>
     </div>
        <br />
        
        
        <asp:SqlDataSource ID="SqlDataSource1"
         ConnectionString="<%$ ConnectionStrings:connectionstring %>"
         runat="server" 
            DeleteCommand="DELETE FROM [helpdesk_loginscan_hardware] WHERE [id] = @id" 
             ProviderName="System.Data.SqlClient" 
            SelectCommand="SELECT [helpdesk_loginscan_hardware].*, Department FROM [helpdesk_loginscan_hardware]
left join users_users on [helpdesk_loginscan_hardware].loginname=users_users.username 

where  ((@key='') or (pcname+loginname+board_serialnumber+bios_serialnumber like '%'+@key+'%') )
ORDER BY [pcname] " 
            >
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
         
           <SelectParameters>
              <asp:ControlParameter DefaultValue="" Name="key" ControlID="txt_search" ConvertEmptyStringToNull="false" />
           </SelectParameters>
          
           
        </asp:SqlDataSource>
 
    </form>
</body>
</html>
