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


<asp:HiddenField runat="server" ID="hfTitleClass" />

<div class="card text-center mb-2" style="width: 100%;">
    <h5 class="card-header bg-secondary text-light">
        <asp:Label runat="server" ID="lblTitle"></asp:Label>
    </h5>
    <div class="card-body py-1">
        <div class="row">
            <div class="col-12 px-0">
                <asp:GridView runat="server" ID="grView" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="BinID" DataSourceID="ods" CssClass="table table-striped table-sm table-borderless" BorderWidth="0px">
                    <HeaderStyle CssClass="default" />
                    <PagerStyle CssClass="active GridPager" />
                    <PagerSettings Mode="NumericFirstLast" />
                    <SelectedRowStyle CssClass="table-info" />
                    <EmptyDataTemplate>
                        <%: traduci("NoRecord") %>
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField ShowHeader="false" SortExpression="BatchID">
                            <ItemTemplate>
                                <b>
                                    <asp:Label ID="lblBatchID" runat="server" Text='<%# Eval("BatchID") %>' Visible='<%# hfShowBatch.Value.ToLower()=="true" %>' /></b>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Cod" SortExpression="BinDtmx">
                            <ItemTemplate>
                                <asp:Image runat="server" Height='<%# qrSize %>' Visible='<%# hfShowQr.Value.ToLower()=="true" %>' ImageUrl='<%# getImgUrl(Eval("BinDtmx")) %>' />
                                <b>
                                    <asp:Label ID="lblBinIndex" runat="server" Text='<%# Eval("BinIndex","B{0}") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' /></b>
                                <asp:Label ID="lblBinDtmx" runat="server" Visible='<%# hfShowQr.Value.ToLower()=="true" %>' Text='<%# Eval("BinDtmx") %>' CssClass="small" />
                                <span class="small">
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("BinDtmx") %>' CssClass="small" Visible='<%# hfShowBinDtmx.Value.ToLower()=="true" %>' /></span>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="D/T" SortExpression="TotItem">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("TotItemLoad") +"/" + Eval("TotItem") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="%" SortExpression="TotItemLoad">
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# getRatio(Eval("TotItemLoad"),Eval("TotItem")).ToString("P1") %>' CssClass='<%# getCssByRatio(getRatio(Eval("TotItemLoad"),Eval("TotItem"))) %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getByStatus" TypeName="AppData.DS_AppTableAdapters.BinsTableAdapter">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="True" Name="Fillup" Type="Boolean" />
                        <asp:ControlParameter ControlID="hfShowComplete" DefaultValue="false" Name="Complete" PropertyName="Value" Type="Boolean" />
                        <asp:ControlParameter ControlID="hfShowPainted" DefaultValue="false" Name="Painted" PropertyName="Value" Type="Boolean" />
                        <asp:Parameter DefaultValue="False" Name="OnKitStation" Type="Boolean" />
                    </SelectParameters>
                </asp:ObjectDataSource>
                <asp:HiddenField ID="hfBatchID" runat="server" />
                <asp:HiddenField ID="hfShowQr" runat="server" Value="false" />
                <asp:HiddenField ID="hfShowBatch" runat="server" Value="false" />
                <asp:HiddenField ID="hfShowBinDtmx" runat="server" Value="false" />
                <asp:HiddenField ID="hfQrSize" runat="server" Value="32" />
                <asp:HiddenField ID="hwShowFillup" runat="server" Value="1" />
                <asp:HiddenField ID="hfShowComplete" runat="server" Value="false" />
                <asp:HiddenField ID="hfShowPainted" runat="server" Value="false" />
            </div>
        </div>
    </div>
</div>
