<%@ 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>
                    <%--<svg width="710" height="305" viewBox='0 0 1420 710' xmlns='http://www.w3.org/2000/svg' runat="server" id="svgTable" Visible='<%# Eval("DrawFilePath").ToString() != "" %>'>
                    </svg>--%>
                </div>
                <div class="col-12">
                    <uc1:cmp_OOIL_drawings runat="server" ID="cmp_OOIL_drawings" DrawingPath='<%# Eval("DrawFilePath") %>' />
                    <asp:Label ID="DrawFilePathLabel" runat="server" Text='<%# Eval("DrawFilePath") %>' Visible="false" />
                </div>
            </div>
            <div class="row my-2">
                <div class="col">
                    <asp:LinkButton runat="server" ID="lbtMakeCnc" CssClass="btn btn-success btn-block" Visible='<%# Eval("OrdStatus").ToString()=="0" %>' OnClick="lbtMakeCnc_Click" OnClientClick='return confirm("Send to CAM?")'><i class="fa fa-laptop" aria-hidden="true"></i># <%: traduci ("MakeCncProg") %></asp:LinkButton>
                </div>
                <div class="col">
                    <%--<asp:LinkButton runat="server" ID="lbtPrintLabels" CssClass="btn btn-info btn-block" Visible='<%# Eval("OrdStatus").ToString()!="0" %>' OnClick="lbtPrintLabels_Click"><i class="fa fa-print" aria-hidden="true"></i> PRINT LABELS</asp:LinkButton>--%>
                    <%--<asp:LinkButton runat="server" ID="lblDone" CssClass="btn btn-success btn-block" Visible='<%# Eval("OrdStatus").ToString()=="2" %>' OnClick="lblDone_Click" OnClientClick='return confirm("Confirm Item production?")'><i class="fa fa-check" aria-hidden="true"></i> ITEM DONE</asp:LinkButton>--%>
                    <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>
