<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_manSAO.ascx.cs" Inherits="GMW.WebUserControls.mod_manSAO" %>
<%@ Register Src="mod_filtro.ascx" TagName="mod_filtro" TagPrefix="uc1" %>
<%@ Register Src="mod_selPeriodo.ascx" TagName="mod_periodoAnalisi" TagPrefix="uc2" %>
<%@ Register Src="mod_detailUDC.ascx" TagName="mod_detailUDC" TagPrefix="uc3" %>
<%@ Register Src="mod_detailUDC_storico.ascx" TagName="mod_detailUDC_storico" TagPrefix="uc4" %>
<% 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="row">
    <div class="col-6">
      <uc2:mod_periodoAnalisi ID="mod_periodoAnalisi1" runat="server" />
    </div>
    <div class="col-6 text-right">
      <asp:Label runat="server" ID="lblNumRighe" Text="righe per pagina" />:
            <asp:TextBox ID="txtNumRighe" runat="server" AutoPostBack="True" OnTextChanged="txtNumRighe_TextChanged" Width="3em" />
      &nbsp;|&nbsp; 
            <asp:HyperLink ID="hlExportExcel" runat="server" NavigateUrl="~/ExportExcel_SAO.aspx" Target="_blank" Font-Bold="true">Export Excel</asp:HyperLink>
    </div>
  </div>
</div>
<div class="container-fluid bg-success" style="padding-top: 2px; padding-bottom: 2px;">
  <div class="row">
    <div class="col-4">
      <uc1:mod_filtro ID="filtroPostazione" runat="server" changeSelEnabled="true" changeCheckEnabled="true" isChecked="false"
        changeCheckVisible="true" comboWidth="160" filterChekText="filtraPostazione" />
      <asp:ObjectDataSource ID="odsPostazione" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByDateRange"
        TypeName="GMW_data.DS_UtilityTableAdapters.v_selPostazioniTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="DataOraFrom" SessionField="_inizio" Type="DateTime" />
          <asp:SessionParameter Name="DataOraTo" SessionField="_fine" Type="DateTime" />
        </SelectParameters>
      </asp:ObjectDataSource>
    </div>
    <div class="col-4">
      <uc1:mod_filtro ID="filtroSoggetto" runat="server" changeSelEnabled="true" changeCheckEnabled="true" isChecked="false" changeCheckVisible="true"
        comboWidth="120" filterChekText="filtraSoggetto" />
      <asp:ObjectDataSource ID="odsSoggetto" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByDateRange"
        TypeName="GMW_data.DS_UtilityTableAdapters.v_selSoggettiTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="DataOraFrom" SessionField="_inizio" Type="DateTime" />
          <asp:SessionParameter Name="DataOraTo" SessionField="_fine" Type="DateTime" />
        </SelectParameters>
      </asp:ObjectDataSource>
    </div>
    <div class="col-4">
      <uc1:mod_filtro ID="filtroAzioni" runat="server" changeSelEnabled="true" changeCheckEnabled="true" isChecked="false" changeCheckVisible="true"
        comboWidth="130" filterChekText="filtraAzioniUdc" />
      <asp:ObjectDataSource ID="odsAzioni" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
        TypeName="GMW_data.DS_UtilityTableAdapters.v_selAzioniUtTableAdapter"></asp:ObjectDataSource>
    </div>
    <div class="col-4">
      <uc1:mod_filtro ID="filtroParticolare" runat="server" changeSelEnabled="true" changeCheckEnabled="true" isChecked="false"
        changeCheckVisible="true" comboWidth="140" filterChekText="filtraParticSAO" />
      <asp:ObjectDataSource ID="odsPartic" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByDateRange"
        TypeName="GMW_data.DS_UtilityTableAdapters.v_selPartic_SAOTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="DataOraFrom" SessionField="_inizio" Type="DateTime" />
          <asp:SessionParameter Name="DataOraTo" SessionField="_fine" Type="DateTime" />
        </SelectParameters>
      </asp:ObjectDataSource>
    </div>
    <div class="col-4">
      <asp:CheckBox runat="server" ID="chkFiltraUdcSAO" AutoPostBack="true" OnCheckedChanged="chkFiltraUdcSAO_CheckedChanged" Font-Size="0.85em" />
      <asp:TextBox runat="server" ID="txtUdcSAO" AutoPostBack="true" OnTextChanged="txtUdcSAO_TextChanged" />
    </div>
  </div>
