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


      

  
    
 <!--buttons toolbar-->
          <div class="well">
  
       <a href="pc_addeditsoftware.aspx" class="btn  bg-green btn-flat">添加新软件</a>
            
        <asp:Button   runat="server" ID="btndelete" Text="删除"  
            OnClientClick="return confirm('您确定要删除该PC吗?');"   
            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=software')" class="btn   btn-primary   btn-flat"> 导出</a>

   <a href="javascript:void(0)"; onclick="ept('Import_Data.aspx?types=software')" 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:BoundField  HeaderText="软件类别" DataField="types"  SortExpression="types" ItemStyle-Width="100px"   />
   


     <asp:HyperLinkField DataTextField="softwarename" DataNavigateUrlFields="id" DataNavigateUrlFormatString="pc_addeditsoftware.aspx?id={0}" Target="_blank" HeaderText="软件名称" SortExpression="softwarename"  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="软件版本" DataField="version"  SortExpression="version" ItemStyle-Width="80px"  />
  
        <asp:BoundField  HeaderText="采购日期" DataField="buydate"   DataFormatString="{0:yyyy-MM-dd}"  SortExpression="buydate" ItemStyle-Width="100px"   />
  

          <asp:BoundField  HeaderText="支持操作系统" DataField="os"    SortExpression="os" ItemStyle-Width="120px"   />
  
    </Columns>
    
    </asp:GridView>
  
         

     <asp:SqlDataSource ID="SqlDataSource1" runat="server"  CacheDuration="120" CacheExpirationPolicy="Absolute" CacheKeyDependency="pclist" EnableCaching="true"
         ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
         SelectCommand="SELECT ID,types,softwarename,manufacturer,belongto,dept,version,buydate,os from  helpdesk_software where ((@key='') or (softwarename 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>
