<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_labAssStampaUdc.ascx.cs"
  Inherits="GMW.WebUserControls.mod_labAssStampaUdc" %>
<%@ Register Src="mod_selPeriodo.ascx" TagName="mod_selPeriodo" TagPrefix="uc2" %>
<% if (false)
  { %>
<webopt:BundleReference ID="BundleReference1" runat="server" Path="~/Content/css" />
<webopt:BundleReference ID="BundleReference2" runat="server" Path="~/Content/themes/base/css" />
<% } %>

<div class="container-fluid" style="background-color: #cdcdcd; padding-top: 2px; padding-bottom: 2px;">
  <div class="container-flow">
    <div class="row">
      <div class="col-sm-9 text-left">
        <uc2:mod_selPeriodo ID="mod_selPeriodo1" runat="server" />
      </div>
      <div class="col-sm-3 text-right">
        <asp:Button runat="server" ID="btnReloadDataRQL" OnClick="btnReloadDataRQL_Click" CssClass="btn btn-default btn-sm btn-block" />
      </div>
    </div>
  </div>
</div>

<div class="container-flow" style="padding-top: 2px; padding-bottom: 2px; font-size: 8pt;">
  <div class="row">
    <div class="col-sm-6">
      <asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
        OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
        DataKeyNames="nRapQual,UdcAssoc,BenesQual,LegaScaric" DataSourceID="ods" OnPageIndexChanged="grView_PageIndexChanged"
        OnSorted="grView_Sorted" OnRowDeleting="grView_RowDeleting">
        <RowStyle CssClass="ctrRowStyle" />
        <AlternatingRowStyle CssClass="ctrAltRowStyle" />
        <EditRowStyle CssClass="ctrEditRowStyle" />
        <SelectedRowStyle CssClass="ctrSelRowStyle" />
        <FooterStyle CssClass="ctrFooter" />
        <PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
        <EmptyDataRowStyle CssClass="ctrRowStyle" />
        <EmptyDataTemplate>
          <asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
        </EmptyDataTemplate>
        <Columns>
          <asp:TemplateField ItemStyle-HorizontalAlign="Center">
            <HeaderTemplate>
              <asp:LinkButton ID="lbtReset" runat="server" OnClick="btnReset_Click" CssClass="btn btn-default btn-sm" Visible="true"><i class="fa fa-refresh"></i> <%: traduci("Reset") %></asp:LinkButton>
            </HeaderTemplate>
            <ItemTemplate>
              <%--<asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
                ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />--%>
              <asp:LinkButton ID="btnSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>' CssClass="btn btn-default btn-block p-0" Visible="true"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="nRapQual" SortExpression="nRapQual">
            <ItemTemplate>
              <asp:Label ID="lblnRapQual" runat="server" Text='<%# Eval("nRapQual") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="DataRapQual" SortExpression="DataRapQual">
            <ItemTemplate>
              <asp:Label ID="lblDataRapQual" runat="server" Text='<%# Eval("DataRapQual","{0:0000/00/00}") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="CodFor" SortExpression="CodFor">
            <ItemTemplate>
              <asp:Label ID="lblCodFor" runat="server" Text='<%# Eval("CodFor") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="CodLega" SortExpression="CodLega">
            <ItemTemplate>
              <asp:Label ID="lblCodLega" runat="server" Text='<%# Eval("CodLega") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Qta" SortExpression="Qta">
            <ItemTemplate>
              <asp:Label ID="lblQta" runat="server" Text='<%# Eval("Qta") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="BenesQual" SortExpression="BenesQual">
            <ItemTemplate>
              <asp:Label ID="lblBenesQual" runat="server" Text='<%# Eval("BenesQual") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="LegaScaric" SortExpression="LegaScaric">
            <ItemTemplate>
              <asp:Label ID="lblLegaScaric" runat="server" Text='<%# Eval("LegaScaric") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="UdcTot" SortExpression="UdcTot">
            <ItemTemplate>
              <asp:Label ID="lblUdcTot" runat="server" Text='<%# Eval("UdcTot") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="UdcAssoc" SortExpression="UdcAssoc">
            <ItemTemplate>
              <asp:Label ID="lblUdcAssoc" runat="server" Text='<%# Eval("UdcAssoc") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField>
            <ItemTemplate>
              <asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
                CommandArgument='<%# Eval("nRapQual") %>' ToolTip='<%# traduci("Delete") %>'
                Visible='<%# delEnabled(Eval("BenesQual")) %>' ImageUrl="~/images/elimina_m.png" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' />
            </ItemTemplate>
          </asp:TemplateField>
        </Columns>
      </asp:GridView>
      <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="getByDateRange" FilterExpression="nRapQual LIKE '%{0}%' OR CodFor LIKE '%{0}%' OR CodLega LIKE '%{0}%' "
        TypeName="GMW_data.DS_magazzinoTableAdapters.v_RapQualSuntoTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="DataFrom" SessionField="_inizio" Type="DateTime" />
          <asp:SessionParameter Name="DataTo" SessionField="_fine" Type="DateTime" />
        </SelectParameters>
        <FilterParameters>
          <asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
        </FilterParameters>
      </asp:ObjectDataSource>
      <asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&nbsp;
                <asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
    </div>
    <div class="col-sm-6">
      <asp:Panel runat="server" ID="pnlStampa">
        <div>
          <asp:Button runat="server" ID="btnDelibera" Width="200px" OnClick="btnDelibera_Click" />
        </div>
        <div>
          <asp:Label runat="server" ID="lblNote" />
          <br />
          <asp:TextBox runat="server" ID="txtNoteUdc" TextMode="MultiLine" Width="500px" Height="60px" />
        </div>
      </asp:Panel>
    </div>
  </div>
</div>
