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


<asp:FormView ID="frmView" runat="server" DataKeyNames="BatchID" DataSourceID="ods" Width="100%">
  <ItemTemplate>
    <div class="row small">
      <div class="col-9">
        <h3>  <%: traduci ("BatchDetail") %></h3>
      </div>
      <div class="col-3">
        <asp:LinkButton runat="server" ID="lbtSendEstim" CssClass="btn btn-sm btn-block btn-info" OnClick="lbtSendEstim_Click" OnClientClick='return confirm("Send to Estimation?")' Visible='<%# (checkStatus(Eval("Status"), NKC_SDK.BatchStatus.Errors) || checkStatus(Eval("Status"), NKC_SDK.BatchStatus.Imported)) && canStartNew() %>'>Send to Estimation</asp:LinkButton>
        <asp:LinkButton runat="server" ID="lbtStopEstim" CssClass="btn btn-sm btn-block btn-dark" OnClick="lbtStopEstim_Click" OnClientClick='return confirm("Are you sure to stop Estimation?")' Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.EstimationRequested) %>'>Stop Estimation</asp:LinkButton>
        <asp:LinkButton runat="server" ID="lbtSendNesting" CssClass="btn btn-sm btn-block btn-warning" OnClick="lbtSendNesting_Click" OnClientClick='return confirm("Send to Nesting?")' Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.EstimationDone) && canStartNew() %>'>Send to Nesting</asp:LinkButton>
        <asp:LinkButton runat="server" ID="lbtStopNesting" CssClass="btn btn-sm btn-block btn-dark" OnClick="lbtStopNesting_Click" OnClientClick='return confirm("Are you sure to stop Nesting?")' Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.NestRequested) %>'>Stop Nesting</asp:LinkButton>
        <asp:LinkButton runat="server" ID="lbtAccept" CssClass="btn btn-sm btn-block btn-success" OnClick="lbtAccept_Click" OnClientClick='return confirm("Are you sure?")' Visible='<%# checkStatus(Eval("Status"), NKC_SDK.BatchStatus.NestDone) %>'>Accept Nesting</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>


<div class="row small text-dark">
  <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">Mat OEE</label>
      <div class="col-sm-8 font-weight-bold">
        <asp:Label runat="server" ID="lblMatDet" />
      </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">Prod</label>
      <div class="col-sm-8 font-weight-bold">
        <asp:Label runat="server" ID="lblProdDet" />
      </div>
    </div>
  </div>
  <div class="col-12 ">
    <asp:Label runat="server" ID="lblTestJson" />
  </div>
</div>
