<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_assegnaNC.ascx.cs" Inherits="GMW.WebUserControls.mod_assegnaNC" %>
<%@ 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="min-height: 108px;">
    <div class="col-1">
        <div class="shortcuts">
            <asp:HiddenField runat="server" ID="hfModFilEnab" />
            <asp:LinkButton ID="lbEdit" runat="server" class="shortcut" CausesValidation="False" ToolTip="Edit Filter" OnClick="lbEdit_Click">
                <i runat="server" id="icnEdit" class="fa fa-edit fa-2x shortcut-icon"></i>
                <span class="shortcut-label">
                    <asp:Label runat="server" ID="lblEditFilt"></asp:Label></span>
            </asp:LinkButton>
        </div>
    </div>
    <div class="col-4">
        <uc1:mod_selPeriodo runat="server" ID="mod_selPeriodo" mostraSelOra="true" />
    </div>
    <div class="col-3 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" />
        <asp:ObjectDataSource runat="server" ID="odsTipoUdc" OldValuesParameterFormatString="original_{0}" SelectMethod="getBilanceNC" TypeName="GMW_data.DS_ApplicazioneTableAdapters.AnagBilanceTableAdapter"></asp:ObjectDataSource>
        <br />
        <asp:Label runat="server" ID="lblSelPart"><%: traduci("lblSelPart") %></asp:Label>
        <asp:DropDownList runat="server" ID="ddlSelPart" DataSourceID="odsSelPart" DataValueField="Particolare" DataTextField="Particolare" AutoPostBack="True" OnSelectedIndexChanged="ddlSelPart_SelectedIndexChanged" AppendDataBoundItems="true">
            <asp:ListItem Text="-- Tutti --" Value="*" Selected="True"></asp:ListItem>
        </asp:DropDownList>
        <asp:ObjectDataSource runat="server" ID="odsSelPart" OldValuesParameterFormatString="original_{0}" SelectMethod="getNcByCsFlusso" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagParticolariTableAdapter">
            <SelectParameters>
                <asp:SessionParameter Name="CodCS" SessionField="CodCS" Type="String" />
                <asp:ControlParameter ControlID="ddlSelTipo" Name="Flusso" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:ObjectDataSource>

    </div>
    <div class="col-3" style="font-size: 0.8em;">
        <asp:TextBox runat="server" ID="txtSearch" placeholder="ricerca note / linee" Width="100%" AutoPostBack="True" OnTextChanged="txtSearch_TextChanged" />
    </div>
    <div class="col-1" style="font-size: 0.8em;">
        <div class="shortcuts">
            <asp:LinkButton runat="server" ID="lbSave" Visible="false" CssClass="shortcut" OnClick="lbSave_Click">
            <i class="fa fa-floppy-o fa-2x shortcut-icon"></i>
            <span class="shortcut-label"><%: traduci("btnSave") %></span>
            </asp:LinkButton>
        </div>
    </div>
</div>
<div class="row text-center" style="background-color: #EEEEEE;">
    <div class="col-12" style="padding: 2px 0px;">
        <div class="col-4">
            <asp:LinkButton runat="server" ID="lbSaveSel" Visible="false" CssClass="btn btn-warning" OnClick="lbSaveSel_Click" Width="45%"><i class="fa fa-check fa-2x"></i> <%: traduci("btnSaveSelUdc") %></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-4">
            <asp:LinkButton runat="server" ID="lbConfermaNC" Visible="false" CssClass="btn btn-success" OnClick="lbConfermaNC_Click" Width="20em"><i class="fa fa-bookmark fa-2x"></i> <%: traduci("btnConfermaNC") %></asp:LinkButton>
            <asp:LinkButton runat="server" ID="lbPrint" Visible="false" CssClass="btn btn-primary" OnClick="lbPrint_Click" Width="20em"><i class="fa fa-print fa-2x"></i> <%: traduci("btnRistampaNC") %></asp:LinkButton>
        </div>
        <div class="col-2">
            <asp:Label runat="server" ID="lblNumUdcAnc" />
            <br />
            <asp:Label runat="server" ID="lblNumUdcChild" />
        </div>
        <div class="col-2">
            <asp:LinkButton runat="server" ID="lbShowUNC" CssClass="btn btn-default" OnClick="lbShowUNC_Click" Width="100%"><i class="fa fa-newspaper-o fa-2x"></i> <%: traduci("lbShowHideUNC") %></asp:LinkButton>
        </div>
    </div>
    <div class="col-12">
        <div class="col-10">
            <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" Enabled='<%# editEnabled %>' />
                        </ItemTemplate>
                        <HeaderTemplate>
                            <asp:CheckBox ID="btnSelAll" runat="server" Checked="false" ToolTip='<%# traduci("btnSelAll") %>'
                                OnCheckedChanged="btnSelAll_Click" CssClass="ctrHeaderPager" AutoPostBack="true" Enabled='<%# editEnabled %>'></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="DecodPosizione" HeaderText="Posizione" SortExpression="DecodPosizione" />
                    <asp:BoundField DataField="NC" HeaderText="NC ass." SortExpression="NC" />
                    <asp:BoundField DataField="Note" HeaderText="Note" SortExpression="Note" />
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByFlussoDate" TypeName="GMW_data.DS_ApplicazioneTableAdapters.UDC_NCTableAdapter">
                <SelectParameters>
                    <asp:SessionParameter Name="CodCS" SessionField="CodCS" Type="String" />
                    <asp:ControlParameter ControlID="ddlSelTipo" Name="Flusso" PropertyName="SelectedValue" Type="String" />
                    <asp:ControlParameter ControlID="ddlSelPart" Name="Particolare" PropertyName="SelectedValue" Type="String" DefaultValue="*" />
                    <asp:SessionParameter Name="DataFrom" SessionField="_inizio" Type="DateTime" />
                    <asp:SessionParameter Name="DataTo" SessionField="_fine" Type="DateTime" />
                    <asp:SessionParameter Name="Note" SessionField="NoteNC" Type="String" />
                    <asp:QueryStringParameter Name="idxNc" QueryStringField="idxNC" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
        </div>
        <div class="col-2">
            <uc1:mod_elencoUNC runat="server" ID="mod_elencoUNC" Visible="false" />
        </div>
    </div>
</div>