</div>
<div class="container-fluid" style="padding-top: 2px; padding-bottom: 2px;">
  <div class="row">
    <div class="col-2">
    </div>
    <div class="col-8 text-center">
      <asp:Button runat="server" CssClass="btn btn-default" ID="btnStampa" Width="120px" Text="(ri)stampa" OnClick="btnStampa_Click" Visible="false" />
      <asp:Button runat="server" CssClass="btn btn-default" ID="btnElimina" Width="120px" Text="elimina" Visible="false" OnClick="btnElimina_Click" />
      <asp:Label runat="server" ID="lblOutChkDelUdc" ForeColor="Red" />
    </div>
    <div class="col-2">
    </div>
  </div>
  <div class="row" style="font-size: 8pt;">
    <div class="col-9 ui-mini">
      <asp:GridView ID="grView" runat="server" EnableModelValidation="True" Width="100%" AllowPaging="True" DataSourceID="odsSAO"
        PageSize="10" AutoGenerateColumns="False" DataKeyNames="idxEvento" OnSelectedIndexChanged="grView_SelectedIndexChanged" CssClass="table table-striped table-bordered table-condensed">
        <EmptyDataTemplate>
          <asp:Label runat="server" ID="lblNoRecord" Text="Nessun record trovato" />
        </EmptyDataTemplate>
        <HeaderStyle CssClass="default" />
        <PagerStyle CssClass="active GridPager" />
        <PagerSettings Mode="NumericFirstLast" />
        <SelectedRowStyle CssClass="info" />
        <Columns>
          <asp:TemplateField ItemStyle-HorizontalAlign="Center">
            <HeaderTemplate>
              <asp:Button ID="btnReset" runat="server" Text="Reset" OnClick="btnReset_Click" Visible="true" CssClass="btn btn-default btn-sm" />
            </HeaderTemplate>
            <ItemTemplate>
              <asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Seleziona" ImageUrl="~/images/view_m.png" CssClass="imgNoPad" />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Data Ora" SortExpression="DataOra">
            <ItemTemplate>
              <asp:Label ID="lblDataOra" runat="server" Text='<%# Eval("DataOra", "{0:ddd dd/MM/yy HH:mm:ss}") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Postazione" SortExpression="codPostazione">
            <ItemTemplate>
              <asp:Label ID="lblPostazione" runat="server" Text='<%# Eval("codPostazione") %>' ToolTip='<%# Eval("clientIP") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="CodSoggetto" SortExpression="CodSoggetto">
            <ItemTemplate>
              <asp:Label ID="lblCodSoggetto" runat="server" Text='<%# getOperatoreByCod(Eval("CodSoggetto")) %>' />
            </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="UDC" SortExpression="UDC">
            <ItemTemplate>
              <asp:Label ID="lblUDC" runat="server" Text='<%# Eval("UDC") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="descrizione" SortExpression="descrizione">
            <ItemTemplate>
              <asp:Label ID="lbldescrizione" runat="server" Text='<%# Eval("descrizione") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField>
            <ItemTemplate>
              <asp:Image runat="server" ID="imgAzione" ImageUrl='<%# imgAzione(Eval("CodAzione")) %>' CssClass="imgNoPad" />
            </ItemTemplate>
          </asp:TemplateField>
        </Columns>
      </asp:GridView>
      <asp:ObjectDataSource ID="odsSAO" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getBySearch"
        TypeName="GMW_data.DS_magazzinoTableAdapters.StoricoAzioniOperatoreTableAdapter">
        <SelectParameters>
          <asp:SessionParameter Name="DataOraFrom" SessionField="_inizio" Type="DateTime" />
          <asp:SessionParameter Name="DataOraTo" SessionField="_fine" Type="DateTime" />
          <asp:SessionParameter Name="codPostazione" Type="String" SessionField="postazione_nameSel" />
          <asp:SessionParameter Name="CodSoggetto" Type="String" SessionField="CodSoggettoSAO" />
          <asp:SessionParameter Name="codAzione" Type="String" SessionField="CodAzioneUt" />
          <asp:SessionParameter Name="UDC" Type="String" SessionField="UdcSAO" />
          <asp:SessionParameter Name="Particolare" Type="String" SessionField="ParticSAO" />
        </SelectParameters>
      </asp:ObjectDataSource>
    </div>
    <div class="col-3">
      <asp:Panel ID="pnlDettUDC" runat="server" ScrollBars="None">
        <div class="dixDx" style="height: 100%; min-width: 240px; background-color: white;">
          <div style="background-color: white; margin: 4px;">
            <uc3:mod_detailUDC ID="mod_detailUDC1" runat="server" />
            <uc4:mod_detailUDC_storico ID="mod_detailUDC_storico1" runat="server" />
          </div>
        </div>
      </asp:Panel>
    </div>
  </div>
</div>
