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

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

    <asp:FormView ID="frmView" runat="server" DataSourceID="ods" DataKeyNames="ItemID" 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") %>' />
                    <asp:Label ID="ItemQtyLabel" runat="server" Text='<%# Eval("ItemQty"," x {0}") %>' CssClass="font-weight-bold" />
                </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("Cart") %>
                    <asp:Label ID="CartDtmxLabel" runat="server" Text='<%# $"<b>C{Eval("CartIndex")}</b> {Eval("CartDtmx")}" %>' />
                </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:Image runat="server" ID="imgPart" CssClass="img-fluid" ImageUrl='<%# $"~/PartsImg/{Eval("ItemExtCode")}.png" %>' />
                </div>
            </div>
            <div class="row my-2">
                <div class="col-12">
                    <asp:LinkButton ID="lbtSetScrap" runat="server" CausesValidation="False" CommandArgument='<%# Eval("ItemID") %>' CommandName="Select" CssClass="btn btn-lg btn-block btn-danger" OnClientClick='<%# SteamWare.jsUtils.getCBE("ConfirmSendScrap") %>' OnClick="lbtSetScrap_Click"><%# traduci("SetScrap") %> <i class="fa fa-recycle" aria-hidden="true"></i></asp:LinkButton>
                </div>
            </div>
        </ItemTemplate>
    </asp:FormView>
    <asp:HiddenField runat="server" ID="hfImgBasePath" />
    <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="AppData.DS_AppTableAdapters.ItemSearchDetailTableAdapter">
        <SelectParameters>
            <asp:ControlParameter ControlID="hfItemDtmx" DefaultValue="#" Name="ItemDtmx" PropertyName="Value" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:HiddenField runat="server" ID="hfItemDtmx" />
</div>
