<%@ Page Title="" Language="C#" MasterPageFile="bps.Master" AutoEventWireup="true" CodeBehind="AuditingList.aspx.cs" Inherits="bid.bid.AuditingList" %>
 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">




    
     
       <section class="content-header">
                     <h4>
                        我的审批
                         
                    </h4>
                    
     </section>
            


    
    <div style=" margin:10px;  ">
        类别： 


        <asp:DropDownList runat="server" ID="ddl_types" AutoPostBack="true" CssClass="form-control" style="width:200px; display:inline-block" OnSelectedIndexChanged="ddl_types_SelectedIndexChanged">
            <asp:ListItem Text="==不限==" Value=""></asp:ListItem>
            <asp:ListItem Text="BOM物料清单" Value="bom"></asp:ListItem>
            <asp:ListItem Text="Quote报价单" Value="quote"></asp:ListItem> 
        </asp:DropDownList>



          <a href="AuditingListed.aspx" style=" float:right ;" class="btn btn-success">我审批过的申请</a>
    </div>
  
    <div style="clear:both"></div>
    <hr />



    <asp:ListView ID="lv_list" runat="server" DataKeyNames="id" DataSourceID="SqlDataSource1">
         
           
       <LayoutTemplate>
 
   <table  class="table table-hover">
       <tr>
           <th width="70px">
               类型
           </th>
          
             <th width="70px">
               流水号
           </th>

             <th width="120px">
               创建时间
           </th>

              <th width="90px">
               编号
           </th>
           
              <th width="70px">
               版本号
           </th>

              <th width="90px">
               名称
           </th>


              <th width="100px">
               客户
           </th>


              <th width="280px">
               备注
           </th>

           <th width="90px">
               审批
           </th>

       </tr>
      <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
    </table>
  </LayoutTemplate>




        <ItemTemplate>
 

                
	   		
    
    
    
     <tr  >
         <td>
             <%#Eval("types").ToString()=="bom"?"<span class='label label-success'>Bom</span>":" <span class='label label-danger'>Quote</span> " %>
         </td>

         <td>
             <%# Eval("id")%>
         </td>

         <td>

             <%# DtHelper.FormatDt(Eval("createdate"))%>
         </td>

		    <td>
             <%# Eval("code")%>
         </td>  

           <td>
             <%# Eval("revision")%>
         </td>  
                 
         	    <td>
             <%# Eval("name")%>
         </td>  
           <td>
             <%# Eval("customercode")%>
         </td>  

           <td>
             <%# Eval("note")%>
         </td>  

         <td>


                   <span    >
                   <a href='#'  
                        id="_a_<%#Eval("id") %>" 

                     onclick="Pop('auditing.aspx?id=<%#Eval("id") %>&t=<%#Eval("types") %>',750,550,'审批申请');  return false;"

                     class="btn btn-flat btn-danger btn-sm"> 
                       
                       审批

                   </a> 
                    
                </span>


                 <a   
                     
                     href="###" 
                     onclick="setLink('<%#Eval("types") %>',<%#Eval("id") %>)" 
                 class="btn btn-flat btn-primary btn-sm">查看</a> 

			  </td>
	 </tr>
							
	   
	
	  
     
	
	  
	   		 
           
        </ItemTemplate>
   
       
    </asp:ListView>





    <script>
        function setLink(_types, _id) {
            if (_types == "bom") {
                window.open("bom_detail.aspx?id=" + _id);

            }
            else {
                window.open("quote_detail.aspx?id=" + _id);
            }
        }

    </script>




    
<div>
 <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm" EnableViewState="false"
      QueryStringField="Page" PagedControlID="lv_list" runat="server" PageSize=10>
 <Fields>
           
     
            <asp:NextPreviousPagerField 
                PreviousPageText="<" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="true" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />

            <asp:NumericPagerField 
                ButtonType="Link" 
                CurrentPageLabelCssClass="btn btn-primary disabled"  
                RenderNonBreakingSpacesBetweenControls="false"
                NumericButtonCssClass="btn btn-default" 
                ButtonCount="10" 
                NextPageText="..." 
                NextPreviousButtonCssClass="btn btn-default" />
            
           <asp:NextPreviousPagerField 
               NextPageText=">" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="true" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
               ButtonCssClass="btn btn-default" 
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
</div>




<asp:SqlDataSource ID="SqlDataSource1"
         ConnectionString='<%$ ConnectionStrings:ConnectionString %>'
        
         runat="server" 
        
        SelectCommand=" select * from 
(  
    select 'bom' as types,   createdate, id, productcode as code, revision, productname as name,  customercode,  note   from purchase_bom  where waituid=@uid 
    union all
    select 'quote' as types, createdate, id,quotecode as code,  revision, productname as name, customercode,note from purchase_quote where waituid=@uid )
     A  where (@types='' or types=@types) order by id  desc   " 
        
        OnSelecting="SqlDataSource1_Selecting">
        <SelectParameters>
            <asp:Parameter Name="uid" Type="Int32" />
            <asp:ControlParameter Name="types" ControlID="ddl_types" ConvertEmptyStringToNull="false" />
        </SelectParameters>

    </asp:SqlDataSource>




     






</asp:Content>
