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



<h4>
    <asp:Label runat="server" ID="lblTitle"><%: traduci("ScheduledKitReq") %></asp:Label></h4>
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="PackListID" DataSourceID="odsKit" Width="100%" CssClass="table table-striped table-sm" OnSelectedIndexChanged="grView_SelectedIndexChanged">
    <HeaderStyle CssClass="default" />
    <PagerStyle CssClass="active GridPager" />
    <PagerSettings Mode="NumericFirstLast" />
    <SelectedRowStyle CssClass="table-info" />
    <EmptyDataTemplate>
        <%# traduci("NoKitReq") %>
    </EmptyDataTemplate>
    <Columns>
        <asp:TemplateField ShowHeader="False" ItemStyle-Width="2em">
            <HeaderTemplate>
                <div class="text-left">
                    <asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible='<%# showFull %>' ToolTip="Reset"><i class="fa fa-refresh"></i></asp:LinkButton>
                </div>
            </HeaderTemplate>
            <ItemTemplate>
                <div class="text-left">
                    <asp:LinkButton ID="lbtSelect" runat="server" CausesValidation="False" CommandName="Select" CssClass="btn btn-sm btn-info" Visible='<%# showFull %>'><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
                </div>
            </ItemTemplate>

            <ItemStyle Width="2em"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="#" SortExpression="PackListID" ItemStyle-Width="5em">
            <ItemTemplate>
                <asp:Label ID="lblPackListID" runat="server" Text='<%# Bind("PackListID") %>'></asp:Label>
                <asp:HyperLink ID="hlShowMissing" runat="server" Target="_blank" NavigateUrl='<%# $"~/site/PartMIA?PLID={Eval("PackListID")}" %>' CssClass="btn btn-sm btn-warning" ToolTip='<%# traduci("PartMIA") %>' Visible='<%# showFull %>'><i class="fa fa-bug" aria-hidden="true"></i></asp:HyperLink>
            </ItemTemplate>

            <ItemStyle Width="5em"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Priority" SortExpression="SchedPrior" ItemStyle-Width="8em">
            <ItemTemplate>
                <asp:LinkButton ID="lbtStartJob" runat="server" CommandArgument='<%# Eval("PackListID") %>' CssClass="btn btn-sm btn-success" OnClick="lbtStartJob_Click" Visible='<%# checkStartEnabled("first", Eval("SchedPrior")) %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("RetConfStartKit") %>'><i class="fa fa-play" aria-hidden="true"></i></asp:LinkButton>
                <asp:Label ID="lblPlaceholder" runat="server" Visible='<%# !checkVisible("first", Eval("SchedPrior")) && !checkStartEnabled("first", Eval("SchedPrior")) %>' Text="" Width="2em" />
                <asp:LinkButton ID="lbtUp" runat="server" CommandArgument='<%# Eval("PackListID") %>' CssClass="btn btn-sm btn-primary" OnClick="lbtUp_Click" Enabled='<%# checkVisible("first", Eval("SchedPrior")) %>' Visible='<%# checkVisible("first", Eval("SchedPrior")) && !checkStartEnabled("first", Eval("SchedPrior")) %>'><i class="fa fa-arrow-up" aria-hidden="true"></i></asp:LinkButton>
                <asp:Label ID="lblSchedPrior" runat="server" Text='<%# Eval("SchedPrior") %>' CssClass="text-center" Width="2em"></asp:Label>
                <asp:LinkButton ID="lbtDown" runat="server" CommandArgument='<%# Eval("PackListID") %>' CssClass="btn btn-sm btn-primary" OnClick="lbtDown_Click" Visible='<%# checkVisible("last", Eval("SchedPrior")) %>'><i class="fa fa-arrow-down" aria-hidden="true"></i></asp:LinkButton>
            </ItemTemplate>

            <ItemStyle Width="8em"></ItemStyle>
        </asp:TemplateField>
        <asp:BoundField DataField="BatchName" HeaderText="Req Date" SortExpression="Name" />
        <asp:BoundField DataField="StatusDesc" HeaderText="Status" ReadOnly="True" SortExpression="StatusDesc" />
        <asp:BoundField DataField="NumCart" HeaderText="Cart #" SortExpression="NumCart" />
        <asp:TemplateField SortExpression="NumKit">
            <HeaderTemplate>
                <asp:Label ID="NKLabel" runat="server" Text='<%# traduci("NumKit") %>' />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label ID="NumKitLabel" runat="server" Text='<%# Eval("NumKit") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField SortExpression="NumParts">
            <HeaderTemplate>
                <asp:Label ID="PartsNumLabel" runat="server" Text='<%# traduci("NumParts") %>' Visible='<%# showFull %>' />
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label ID="NumPartsLabel" runat="server" Text='<%# Eval("NumParts") %>' Visible='<%# showFull %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Tot Qty #" SortExpression="TotQty">
            <HeaderTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# traduci("RatioReadTot") %>' Visible='<%# showFull %>' />
            </HeaderTemplate>
            <ItemTemplate>
                <b>
                    <asp:Label ID="TotConfLabel" runat="server" Text='<%# Eval("TotConf") %>' Visible='<%# showFull %>' /></b> /
                <asp:Label ID="TotQtyLabel" runat="server" Text='<%# Eval("TotQty") %>' Visible='<%# showFull %>' />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

<asp:ObjectDataSource ID="odsKit" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getToSchedule" TypeName="AppData.DS_AppTableAdapters.PackListTableAdapter"></asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfNumRows" Value="0" />
<asp:HiddenField runat="server" ID="hfShowFull" Value="false" />
<uc1:cmp_KR_cart runat="server" ID="cmp_KR_cart" showFull="true" />
