<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_statoMagLogico.ascx.cs"
    Inherits="GMW.WebUserControls.mod_statoMagLogico" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
<%@ Register Src="mod_barPlot.ascx" TagName="mod_barPlot" TagPrefix="uc2" %>
<div class="filtro_1">
    <uc1:mod_filtro ID="mod_filtroMag" runat="server" />
    <asp:ObjectDataSource ID="odsFiltroMag" runat="server" OldValuesParameterFormatString="Original_{0}"
        SelectMethod="getByConditio" TypeName="GMW_data.DS_UtilityTableAdapters.v_selMagLogicoTableAdapter">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="MM" Name="conditio" SessionField="CodCS" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</div>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
    OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
    DataKeyNames="IdxBlocco,CodMagLogico" DataSourceID="ods" OnPageIndexChanged="grView_PageIndexChanged"
    OnSorted="grView_Sorted">
    <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:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
                    ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="#" SortExpression="CodMagLogico">
            <ItemTemplate>
                <asp:Label ID="lblCodMagLogico" runat="server" Text='<%# Eval("CodMagLogico") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="DescMagLogico" SortExpression="DescMagLogico">
            <ItemTemplate>
                <asp:Label ID="lblDescMagLogico" runat="server" Text='<%# Eval("DescMagLogico") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="CodMag" SortExpression="CodMag">
            <ItemTemplate>
                <asp:Label ID="lblCodMag" runat="server" Text='<%# Eval("CodMag") %>' />
            </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="NumUDC" SortExpression="CelleOccupate">
            <ItemTemplate>
                <uc2:mod_barPlot ID="mod_barPlot2" runat="server" elencoValori='<%# getElencoValori("celleOccupate", Eval("CelleOccupate"), Eval("CelleOccupate")) %>'
                    resolution="1" />
                <div class="didascalia">
                    <asp:Label ID="lblCelleOccupate" runat="server" Text='<%# Eval("CelleOccupate") %>'
                        ToolTip='<%# traduci("CelleOccupate") %>' />
                </div>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="DateRange" SortExpression="Oldest">
            <ItemTemplate>
                <div style="font-size: smaller;">
                    <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" TypeName="GMW_data.DS_magazzinoTableAdapters.V_MagazziniLogiciOverviewTableAdapter">
    <SelectParameters>
        <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    </SelectParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&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:ControlParameter Name="CodMagLogico" Type="String" ControlID="mod_filtroMag"
            PropertyName="valore" DefaultValue="MM" />
    </SelectParameters>
</asp:ObjectDataSource>
