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

<div class="row">
  <div class="col-sm-4">
    <div class="card bg-primary text-light small">
      <div class="card-header">
        <b>
          <asp:Label runat="server" ID="lblUdcParent"></asp:Label></b>
      </div>
      <div class="card-body bg-light text-dark">
        <div class="row">
          <div class="col-12" style="font-size: 0.8em;">
            <asp:GridView ID="grView" runat="server" AllowPaging="false" AllowSorting="True" AutoGenerateColumns="False" OnDataBound="grView_DataBound" DataKeyNames="UDC" DataSourceID="ods" OnPageIndexChanged="grView_PageIndexChanged" OnSorted="grView_Sorted" Width="100%">
              <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 HeaderText="lastMov" SortExpression="lastMov" ItemStyle-Wrap="false">
                  <ItemTemplate>
                    <asp:Label ID="lbllastMov" runat="server" Text='<%# Eval("lastMov", "{0:dd/MM HH:mm}") %>' />
                  </ItemTemplate>
                  <ItemStyle Wrap="False" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="UDC" SortExpression="UDC">
                  <ItemTemplate>
                    <asp:Label ID="lblUDC" runat="server" Text='<%# Eval("UDC") %>' Font-Strikeout='<%# isExcluded(Eval("lastMov")) %>' />
                  </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Particolare" SortExpression="Particolare">
                  <ItemTemplate>
                    <asp:Label ID="lblParticolare" runat="server" Text='<%# Eval("Particolare") %>' />
                  </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Qta" SortExpression="Qta" ItemStyle-HorizontalAlign="Right">
                  <ItemTemplate>
                    <asp:Label ID="lblQta" runat="server" Text='<%# Eval("Qta","{0:#}") %>' />
                  </ItemTemplate>
                  <ItemStyle HorizontalAlign="Right" />
                </asp:TemplateField>
              </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
              SelectMethod="getByCodBlocco" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter"
              OnDataBinding="ods_DataBinding" FilterExpression="UDC LIKE '%{0}%' OR PARTICOLARE LIKE '%{0}%'">
              <SelectParameters>
                <asp:SessionParameter Name="CodBlocco" Type="String" SessionField="CodBloccoLineaLFM_OUT" DefaultValue="0" />
              </SelectParameters>
              <FilterParameters>
                <asp:SessionParameter Name="search" Type="String" SessionField="valoreCercatoLMO"
                  DefaultValue="0" />
              </FilterParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="odsSpec" runat="server" OldValuesParameterFormatString="original_{0}"
              SelectMethod="getByCodBloccoPeriodoMult" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter"
              OnDataBinding="ods_DataBinding" FilterExpression="UDC LIKE '%{0}%' OR PARTICOLARE LIKE '%{0}%'">
              <SelectParameters>
                <asp:SessionParameter Name="CodCS" SessionField="CodCS" Type="String" />
                <asp:SessionParameter Name="CodBlocco" Type="String" SessionField="CodBloccoLineaLFM_OUT" DefaultValue="0" />
                <asp:ControlParameter ControlID="hfCurrPart" Name="Particolare" PropertyName="Value" Type="String" />
                <asp:ControlParameter ControlID="hfMinDt" Name="MinData" PropertyName="Value" Type="DateTime" />
                <asp:ControlParameter ControlID="hfMaxDt" Name="MaxData" PropertyName="Value" Type="DateTime" />
                <asp:ControlParameter ControlID="hfNum4Cell" Name="Num4Cell" PropertyName="Value" Type="Int32" />
              </SelectParameters>
              <FilterParameters>
                <asp:SessionParameter Name="search" Type="String" SessionField="valoreCercatoLMO"
                  DefaultValue="0" />
              </FilterParameters>
            </asp:ObjectDataSource>
            <asp:HiddenField runat="server" ID="hfCurrPart" />
            <asp:HiddenField runat="server" ID="hfMinDt" />
            <asp:HiddenField runat="server" ID="hfMaxDt" />
            <asp:HiddenField runat="server" ID="hfNum4Cell" />
            <asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="col-sm-4">
    <div>
      <asp:Label runat="server" ID="lblParticolareAttivo" Font-Size="3em" Text="" />
    </div>
    <div>
      <asp:Label runat="server" ID="lblDescrAttivo" Font-Size="2em" Text="" ToolTip="particolare" />
      <br />
      <asp:Label runat="server" ID="lblDisegno" Font-Size="1.8em" Text="" ForeColor="#FFFFFF" Font-Bold="true" ToolTip="disegno" />
    </div>
    <div>
      <asp:Label runat="server" ID="lblBarcode" Text="Barcode" />
      <br />
      <asp:TextBox runat="server" ID="txtBarcode" Height="1.2em" Width="100%" Font-Size="3em" AutoPostBack="True" Style="text-align: center" TabIndex="0" />
    </div>
    <div id="divNote" runat="server">
      <div>
        <%: traduci("Note") %>
      </div>
      <div>
        <asp:TextBox runat="server" ID="txtNote" Height="4em" Width="100%" Font-Size="2em" TextMode="MultiLine" TabIndex="2" />
        <asp:Button runat="server" ID="btnEmptyNote" Height="3em" Width="100%" OnClick="btnEmptyNote_Click" TabIndex="3" CssClass="btn btn-default" />
      </div>
      <div style="padding: 4px 0px;">
        <asp:LinkButton runat="server" ID="lbtStampaUDC" Width="100%" CssClass="btn btn-warning btn-lg" TabIndex="4" OnClick="btnStampa_Click"><i aria-hidden='true' class='fa fa-print fa-2x'></i> <%: traduci("btnStampaUdc") %></asp:LinkButton>
      </div>
    </div>
  </div>
  <div class="col-sm-4">
    <div class="card bg-primary text-light small">
      <div class="card-header">
        <b><%: traduci("Qta") %></b>
      </div>
      <div class="card-body bg-light text-dark">
        <asp:TextBox runat="server" ID="txtQta" Height="1.2em" Width="100%" Font-Size="3em" Style="text-align: center" TabIndex="6" AutoPostBack="True" />
      </div>
    </div>
    <div class="card bg-primary text-light small">
      <div class="card-header">
        <b><%: traduci("CodImballo") %></b>
      </div>
      <div class="card-body bg-light text-dark">
        <div class="row">
          <div class="col-sm-3">
            <asp:LinkButton runat="server" ID="lbtShowAllImb" CssClass="btn btn-info btn-block" OnClick="lbtShowAllImb_Click" Visible="true"><i class="fa fa-list"></i> TUTTI</asp:LinkButton>
            <asp:LinkButton runat="server" ID="lbtShowLastImb" CssClass="btn btn-default btn-block" OnClick="lbtShowLastImb_Click" Visible="false"><i class="fa fa-list-ol"></i> ULTIMI</asp:LinkButton>
            <asp:Label runat="server" ID="lblPart" />
          </div>
          <div class="col-sm-9">
            <asp:HiddenField runat="server" ID="hfCodStato" Value="Fin" />
            <asp:HiddenField runat="server" ID="hfNumLast" Value="3" />
            <asp:DropDownList runat="server" ID="ddlImballi" DataSourceID="odsImballi" DataTextField="value" DataValueField="value" OnDataBound="ddlImballi_DataBound" Font-Size="2em" OnSelectedIndexChanged="ddlImballi_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList>
            <asp:ObjectDataSource runat="server" ID="odsImballi" OldValuesParameterFormatString="original_{0}" SelectMethod="getByPartLastUsed" TypeName="GMW_data.DS_UtilityTableAdapters.v_selImballiTableAdapter">
              <SelectParameters>
                <asp:ControlParameter ControlID="lblPart" PropertyName="Text" Name="Particolare" Type="String" DefaultValue="" />
                <asp:ControlParameter ControlID="hfCodStato" PropertyName="Value" Name="CodStato" Type="String" DefaultValue="Fin" />
                <asp:ControlParameter ControlID="hfNumLast" PropertyName="Value" Name="numLast" Type="Int32" DefaultValue="3" />
              </SelectParameters>
            </asp:ObjectDataSource>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
