<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_BP_sheetList.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_BP_sheetList" %>

<asp:HiddenField ID="hfStackID" runat="server" />
<asp:GridView runat="server" ID="grView" AutoGenerateColumns="False" DataKeyNames="SheetID" DataSourceID="ods" CssClass="table table-sm table-striped" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
  <HeaderStyle CssClass="default" />
  <PagerStyle CssClass="active GridPager" />
  <PagerSettings Mode="NumericFirstLast" />
  <SelectedRowStyle CssClass="table-info" />
  <EmptyDataTemplate>
      <%: traduci("NoRecord") %>
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False">
      <HeaderTemplate>
        <asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true" ToolTip="Reset"><i class="fa fa-refresh"></i></asp:LinkButton>
      </HeaderTemplate>
      <ItemTemplate>
        <asp:LinkButton ID="lbSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-primary"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="SheetIndex" HeaderText="#" ReadOnly="True" SortExpression="SheetIndex" />
    <asp:TemplateField HeaderText="Material" SortExpression="MatExtCode">
      <ItemTemplate>
        <div class="row">
          <div class="col-8 text-left">
            <asp:Label ID="lblMatExtCode" runat="server" Text='<%# Eval("MatExtCode") %>' CssClass="font-weight-bold"></asp:Label>
          </div>
          <div class="col-4">
            <asp:Label ID="lblSheetID" runat="server" Text='<%# Eval("SheetID") %>' CssClass="small text-right"></asp:Label>
          </div>
          <div class="col-12 text-left">
            <asp:Label ID="lblMatDesc" runat="server" Text='<%# Eval("MatDesc") %>' CssClass="small"></asp:Label>
          </div>
        </div>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Estim" SortExpression="WrkTimeEst">
      <ItemTemplate>
        <asp:Label ID="lblWrkTimeEst" runat="server" Text='<%# formatMinSec(Eval("WrkTimeEst", "{0:N0}")) %>'></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByStack" TypeName="AppData.DS_AppTableAdapters.SheetListTableAdapter">
  <SelectParameters>
    <asp:ControlParameter ControlID="hfStackID" DefaultValue="0" Name="StackID" PropertyName="Value" Type="Int32" />
  </SelectParameters>
</asp:ObjectDataSource>
