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


<div class="card">
    <div class="card-header text-center bg-warning">
        <h4><%: traduci("ScrapList") %></h4>
    </div>
    <div class="card-body">
        <asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="ItemID" DataSourceID="ods" AllowPaging="True" CssClass="table table-sm table-condensed table-striped" AllowSorting="true">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox runat="server" ID="chkToggle" AutoPostBack="True" OnCheckedChanged="chkToggle_CheckedChanged" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="chkSelected" Visible='<%# Eval("StatusID").ToString()=="990" %>' />
                        <asp:HiddenField runat="server" ID="hfItemID" Value='<%# Eval("ItemID") %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mat" SortExpression="MatID">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblMatId" Text='<%# matByKey(Eval("MatID")) %>' CssClass='<%# cssByStatus(Eval("StatusID")) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Code" SortExpression="ItemExtCode">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("ItemExtCode") %>' CssClass='<%# cssByStatus(Eval("StatusID")) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Desc" SortExpression="ItemDesc">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ItemDesc") %>' CssClass='<%# cssByStatus(Eval("StatusID")) %>' />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByStatus" TypeName="AppData.DS_AppTableAdapters.ItemListTableAdapter">
            <SelectParameters>
                <asp:Parameter DefaultValue="990" Name="minStatus" Type="Int32" />
                <asp:Parameter DefaultValue="999" Name="maxStatus" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:LinkButton runat="server" ID="lbtCreateOffOrd" CssClass="btn btn-outline-success btn-block" OnClick="lbtCreateOffOrd_Click" OnClientClick='return confirm("Confirm create order fo selected items?")'><%: traduci("CreateOrder") %> <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></asp:LinkButton>
    </div>
    <div class="card-footer">
        <uc1:mod_righePag runat="server" ID="mod_righePag" />
    </div>
</div>
