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

<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
<%@ Register Src="mod_barPlot.ascx" TagName="mod_barPlot" TagPrefix="uc2" %>

<div class="container-fluid">
  <div class="row">
    <div class="col-sm-3">
    </div>
    <div class="col-sm-6 col-sm-offset-3">
      <div class="input-group mb-3">
        <div class="input-group-prepend">
          <span class="input-group-text">
            <asp:Label runat="server" ID="lblCercaPart" /></span>
        </div>
        <asp:TextBox ID="txtCercaPart" runat="server" OnTextChanged="txtCercaPart_TextChanged" Text="*"
          CssClass="form-control" />
        <div class="input-group-append">
          <asp:Button ID="btnCercaPart" CssClass="input-group-text" runat="server" OnClick="btnCercaPart_Click" Text="..." />
        </div>
      </div>
    </div>
  </div>
  <div class="row">
    <div class="col-sm-12">
      <asp:GridView ID="grView" runat="server" AllowPaging="False" AllowSorting="True" AutoGenerateColumns="False"
        OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
        DataKeyNames="IdxBlocco" 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" />
        <Columns>
          <asp:TemplateField ShowHeader="False">
            <HeaderTemplate>
              <asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click"
                Visible="false" />
            </HeaderTemplate>
            <ItemTemplate>
              <asp:LinkButton ID="btnSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>' CssClass="btn btn-default btn-sm btn-block p-0" Visible="true"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="#" SortExpression="CodMag">
            <ItemTemplate>
              <asp:Label ID="lblCodMag" runat="server" Text='<%# Eval("CodMag") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="DescMag" SortExpression="DescMag">
            <ItemTemplate>
              <asp:Label ID="lblDescMag" runat="server" Text='<%# Eval("DescMag") %>' />
              <div class="didascalia">
                <asp:Label ID="lblDescBlocco" runat="server" Text='<%# Eval("DescBlocco") %>' />
              </div>
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="CodBlocco" SortExpression="CodBlocco">
            <ItemTemplate>
              <asp:Label ID="lblCodBlocco" runat="server" Text='<%# Eval("CodBlocco") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="CelleTotAtt" SortExpression="TotCelle">
            <ItemTemplate>
              <uc2:mod_barPlot ID="mod_barPlot1" runat="server" elencoValori='<%# getElencoValori("numCelle", Eval("TotCelle"), Eval("CelleAttive")) %>'
                resolution="5" />
              <div class="didascalia">
                <asp:Label ID="lblTotCelle" runat="server" Text='<%# Eval("TotCelle") %>' ToolTip='<%# traduci("TotCelle") %>' />
                /
                        <asp:Label ID="lblCelleAttive" runat="server" Text='<%# Eval("CelleAttive") %>' ToolTip='<%# traduci("CelleAttive") %>' />
              </div>
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="CelleLibereOccupate" SortExpression="CelleLibere">
            <ItemTemplate>
              <uc2:mod_barPlot ID="mod_barPlot2" runat="server" elencoValori='<%# getElencoValori("celleOccupate", Eval("CelleAttive"), Eval("CelleOccupate")) %>'
                resolution="5" />
              <div class="didascalia">
                <asp:Label ID="lblCelleOccupate" runat="server" Text='<%# Eval("CelleOccupate") %>'
                  ToolTip='<%# traduci("CelleOccupate") %>' />
                /
                        <asp:Label ID="lblCelleLibere" runat="server" Text='<%# Eval("CelleLibere") %>' ToolTip='<%# traduci("CelleLibere") %>' />
              </div>
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="DateRange" SortExpression="Oldest">
            <ItemTemplate>
              <div style="font-size: smaller; white-space: nowrap;">
                <asp:Label ID="lblOldest" runat="server" Text='<%# Eval("Oldest","{0:dd/MM/yy}") %>' />
                -->
                        <asp:Label ID="lblNewest" runat="server" Text='<%# Eval("Newest","{0:dd/MM/yy}") %>' />
              </div>
            </ItemTemplate>
          </asp:TemplateField>
        </Columns>
      </asp:GridView>
      <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="getByCodCS_particolare" TypeName="GMW_data.DS_magazzinoTableAdapters.V_MagazziniOverviewTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
          <asp:ControlParameter ControlID="txtCercaPart" DefaultValue="*" Type="String" Name="particolare" />
        </SelectParameters>
      </asp:ObjectDataSource>
      <asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
      <asp:ObjectDataSource ID="odsBlocco" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectMethod="getByConditio" TypeName="GMW_data.DS_UtilityTableAdapters.v_selBloccoTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
          <asp:SessionParameter Name="CodMag" Type="String" SessionField="CodMag_sel" DefaultValue="MM" />
        </SelectParameters>
      </asp:ObjectDataSource>
    </div>
  </div>
</div>
