<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_batchDetail.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_batchDetail" %>
<%@ Register Src="~/WebUserControls/cmp_batchDetailSplit.ascx" TagPrefix="uc1" TagName="cmp_batchDetailSplit" %>
<%@ Register Src="~/WebUserControls/cmp_batchDetailMongo.ascx" TagPrefix="uc1" TagName="cmp_batchDetailMongo" %>

<asp:FormView ID="frmView" runat="server" DataKeyNames="BatchID" DataSourceID="ods" Width="100%">
    <ItemTemplate>
        <div class="row small">
            <div class="col-6">
                <h3><%# traduci ("BatchDetail") %></h3>
                <asp:Label runat="server" ID="lblRequestPresent" CssClass="text-danger" Visible='<%# !canStartNew %>' Text='<%# traduci("NewNestReqDisabled") %>' />
            </div>
            <div class="col-3">
                <asp:LinkButton runat="server" ID="lbtAccept" CssClass="btn btn-sm btn-block btn-success"
                    OnClick="lbtAccept_Click"
                    OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmAcceptNest") %>'
                    Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.NestDone)  && !checkType(Eval("BatchType"), NKC_SDK.BatchType.Descendant) %>'><%# traduci("AcceptNest") %></asp:LinkButton>
            </div>
            <div class="col-3">
                <asp:LinkButton runat="server" ID="lbtSendEstim" CssClass="btn btn-sm btn-block btn-info"
                    OnClick="lbtSendEstim_Click"
                    OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmStartEstim") %>'
                    Visible='<%# (checkStatus(Eval("Status"), NKC_SDK.BatchStatus.Errors) || checkStatus(Eval("Status"), NKC_SDK.BatchStatus.Imported)) && canStartNew %>'><%# traduci("SendToEstim") %></asp:LinkButton>
                <asp:LinkButton runat="server" ID="lbtStopEstim" CssClass="btn btn-sm btn-block btn-dark"
                    OnClick="lbtStopEstim_Click"
                    OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmStopEstim") %>'
                    Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.EstimationRequested) %>'><%# traduci("StopEstim") %></asp:LinkButton>
                <asp:LinkButton runat="server" ID="lbtSendNesting" CssClass="btn btn-sm btn-block btn-warning"
                    OnClick="lbtSendNesting_Click"
                    OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmStartNest") %>'
                    Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.EstimationDone) && !checkType(Eval("BatchType"), NKC_SDK.BatchType.Descendant) && canStartNew %>'><%# traduci("SendToNest") %></asp:LinkButton>
                <asp:LinkButton runat="server" ID="lbtStopNesting" CssClass="btn btn-sm btn-block btn-dark"
                    OnClick="lbtStopNesting_Click"
                    OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmStopNest") %>'
                    Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.NestRequested) %>'><%# traduci("StopNest") %></asp:LinkButton>
                <asp:LinkButton runat="server" ID="lbtResetNest" CssClass="btn btn-sm btn-block btn-warning"
                    OnClick="lbtResetNest_Click"
                    OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmResetNest") %>'
                    Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.NestDone)  && !checkType(Eval("BatchType"), NKC_SDK.BatchType.Descendant) %>'><%# traduci("ResetNest") %></asp:LinkButton>
            </div>
            <div class="col-12">
                <div class="row">
                    <div class="col-6">
                        <div class="form-group row py-0 mt-0 mb-1">
                            <label for="BatchIDLabel" class="col-sm-4 col-form-label py-0">Name</label>
                            <div class="col-sm-8 font-weight-bold">
                                <asp:Label ID="TaktLabel" runat="server" Text='<%# Eval("Takt") %>' />
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="form-group row py-0 mt-0 mb-1">
                            <label for="StatusLabel" class="col-sm-4 col-form-label py-0">Status</label>
                            <div class="col-sm-8 font-weight-bold">
                                <asp:Label ID="StatusLabel" runat="server" Text='<%# BStatus(Eval("Status")) %>' />
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="form-group row py-0 mt-0 mb-1">
                            <label for="lblNumOrders" class="col-sm-4 col-form-label py-0"># KIT/Parts</label>
                            <div class="col-sm-8 font-weight-bold">
                                <asp:Label ID="lblNumOrders" runat="server" Text='<%# Eval("NumOrders") %>' />/<asp:Label ID="Label2" runat="server" Text='<%# Eval("NumItems") %>' />
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="form-group row py-0 mt-0 mb-1">
                            <label for="TotalTimeLabel" class="col-sm-4 col-form-label py-0">Estimated Time</label>
                            <div class="col-sm-8 font-weight-bold">
                                <asp:Label ID="TotalTimeLabel" runat="server" Text='<%# Eval("TotalTime","{0:N2}") %>' />
                                <%# traduci ("Min") %>
                            </div>
                        </div>
                    </div>
                </div>
    </ItemTemplate>
</asp:FormView>
<asp:HiddenField ID="hfBatchId" runat="server" />
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByKey" TypeName="AppData.DS_AppTableAdapters.BatchListTableAdapter">
    <SelectParameters>
        <asp:ControlParameter ControlID="hfBatchId" DefaultValue="0" Name="BatchID" PropertyName="Value" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<uc1:cmp_batchDetailMongo runat="server" ID="cmp_batchDetailMongo" showInline="true" />
<div runat="server" id="divSplit">
    <uc1:cmp_batchDetailSplit runat="server" ID="cmp_batchDetailSplit" />
</div>