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



<div class="border border-info rounded p-2 text-center mb-2 w-100">

    <asp:FormView runat="server" ID="frmView" DataKeyNames="OrdID" DataSourceID="ods" OnDataBound="frmView_DataBound" CssClass="w-100">
        <ItemTemplate>
            <div class="row">
                <div class="col-12">
                    <asp:Label runat="server" ID="lblWarning" CssClass="text-danger lead font-weight-bold" Visible='<%# Eval("DrawFilePath").ToString() == "" %>'><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> <%: traduci ("NotYetProcessed") %></asp:Label>
                </div>
                <div class="col-12 textCondens">
                    <uc1:cmp_OOIL_drawings runat="server" ID="cmp_OOIL_drawings" DrawingPath='<%# Eval("DrawFilePath") %>' />
                </div>
            </div>
            <div class="row text-left textCondens bg-primary text-light my-2 mx-0">
                <div class="col-2">
                    <asp:Label ID="CncFilePathLabel" runat="server" Text='<%# traduci("CncFilePath") %>' />
                </div>
                <div class="col-10 font-weight-bold">
                    <asp:Label ID="CncFilePath" runat="server" Text='<%# getPathOffline(Eval("CncFilePath")) %>' />
                </div>
            </div>
            <hr />
            <div class="row my-2">
                <div class="col">
                    <asp:LinkButton runat="server" ID="lbtMakeCnc" CssClass="btn btn-success btn-block" Visible='<%# obj2int(Eval("OrdStatus")) <= 0 && canStartNew %>' OnClick="lbtMakeCnc_Click" OnClientClick='return confirm("Send to CAM?")'><i class="fa fa-laptop" aria-hidden="true"></i> <%: traduci ("MakeCncProg") %></asp:LinkButton>
                    <asp:LinkButton runat="server" ID="lbtStopCnc" CssClass="btn btn-dark text-light btn-block" Visible='<%# obj2int(Eval("OrdStatus")) == 1 && Eval("DrawFilePath").ToString() == "" %>' OnClick="lbtStopCnc_Click" OnClientClick='return confirm("Remove request to CAM?")'><i class="fa fa-laptop" aria-hidden="true"></i> <%: traduci ("StopCncReq") %></asp:LinkButton>
                </div>
                <div class="col">
                    <asp:Label runat="server" ID="lblRequestPresent" CssClass="text-danger" Visible='<%# !canStartNew %>' Text='<%# traduci("NewNestReqDisabled") %>' />
                    <asp:LinkButton runat="server" ID="lblDone" CssClass="btn btn-success btn-block" Visible='<%# (Eval("OrdStatus").ToString()=="1" && Eval("DrawFilePath").ToString()!="") || Eval("OrdStatus").ToString()=="2"  %>' OnClick="lblDone_Click" OnClientClick='return confirm("Confirm Item production?")'><i class="fa fa-check" aria-hidden="true"></i> <%: traduci ("ItemDone") %></asp:LinkButton>
                </div>
            </div>
            <div class="row">
                <div class="col">
                    <uc1:cmp_OOLI_detail runat="server" ID="cmp_OOLI_detail" OffOrdId='<%# Eval("OrdID") %>' />
                </div>
            </div>
        </ItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByKey" TypeName="AppData.DS_AppTableAdapters.OfflineOrderListTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="hfOffOrderId" DefaultValue="0" Name="OrdId" PropertyName="Value" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:HiddenField runat="server" ID="hfOffOrderId" />
</div>
