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

<asp:HiddenField runat="server" ID="hfTask" />
<asp:GridView runat="server" ID="grView" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="PackListID" CssClass="table table-striped table-sm" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowDeleted="grView_RowDeleted">
    <HeaderStyle CssClass="default" />
    <PagerStyle CssClass="active GridPager" />
    <PagerSettings Mode="NumericFirstLast" />
    <SelectedRowStyle CssClass="table-info" />
    <Columns>
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <div class="text-center">
                    <asp:LinkButton ID="lbtCheck" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="Appr" OnClick="lbtCheck_Click" Text="Select" CssClass="btn btn-sm btn-success" Visible='<%# Eval("StatusID").ToString()=="1" %>' OnClientClick='return confirm("Confirm and send to KIT station?")' ToolTip="Approve Request"><i class="fa fa-check" aria-hidden="true"></i></asp:LinkButton>
                </div>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="PackListID" HeaderText="#" ReadOnly="True" SortExpression="PackListID" />
        <asp:BoundField DataField="StatusDesc" HeaderText="Status" ReadOnly="True" SortExpression="StatusDesc" />
        <asp:BoundField DataField="BatchName" HeaderText="Name" SortExpression="BatchName" />
        <asp:BoundField DataField="ImportDate" HeaderText="Import Date" SortExpression="ImportDate" />
        <asp:BoundField DataField="NumKit" HeaderText="Kit #" SortExpression="NumKit" />
        <asp:BoundField DataField="NumParts" HeaderText="Parts #" SortExpression="NumParts" />
        <asp:BoundField DataField="TotQty" HeaderText="Tot Qty #" SortExpression="TotQty" />
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <div class="text-center">
                    <asp:LinkButton ID="lbtDelete" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete" CssClass="btn btn-sm btn-danger" Visible='<%# Eval("StatusID").ToString()=="1" %>' OnClientClick='return confirm("Confirm Delete of Task?")' ToolTip="Delete"><i class="fa fa-trash" aria-hidden="true"></i></asp:LinkButton>
                    <asp:LinkButton ID="lbtRemove" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="Remove" OnClick="lbtRemove_Click" Text="Select" CssClass="btn btn-sm btn-warning" Visible='<%# Eval("StatusID").ToString()=="4" %>' OnClientClick='return confirm("Confirm KIT expedited?")' ToolTip="Remove"><i class="fa fa-truck" aria-hidden="true"></i></asp:LinkButton>
                </div>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>

</asp:GridView>
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="getActive" DeleteMethod="deleteAll" TypeName="AppData.DS_AppTableAdapters.PackListTableAdapter">
    <DeleteParameters>
        <asp:Parameter Name="Original_PackListID" Type="Int32" />
    </DeleteParameters>
</asp:ObjectDataSource>
