<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagFormatiDtx.ascx.cs" Inherits="GMW.WebUserControls.mod_anagFormatiDtx" %>

<% if (false)
  { %>
<link href="../Content/Style.css" rel="stylesheet" type="text/css" />
<% } %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" DataSourceID="ods" DataKeyNames="FormatoDtmx" AutoGenerateColumns="False" PageSize="5" AllowSorting="True" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" CssClass="table table-striped table-condensed table-responsive table-sm" OnPageIndexChanged="grView_PageIndexChanged">
  <HeaderStyle CssClass="default" />
  <PagerStyle CssClass="active GridPager" />
  <PagerSettings Mode="NumericFirstLast" />
  <SelectedRowStyle CssClass="table-info" />
  <EmptyDataTemplate>
    Nessun Record
        <%--<asp:Button ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" Text='<%# traduci("New") %>'
            Visible='<%# isWritable() %>' />--%>
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="54px">
      <HeaderTemplate>
        <asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" Visible="true" />
      </HeaderTemplate>
      <ItemTemplate>
        <div style="white-space: nowrap;">
          <asp:LinkButton ID="lbtSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>'><i class="fa fa-search fa-2x text-info" aria-hidden="true"></i></asp:LinkButton>&nbsp;
          <asp:LinkButton ID="lbtEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>'><i class="fa fa-pencil fa-2x text-warning" 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") %>'><i class="fa fa-check fa-2x text-success" aria-hidden="true"></i></asp:LinkButton>&nbsp;
        <asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'><i class="fa fa-times fa-2x text-danger" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </EditItemTemplate>
      <FooterTemplate>
        <div style="white-space: nowrap;">
          <asp:LinkButton ID="lbtInsert" runat="server" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("Insert") %>'><i class="fa fa-plus fa-2x text-success" aria-hidden="true"></i></asp:LinkButton>&nbsp;
        <asp:LinkButton ID="lbtCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'><i class="fa fa-times fa-2x text-danger" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Formato" SortExpression="FormatoDtmx">
      <ItemTemplate>
        <asp:Label ID="lblFormatoDtmx" runat="server" Text='<%# Eval("FormatoDtmx") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtFormatoDtmx" runat="server" Text='<%# Bind("FormatoDtmx") %>' Width="98%" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtFormatoDtmx" runat="server" Text='<%# Bind("FormatoDtmx") %>' Width="98%" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Descrizione" SortExpression="Descrizione">
      <ItemTemplate>
        <asp:Label ID="lblDescrizione" runat="server" Text='<%# Eval("Descrizione") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("Descrizione") %>' Width="98%" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("Descrizione") %>' Width="98%" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Esempio" SortExpression="FormatoEsteso">
      <ItemTemplate>
        <asp:Label ID="lblFormatoEsteso" runat="server" Text='<%# Eval("FormatoEsteso") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtFormatoEsteso" runat="server" Text='<%# Bind("FormatoEsteso") %>' Width="98%" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtFormatoEsteso" runat="server" Text='<%# Bind("FormatoEsteso") %>' Width="98%" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="Lungh" HeaderText="Lun" ReadOnly="True" SortExpression="Lungh" />
    <asp:TemplateField HeaderText="PN Pos" SortExpression="PartNumberPos">
      <ItemTemplate>
        <asp:Label ID="lblPartNumberPos" runat="server" Text='<%# Eval("PartNumberPos") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtPartNumberPos" runat="server" Text='<%# Bind("PartNumberPos") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtPartNumberPos" runat="server" Text='<%# Bind("PartNumberPos") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="PN Lun" SortExpression="PartNumberLun">
      <ItemTemplate>
        <asp:Label ID="lblPartNumberLun" runat="server" Text='<%# Eval("PartNumberLun") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtPartNumberLun" runat="server" Text='<%# Bind("PartNumberLun") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtPartNumberLun" runat="server" Text='<%# Bind("PartNumberLun") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Exp Pos" SortExpression="ExpPos">
      <ItemTemplate>
        <asp:Label ID="lblExpPos" runat="server" Text='<%# Eval("ExpPos") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtExpPos" runat="server" Text='<%# Bind("ExpPos") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtExpPos" runat="server" Text='<%# Bind("ExpPos") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Exp Lun" SortExpression="ExpLun">
      <ItemTemplate>
        <asp:Label ID="lblExpLun" runat="server" Text='<%# Eval("ExpLun") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtExpLun" runat="server" Text='<%# Bind("ExpLun") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtExpLun" runat="server" Text='<%# Bind("ExpLun") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Dt Pos" SortExpression="DataPos">
      <ItemTemplate>
        <asp:Label ID="lblDataPos" runat="server" Text='<%# Eval("DataPos") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtDataPos" runat="server" Text='<%# Bind("DataPos") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtDataPos" runat="server" Text='<%# Bind("DataPos") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Dt Lun" SortExpression="DataLun">
      <ItemTemplate>
        <asp:Label ID="lblDataLun" runat="server" Text='<%# Eval("DataLun") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtDataLun" runat="server" Text='<%# Bind("DataLun") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtDataLun" runat="server" Text='<%# Bind("DataLun") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Dt Code" SortExpression="DataFormat">
      <ItemTemplate>
        <asp:Label ID="lblDataFormat" runat="server" Text='<%# Eval("DataFormat") %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:TextBox ID="txtDataFormat" runat="server" Text='<%# Bind("DataFormat") %>' Width="3em" />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtDataFormat" runat="server" Text='<%# Bind("DataFormat") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="54px">
      <HeaderTemplate>
        <asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Visible="true" Text='<%# traduci("New") %>' />
      </HeaderTemplate>
      <EditItemTemplate>
        <asp:LinkButton ID="lbtUpdate2" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update") %>'><i class="fa fa-check fa-2x text-success" aria-hidden="true"></i></asp:LinkButton>&nbsp;
          <asp:LinkButton ID="lbtCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'><i class="fa fa-times fa-2x text-danger" aria-hidden="true"></i></asp:LinkButton>
      </EditItemTemplate>
      <FooterTemplate>
        <div style="white-space: nowrap;">
          <asp:LinkButton ID="lbtInsert2" runat="server" CausesValidation="False" CommandName="Insert" ToolTip='<%# traduci("Insert") %>'><i class="fa fa-plus fa-2x text-success" aria-hidden="true"></i></asp:LinkButton>&nbsp;
        <asp:LinkButton ID="lbtCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>'><i class="fa fa-times fa-2x text-danger" aria-hidden="true"></i></asp:LinkButton>
        </div>
      </FooterTemplate>
      <ItemTemplate>
        <asp:LinkButton ID="lbtDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("FormatoDtmx") %>' CommandName="Delete" ToolTip='<%# traduci("Delete") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# delEnabled(Eval("FormatoDtmx")) %>'><i class="fa fa-trash fa-2x text-danger" aria-hidden="true"></i></asp:LinkButton>
      </ItemTemplate>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter" OnInserting="recuperaFooter" FilterExpression=" FormatoDtmx LIKE '%{0}%' OR Descrizione LIKE '%{0}%' OR FormatoEsteso LIKE '%{0}%' " DeleteMethod="deleteQuery" InsertMethod="Insert" UpdateMethod="updateQuery" OnUpdating="ods_Updating">
  <DeleteParameters>
    <asp:Parameter Name="Original_FormatoDtmx" Type="String" />
  </DeleteParameters>
  <FilterParameters>
    <asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
  </FilterParameters>
  <InsertParameters>
    <asp:Parameter Name="FormatoDtmx" Type="String" />
    <asp:Parameter Name="Descrizione" Type="String" />
    <asp:Parameter Name="FormatoEsteso" Type="String" />
    <asp:Parameter Name="PartNumberPos" Type="Int32" />
    <asp:Parameter Name="PartNumberLun" Type="Int32" />
    <asp:Parameter Name="ExpPos" Type="Int32" />
    <asp:Parameter Name="ExpLun" Type="Int32" />
    <asp:Parameter Name="DataPos" Type="Int32" />
    <asp:Parameter Name="DataLun" Type="Int32" />
    <asp:Parameter Name="DataFormat" Type="String" />
  </InsertParameters>
  <UpdateParameters>
    <asp:Parameter Name="Descrizione" Type="String" />
    <asp:Parameter Name="FormatoEsteso" Type="String" />
    <asp:Parameter Name="PartNumberPos" Type="Int32" />
    <asp:Parameter Name="PartNumberLun" Type="Int32" />
    <asp:Parameter Name="ExpPos" Type="Int32" />
    <asp:Parameter Name="ExpLun" Type="Int32" />
    <asp:Parameter Name="DataPos" Type="Int32" />
    <asp:Parameter Name="DataLun" Type="Int32" />
    <asp:Parameter Name="DataFormat" Type="String" />
    <asp:Parameter Name="Original_FormatoDtmx" Type="String" />
  </UpdateParameters>
</asp:ObjectDataSource>
