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


<h3>
    <asp:Label runat="server" ID="lblTitle"><%: traduci("ScheduledKitReq") %></asp:Label></h3>
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="PackListID" DataSourceID="odsKit" Width="100%" CssClass="table table-striped table-sm">
    <HeaderStyle CssClass="default" />
    <PagerStyle CssClass="active GridPager" />
    <PagerSettings Mode="NumericFirstLast" />
    <SelectedRowStyle CssClass="table-info" />
    <EmptyDataTemplate>
        <%# traduci("NoKitReq") %>
    </EmptyDataTemplate>
    <Columns>
        <asp:TemplateField HeaderText="#" SortExpression="PackListID">
            <ItemTemplate>
                <asp:Label ID="lblPackListID" runat="server" Text='<%# Bind("PackListID") %>'></asp:Label>
                <asp:LinkButton ID="lbtStartJob" runat="server" CommandArgument='<%# Eval("PackListID") %>' CssClass="btn btn-sm btn-success" OnClick="lbtStartJob_Click" visible='<%# checkStartEnabled("first", Eval("SchedPrior")) %>' OnClientClick='return confirm("Start KIT operation for selected job?")'><i class="fa fa-play" aria-hidden="true"></i></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="SchedPrior" SortExpression="SchedPrior">
            <ItemTemplate>
                <asp:LinkButton ID="lbtUp" runat="server" CommandArgument='<%# Eval("PackListID") %>' CssClass="btn btn-sm btn-primary" OnClick="lbtUp_Click" Enabled='<%# checkVisible("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="3em"></asp:Label>
                <asp:LinkButton ID="lbtDown" runat="server" CommandArgument='<%# Eval("PackListID") %>' CssClass="btn btn-sm btn-primary" OnClick="lbtDown_Click" Enabled='<%# checkVisible("last", Eval("SchedPrior")) %>'><i class="fa fa-arrow-down" aria-hidden="true"></i></asp:LinkButton>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="StatusDesc" HeaderText="StatusDesc" ReadOnly="True" SortExpression="StatusDesc" />
        <asp:BoundField DataField="BatchName" HeaderText="Name" SortExpression="Name" ItemStyle-CssClass="text-right">
<ItemStyle CssClass="text-right"></ItemStyle>
        </asp:BoundField>
        <asp:BoundField DataField="ImportDate" HeaderText="Import Date" SortExpression="ImportDate" />
        <asp:BoundField DataField="NumKit" HeaderText="Kit #" SortExpression="NumKit" />
        <asp:BoundField DataField="NumParts" HeaderText="Parts n#" SortExpression="NumParts" />
        <asp:BoundField DataField="TotQty" HeaderText="Tot Qty #" SortExpression="TotQty" />
    </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" />
