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

<div class="row text-center" style="margin: 0.5em; min-height: 4em;">
    <div class="col-6">
        <uc1:mod_selPeriodo runat="server" ID="mod_selPeriodo" mostraSelOra="true" />
    </div>
    <div class="col-4">
        <asp:LinkButton runat="server" ID="lbSaveSel" Visible="false" CssClass="btn btn-success" OnClick="lbSaveSel_Click" Width="45%"><i class="fa fa-check fa-2x"></i> <%: traduci("btnCheckDelibUdc") %></asp:LinkButton>
        <asp:LinkButton runat="server" ID="lbCancel" Visible="false" CssClass="btn btn-danger" OnClick="lbCancel_Click" Width="45%"><i class="fa fa-close fa-2x"></i> <%: traduci("btnCancel") %></asp:LinkButton>
    </div>
    <div class="col-2 text-right" style="font-size: 0.8em;">
        <asp:Label runat="server" ID="lblTipoUdc"><%: traduci("lblTipoUdc") %></asp:Label>
        <asp:DropDownList runat="server" ID="ddlSelTipo" DataSourceID="odsTipoUdc" DataValueField="CodBilancia" DataTextField="DescrImpianto" AutoPostBack="True" OnSelectedIndexChanged="ddlSelTipo_SelectedIndexChanged" Enabled="false" />
        <asp:ObjectDataSource runat="server" ID="odsTipoUdc" OldValuesParameterFormatString="original_{0}" SelectMethod="getBilanceNC" TypeName="GMW_data.DS_ApplicazioneTableAdapters.AnagBilanceTableAdapter"></asp:ObjectDataSource>
    </div>
</div>
<div class="row text-center" style="background-color: #EEEEEE;">
    <div class="col-12">
        <div class="col-12">
            <uc1:mod_righePag runat="server" ID="mod_righePag" />
            <asp:GridView runat="server" ID="grView" DataSourceID="ods" AutoGenerateColumns="False" DataKeyNames="UDC" Width="100%" AllowPaging="True" CssClass="table table-striped table-bordered table-condensed" AllowSorting="True">
                <HeaderStyle CssClass="default" />
                <PagerStyle CssClass="active GridPager" />
                <PagerSettings Mode="NumericFirstLast" />
                <SelectedRowStyle CssClass="info" />
                <EmptyDataTemplate>
                    <asp:Label runat="server" ID="lblNoRecord" Text="Nessun record trovato" />
                </EmptyDataTemplate>
                <Columns>
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                        <ItemTemplate>
                            <asp:CheckBox ID="chkSelect" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsSelected")) %>' AutoPostBack="true" OnCheckedChanged="chkSelect_CheckedChanged" Visible='<%# !Convert.ToBoolean(Eval("OkCL")) %>' />
                        </ItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="btnSelAll" runat="server" Checked="false" ToolTip='<%# traduci("btnSelAll") %>'
                                OnCheckedChanged="btnSelAll_Click" CssClass="ctrHeaderPager" AutoPostBack="true"></asp:CheckBox>
                        </HeaderTemplate>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="UDC" SortExpression="UDC">
                        <ItemTemplate>
                            <asp:Label ID="lblUDC" runat="server" Text='<%# Bind("UDC") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Particolare" HeaderText="Particolare" SortExpression="Particolare" />
                    <asp:BoundField DataField="DescParticolare" HeaderText="Descriz" SortExpression="DescParticolare" />
                    <asp:BoundField DataField="DataFus" HeaderText="Data" SortExpression="DataFus" />
                    <asp:BoundField DataField="Qta" HeaderText="Qta" SortExpression="Qta" />
                    <asp:BoundField DataField="CodStato" HeaderText="Stato" SortExpression="CodStato" />
                    <asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
                    <asp:BoundField DataField="DecodPosizione" HeaderText="Posizione" SortExpression="DecodPosizione" />
                    <asp:TemplateField HeaderText="Check" SortExpression="OkCL">
                        <ItemTemplate>
                            <i runat="server" id="chkCL" style="color: green;" class="fa fa-check-circle-o" visible='<%# checkVal(Eval("OkCL")) %>'></i>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="DateAttr" HeaderText="Data" SortExpression="DateAttr" DataFormatString="{0:dd/MM/yyyy HH:mm}" />
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_ApplicazioneTableAdapters.UDC_checkDLTableAdapter">
                <SelectParameters>
                    <asp:SessionParameter Name="DataFrom" SessionField="_inizio" Type="DateTime" />
                    <asp:SessionParameter Name="DataTo" SessionField="_fine" Type="DateTime" />
                    <asp:SessionParameter Name="CodCS" SessionField="CodCS" Type="String" />
                    <asp:ControlParameter ControlID="ddlSelTipo" Name="Flusso" PropertyName="SelectedValue" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
    </div>
</div>
