<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagLinee.ascx.cs" Inherits="GMW.WebUserControls.mod_anagLinee" %>
<% if (false)
  { %>
<link href="../Content/Style.css" rel="stylesheet" type="text/css" />
<% } %>

<asp:HiddenField runat="server" ID="hfEnableSelect" Value="false" />
<asp:HiddenField runat="server" ID="hfEnableEdit" Value="false" />
<asp:HiddenField runat="server" ID="hfShowDetail" Value="true" />
<asp:GridView ID="grView" runat="server" DataSourceID="ods" DataKeyNames="CodLinea" AutoGenerateColumns="False" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" CssClass="table table-striped table-condensed table-sm" AllowPaging="True">
  <HeaderStyle CssClass="default" />
  <PagerStyle CssClass="active GridPager" />
  <PagerSettings Mode="NumericFirstLast" />
  <SelectedRowStyle CssClass="table-primary text-light2" />
  <EmptyDataTemplate>
    Nessun Record
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
      <HeaderTemplate>
        <asp:LinkButton runat="server" ID="lbtNew" OnClick="btnNew_Click" Visible='<%# enableEdit %>' CssClass="btn btn-sm btn-outline-success" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaAddNew") %>'><i class="fa fa-plus"></i></asp:LinkButton>
        <asp:LinkButton ID="lbtReset" runat="server" OnClick="btnReset_Click" CssClass="btn btn-sm btn-outline-info" Visible='<%# enableSelect %>'><i class="fa fa-refresh"></i></asp:LinkButton>
      </HeaderTemplate>
      <ItemTemplate>
        <div style="white-space: nowrap;">
          <asp:LinkButton runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>' Visible='<%# isNotRoot(Eval("CodLinea")) && enableSelect %>' CssClass="btn btn-sm btn-primary"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
          <asp:LinkButton runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>' Visible='<%# isNotRoot(Eval("CodLinea")) && enableEdit %>' CssClass="btn btn-sm btn-primary"><i class="fa fa-pencil" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </ItemTemplate>
      <EditItemTemplate>
        <div style="white-space: nowrap;">
          <asp:LinkButton ID="lbtUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update")%>' CssClass="btn btn-sm btn-success"><i class="fa fa-check" aria-hidden="true"></i></asp:LinkButton>
          <asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel")%>' CssClass="btn btn-sm btn-danger"><i class="fa fa-times" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </EditItemTemplate>
      <FooterTemplate>
        <div style="white-space: nowrap;">
          <asp:LinkButton runat="server" ID="lbtInsert" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("insert") %>' OnClick="lblIns_click" CssClass="btn btn-sm btn-primary"><i class="fa fa-plus" aria-hidden="true"></i></asp:LinkButton>
          <asp:LinkButton runat="server" ID="lbtCancel" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>' CssClass="btn btn-sm btn-warning"><i class="fa fa-ban" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </FooterTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="CodLinea" HeaderText="CodLinea" ReadOnly="True" SortExpression="CodLinea" />
    <asp:BoundField DataField="Descrizione" HeaderText="Descrizione" SortExpression="Descrizione" />
    <asp:BoundField DataField="CodBlocco" HeaderText="CodBlocco" ReadOnly="True" SortExpression="CodBlocco" />
    <asp:BoundField DataField="CodCella" HeaderText="CodCella" ReadOnly="True" SortExpression="CodCella" />
    <asp:TemplateField>
      <HeaderTemplate>
        <asp:Label runat="server" Text="codPostazione" Visible='<%# showDetail %>' />
      </HeaderTemplate>
      <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("codPostazione") %>' Visible='<%# showDetail %>' />
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
      <HeaderTemplate>
        <asp:Label runat="server" Text="dtAccess" Visible='<%# showDetail %>' />
      </HeaderTemplate>
      <EditItemTemplate>
        <asp:Label ID="Label2" runat="server" Text='<%# Eval("dtAccess") %>'></asp:Label>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="Label2" runat="server" Text='<%# Eval("dtAccess") %>' Visible='<%# showDetail %>' />
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
      <HeaderTemplate>
        <asp:Label runat="server" Text="FormatoDtmx" Visible='<%# showDetail %>' />
      </HeaderTemplate>
      <EditItemTemplate>
        <asp:DropDownList runat="server" ID="dlFormatoDtmx" DataSourceID="odsFormDmtx" DataTextField="FormatoDtmx" DataValueField="FormatoDtmx" SelectedValue='<%# Bind("FormatoDtmx") %>' Visible='<%# showDetail %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblFormatoDtmx" runat="server" Text='<%# Eval("FormatoDtmx") %>' Visible='<%# showDetail %>' />
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
      <HeaderTemplate>
        <asp:Label runat="server" Text="Attivo" />
      </HeaderTemplate>
      <EditItemTemplate>
        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("Attivo") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("Attivo") %>' Enabled="false" />
      </ItemTemplate>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagLineeTableAdapter" OnInserting="recuperaFooter" FilterExpression=" CodBlocco = '{0}' " UpdateMethod="updateConf" OnUpdating="ods_Updating">
  <FilterParameters>
    <asp:ControlParameter ControlID="hfCodBlocco" DefaultValue="" Name="CodBlocco" PropertyName="Value" Type="String" />
  </FilterParameters>
  <UpdateParameters>
    <asp:Parameter Name="Descrizione" Type="String" />
    <asp:Parameter Name="FormatoDtmx" Type="String" />
    <asp:Parameter Name="Attivo" Type="Boolean" />
    <asp:Parameter Name="Original_CodLinea" Type="String" />
  </UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfCodBlocco" />

<asp:ObjectDataSource runat="server" ID="odsFormDmtx" SelectMethod="GetData" TypeName="GMW_data.DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter"></asp:ObjectDataSource>
