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

<div class=" border border-success rounded table-success">

    <asp:FormView ID="frmView" runat="server" DataSourceID="ods" DataKeyNames="BinID" Width="100%">
        <ItemTemplate>

            <div class="row text-center" style="font-size: 1.5em;">
                <div class="col-md-2">
                    <asp:Label ID="ItemExtCodeLabel" runat="server" CssClass="font-weight-bold" Text='<%# Eval("ItemExtCode") %>' />
                </div>
                <div class="col-md-8 textCondens">
                    <asp:Label ID="ItemDescLabel" runat="server" Text='<%# Eval("ItemDesc") %>' />
                    | 
                    <asp:Label ID="MatDescLabel" runat="server" Text='<%# $"{Eval("MatExtCode")}: {Eval("MatDesc")}" %>' />
                </div>
                <div class="col-md-2">
                    <asp:Label ID="MatExtCodeLabel" runat="server" CssClass="font-weight-bold" Text='<%# Eval("DueDate","{0:MMM dd yyyy}") %>' />
                </div>
            </div>
            <div class="row">
                <div class="col-md-3 text-center">
                    <%: traduci("Order") %>
                    <asp:Label ID="OrderExtCodeLabel" runat="server" Text='<%# Eval("OrderExtCode") %>' />
                </div>
                <div class="col-md-3 text-center">
                    <%: traduci("Kit") %>
                    <asp:Label ID="KitExtCodeLabel" runat="server" Text='<%# Eval("KitExtCode") %>' />
                </div>
                <div class="col-md-3 text-center">
                    <%: traduci("Qty") %>
                    <asp:Label ID="ItemQtyLabel" runat="server" Text='<%# $"{Eval("TotItemLoad")}/{Eval("TotItem")}" %>' CssClass="font-weight-bold" />
                </div>
                <div class="col-md-3 text-center">
                    <%: traduci("Bin") %>
                    <asp:Label ID="BinDtmxLabel" runat="server" Text='<%# Eval("BinDtmx") %>' />
                </div>
            </div>
            <div class="row">
                <div class="col-12">
                    <asp:HyperLink runat="server" ID="hlShowDetail" Target="_blank" CssClass="btn btn-info btn-block text-light" NavigateUrl='<%# $"~/site/PartMIA?BinID={BinID}" %>'><%: traduci("BinSummary") %> <i class="fa fa-list-ol" aria-hidden="true"></i></asp:HyperLink>
                </div>
            </div>
            <div class="row" runat="server" id="divReorder" visible='<%# isPainted && (getInt(Eval("TotItem")) > 0) %>'>
                <div class="col-12">
                    <asp:LinkButton runat="server" ID="lbtReorderParts" CssClass="btn btn-danger btn-block" CommandArgument='<%# Eval("BinID") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmSendScrap") %>' ToolTip='<%# traduci("SetScrap") %>' OnClick="lbtReorderParts_Click"><%# traduci("Reorder") %> 1 <i class="fa fa-recycle" aria-hidden="true"></i></asp:LinkButton>
                </div>
            </div>
            <div class="row">
                <div class="col-12">
                    <asp:Image runat="server" ID="imgPart" CssClass="img-fluid" ImageUrl='<%# $"~/PartsImg/{Eval("ItemExtCode")}.png" %>' />
                </div>
            </div>
        </ItemTemplate>
    </asp:FormView>
    <asp:HiddenField runat="server" ID="hfImgBasePath" />
    <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByKey" TypeName="AppData.DS_AppTableAdapters.BinsTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="hfBinID" DefaultValue="#" Name="BinID" PropertyName="Value" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:HiddenField runat="server" ID="hfBinDtmx" />
    <asp:HiddenField runat="server" ID="hfBinID" />
    <asp:HiddenField runat="server" ID="hfIsPainted" />
</div>
