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

<asp:HiddenField ID="hfBatchID" runat="server" />

<asp:GridView ID="grViewCurrent" runat="server" DataSourceID="odsCurr" AllowPaging="false" AllowSorting="false" Width="100%" AutoGenerateColumns="false" ShowHeader="false" GridLines="None">
    <EmptyDataTemplate>
        <div class="row border border-success rounded">
            <div class="col-6 text-left text-success">
                <b><%: traduci("NoCurrentBunk") %></b>
            </div>
            <div class="col-6 text-right text-secondary">
                 <%: traduci("Waiting") %>
            </div>
        </div>
    </EmptyDataTemplate>
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <div class="row border border-success rounded">
                    <div class="col-12 col-lg-4 text-left text-secondary" runat="server" visible='<%# Eval("NumSheets").ToString() == Eval("NumSheetsWorked").ToString()  %>'>
                        <b> <%: traduci("Previous") %></b> # <%: traduci("Bunk") %> <b>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("StackDtmx") %>' /></b>
                        (<asp:Label ID="Label2" runat="server" Text='<%# Eval("StackIndex") %>' />)
                    </div>
                    <div class="col-12 col-lg-4 text-left text-success" runat="server" visible='<%# Eval("NumSheets").ToString() != Eval("NumSheetsWorked").ToString()  %>'>
                        <b> <%: traduci("Current") %></b># <%: traduci("Bunk") %> <b>
                            <asp:Label ID="StackIDLabel" runat="server" Text='<%# Eval("StackDtmx") %>' /></b>
                        (<asp:Label ID="StackIndexLabel" runat="server" Text='<%# Eval("StackIndex") %>' />)
                    </div>
                    <div class="col-12 col-lg-5 text-center px-0">
                        <div class="row textCondens">
                            <div class="col-3 pr-0">
                                 <%: traduci("Sheets") %><b><asp:Label ID="NumSheetsLabel" runat="server" Text='<%# Eval("NumSheets") %>' /></b>
                            </div>
                            <div class="col-3 px-0">
                                 <%: traduci("Printed") %> <b>
                                    <asp:Label ID="NumSheetsPrintedLabel" runat="server" Text='<%# Eval("NumSheetsPrinted") %>' /></b>
                            </div>
                            <div class="col-3 px-0">
                                 <%: traduci("Worked") %><b>
                                    <asp:Label ID="NumSheetsWorkedLabel" runat="server" Text='<%# Eval("NumSheetsWorked") %>' /></b>
                            </div>
                            <div class="col-3 pl-0 text-danger">
                                 <%: traduci("ToRedo") %> <b>
                                    <asp:Label ID="NumSheetsToRedoLabel" runat="server" Text='<%# Eval("NumSheetsToRedo") %>' /></b>
                            </div>
                        </div>
                    </div>
                    <div class="col-12 col-lg-3 text-right text-secondary" runat="server" visible='<%# Eval("NumSheets").ToString() == Eval("NumSheetsWorked").ToString()  %>'>
                         <%: traduci("Items") %><b>
                            <asp:Label ID="lblNumItems" runat="server" Text='<%# Eval("NumItems") %>' /></b>
                    </div>
                    <div class="col-12 col-lg-3 text-right text-success" runat="server" visible='<%# Eval("NumSheets").ToString() != Eval("NumSheetsWorked").ToString()  %>'>
                         <%: traduci("Items") %><b>
                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("NumItems") %>' /></b>
                    </div>
                </div>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<div class="row">
    <div class="col-12">
        <asp:LinkButton runat="server" ID="lbtCollectRedo" CssClass="btn btn-warning btn-block" OnClick="lbtCollectRedo_Click"><i class="fa fa-recycle" aria-hidden="true"></i> <%: traduci("CollectRedo") %><i class="fa fa-recycle" aria-hidden="true"></i></asp:LinkButton>
    </div>
</div>
<asp:FormView ID="frmViewNext" runat="server" DataKeyNames="StackID" DataSourceID="odsNext" Width="100%">
    <ItemTemplate>
        <div class="row border border-primary rounded">
            <div class="col-12 col-lg-4 text-left text-primary">
                <b> <%: traduci("Next") %></b> # <%: traduci("Bunk") %> <b>
                    <asp:Label ID="StackIDLabel" runat="server" Text='<%# Eval("StackDtmx") %>' /></b>
                (<asp:Label ID="StackIndexLabel" runat="server" Text='<%# Eval("StackIndex") %>' />)
            </div>
            <div class="col-12 col-lg-4 text-center textCondens">
                 <%: traduci("Sheets") %><b><asp:Label ID="NumSheetsLabel" runat="server" Text='<%# Eval("NumSheets") %>' /></b> | printed: <b>
                    <asp:Label ID="NumSheetsPrintedLabel" runat="server" Text='<%# Eval("NumSheetsPrinted") %>' /></b> | worked: <b>
                        <asp:Label ID="NumSheetsWorkedLabel" runat="server" Text='<%# Eval("NumSheetsWorked") %>' /></b>
            </div>
            <div class="col-12 col-lg-4 text-right text-primary">
                 <%: traduci("Items") %><b>
                    <asp:Label ID="lblNumItems" runat="server" Text='<%# Eval("NumItems") %>' /></b>
            </div>
        </div>
    </ItemTemplate>
    <EmptyDataTemplate>
        <div class="row border border-primary rounded">
            <div class="col-12 col-lg-6 text-left text-secondary">
                <b> <%: traduci("NoNextBunk") %></b>
            </div>
            <div class="col-12 col-lg-6 text-right text-secondary">
                 <%: traduci("BatchComplete") %>
            </div>
        </div>
    </EmptyDataTemplate>
</asp:FormView>
<asp:ObjectDataSource ID="odsCurr" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getCurrByBatch" TypeName="AppData.DS_AppTableAdapters.StackListTableAdapter">
    <SelectParameters>
        <asp:ControlParameter ControlID="hfBatchID" DefaultValue="0" Name="BatchID" PropertyName="Value" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="odsNext" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getNext" TypeName="AppData.DS_AppTableAdapters.StackListTableAdapter"></asp:ObjectDataSource>
<div class="row">
    <div class="col-12">
        <asp:LinkButton runat="server" ID="lbtCollectRedoOnEnd" CssClass="btn btn-warning btn-block" OnClick="lbtCollectRedoOnEnd_Click"><i class="fa fa-recycle" aria-hidden="true"></i> <%: traduci("CollectRedoOnEnd") %><i class="fa fa-recycle" aria-hidden="true"></i></asp:LinkButton>
    </div>
</div>

