<%@ Page Title="" Language="C#" MasterPageFile="~/helpdesk/Pc.master" AutoEventWireup="true" CodeBehind="Pc_listasset.aspx.cs" Inherits="helpdesk.helpdesk.Pc_listasset" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">


    
    
    

  
    
 <!--buttons toolbar-->
  
     <div class="well">
  
       <a href="pc_addeditasset.aspx" class="btn  bg-green  btn-flat">添加新外设</a>
            
        <asp:Button   runat="server" ID="btndelete" Text="删除"   
            OnClientClick="return confirm('您确定要删除该外设吗?');"   
            title="删除PC" class="btn btn-danger  btn-flat" onclick="btndelete_Click"  
          />
          
  &nbsp;&nbsp;&nbsp;&nbsp;  |  &nbsp;&nbsp;&nbsp;&nbsp; 
          <a href="javascript:void(0)"; onclick="ept('Export_Data.aspx?types=asset')" class="btn   btn-primary   btn-flat"> 导出</a>

                   <a href="javascript:void(0)"; onclick="ept('Import_Data.aspx?types=asset')" class="btn   bg-teal   btn-flat"> 导入</a>

           
   &nbsp;&nbsp;&nbsp;&nbsp;  |  &nbsp;&nbsp;&nbsp;&nbsp; 
   
   
      
                
     外设类别过滤： <asp:DropDownList ID="ddl_types"  AppendDataBoundItems="true" AutoPostBack="true"  class="form-control" style="display:inline-block; width:150px" runat="server">
             <asp:ListItem Text="所有" Value=""></asp:ListItem>
        </asp:DropDownList>



  
          
     &nbsp;&nbsp;&nbsp;&nbsp;      
                 
                
     软件关键字：  
      
    


 <asp:TextBox ID="txt_search" CssClass="form-control"  style="display:inline-block; width:150px" runat="server" ToolTip=""></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="搜索"  
            class=" btn-flat  btn-sm  btn-primary btn" onclick="Button1_Click"    />
            
            
         </div>   
  




  
   <!--/buttons toolbar-->
   
    <asp:GridView ID="gv_list" AllowPaging="true" PageSize="20" 
        GridLines="None"
        DataSourceID="SqlDataSource1" 
        AutoGenerateColumns="false" 
        runat="server" 
        class="table table-hover" 
        AllowSorting="True" 
        width="99%" >
    
    <Columns>
    
    <asp:TemplateField>
    <HeaderTemplate>
   
    <asp:LinkButton runat="server" ID="id" ></asp:LinkButton>
     
    </HeaderTemplate>
    <ItemStyle Width="10px" />
    <ItemTemplate > 
    <input id="Checkbox1" type="checkbox"  runat="server"   name='cbDel<%# Eval("id") %>' value='<%# Eval("id") %>' /> 
  
    </ItemTemplate>
    </asp:TemplateField>
    
      
     
        <asp:BoundField DataField="id" HeaderText="ID" HeaderStyle-Width="60px"  SortExpression="ID" />
      

     <asp:HyperLinkField DataTextField="assetname" DataNavigateUrlFields="id" DataNavigateUrlFormatString="pc_addeditasset.aspx?id={0}" Target="_blank" HeaderText="外设名称" SortExpression="assetname"  ItemStyle-Width="190px" />
      <asp:BoundField  HeaderText="外设类别" DataField="types"  SortExpression="types" ItemStyle-Width="100px"   />
   
        
      <asp:BoundField  HeaderText="制造商" DataField="manufacturer"  SortExpression="manufacturer" ItemStyle-Width="100px"   />
   
   
   
      <asp:BoundField  HeaderText="所属组织" DataField="belongto"  SortExpression="belongto" ItemStyle-Width="100px"  />
 
     <asp:BoundField  HeaderText="使用部门" DataField="dept"  SortExpression="dept" ItemStyle-Width="100px"  />
   
        
          <asp:BoundField  HeaderText="IP" DataField="ip"    SortExpression="ip" ItemStyle-Width="120px"   />
  
            <asp:BoundField  HeaderText="MAC" DataField="MAC"    SortExpression="MAC" ItemStyle-Width="120px"   />
  
        <asp:BoundField  HeaderText="采购日期" DataField="buydate"   DataFormatString="{0:yyyy-MM-dd}"  SortExpression="buydate" ItemStyle-Width="100px"   />
  
         <asp:BoundField  HeaderText="使用状态" DataField="usestatus"     SortExpression="usestatus" ItemStyle-Width="100px"   />
  

    </Columns>
    
    </asp:GridView>
  
         

     <asp:SqlDataSource ID="SqlDataSource1" runat="server"  CacheDuration="120" CacheExpirationPolicy="Absolute" CacheKeyDependency="pclist" EnableCaching="true"
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
         SelectCommand="select id, assetname, manufacturer, serialno, belongto, dept, usestatus, types, buydate, ip ,mac  from helpdesk_pc_asset where ((@key='') or (assetname like '%'+@key+'%')  ) and ((@types='') or (types=@types))    ORDER BY [id] DESC">
          <SelectParameters>
              <asp:ControlParameter DefaultValue="" Name="types" ControlID="ddl_types" ConvertEmptyStringToNull="false" />
            <asp:ControlParameter DefaultValue="" Name="key" ControlID="txt_search" ConvertEmptyStringToNull="false" />
          </SelectParameters>
         
     </asp:SqlDataSource>

  
  
  
  
  


</asp:Content>
