<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_specDmtx.ascx.cs" Inherits="GMW.WebUserControls.mod_specDmtx" %>
<% if (false)
  { %>
<link href="../Content/Style.css" rel="stylesheet" type="text/css" />
<% } %>
<asp:GridView ID="grView" runat="server" DataSourceID="ods" DataKeyNames="FormatoDtmx,CodSpec,ValoreInt" AutoGenerateColumns="False" AllowSorting="True" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" CssClass="table table-striped table-condensed table-responsive table-sm">
  <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>
      <ItemStyle HorizontalAlign="Center" Width="54px"></ItemStyle>
    </asp:TemplateField>
    <asp:BoundField DataField="FormatoDtmx" HeaderText="Formato" ReadOnly="True" SortExpression="FormatoDtmx" />
    <asp:TemplateField HeaderText="CodSpec" SortExpression="CodSpec">
      <EditItemTemplate>
        <asp:Label ID="lblCodSpec" runat="server" Text='<%# Eval("CodSpec") %>'></asp:Label>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblCodSpec" runat="server" Text='<%# Bind("CodSpec") %>'></asp:Label>
      </ItemTemplate>
      <FooterTemplate>
        <asp:DropDownList runat="server" ID="dlCodSpec" DataSourceID="odsAnagSpec" DataTextField="CodSpec" DataValueField="CodSpec" />
        <%--<asp:TextBox ID="txtCodSpec" runat="server" Text='<%# Eval("CodSpec") %>' />--%>
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="ValoreStr" SortExpression="ValoreStr">
      <EditItemTemplate>
        <asp:TextBox ID="txtValoreStr" runat="server" Text='<%# Bind("ValoreStr") %>' Width="4em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblValoreStr" runat="server" Text='<%# Bind("ValoreStr") %>'></asp:Label>
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtValoreStr" runat="server" Text='<%# Bind("ValoreStr") %>' Width="4em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="ValoreInt" SortExpression="ValoreInt">
      <EditItemTemplate>
        <asp:TextBox ID="txtValoreInt" runat="server" Text='<%# Bind("ValoreInt") %>' Width="4em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblValoreInt" runat="server" Text='<%# Bind("ValoreInt") %>'></asp:Label>
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtValoreInt" runat="server" Text='<%# Bind("ValoreInt") %>' Width="4em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Note" SortExpression="Note">
      <EditItemTemplate>
        <asp:TextBox ID="txtNote" runat="server" Text='<%# Bind("Note") %>' Width="30em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblNote" runat="server" Text='<%# Bind("Note") %>'></asp:Label>
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtNote" runat="server" Text='<%# Bind("Note") %>' Width="30em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Peso" SortExpression="Peso">
      <EditItemTemplate>
        <asp:TextBox ID="txtPeso" runat="server" Text='<%# Bind("Peso") %>' Width="4em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblPeso" runat="server" Text='<%# Bind("Peso") %>'></asp:Label>
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtPeso" runat="server" Text='<%# Bind("Peso") %>' Width="4em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Attivo" SortExpression="Attivo">
      <EditItemTemplate>
        <asp:CheckBox ID="chkAttivo" runat="server" Checked='<%# Bind("Attivo") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:CheckBox ID="chkAttivo" runat="server" Checked='<%# Bind("Attivo") %>' Enabled="false" />
      </ItemTemplate>
      <FooterTemplate>
        <asp:CheckBox ID="chkAttivo" runat="server" Checked='<%# Bind("Attivo") %>' />
      </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>                                     
        <div style="white-space: nowrap;">
          <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>
        </div>
      </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>
      <ItemStyle HorizontalAlign="Center" Width="54px"></ItemStyle>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByFormatoDtmx" TypeName="GMW_data.DS_DataMatrixTableAdapters.TabSpecDtxTableAdapter" OnInserting="recuperaFooter" DeleteMethod="deleteQuery" InsertMethod="Insert" UpdateMethod="updateQuery" OnUpdating="ods_Updating">
  <DeleteParameters>
    <asp:Parameter Name="Original_FormatoDtmx" Type="String" />
    <asp:Parameter Name="Original_CodSpec" Type="String" />
    <asp:Parameter Name="Original_ValoreInt" Type="Int32" />
  </DeleteParameters>
  <InsertParameters>
    <asp:Parameter Name="FormatoDtmx" Type="String" />
    <asp:Parameter Name="CodSpec" Type="String" />
    <asp:Parameter Name="ValoreStr" Type="String" />
    <asp:Parameter Name="ValoreInt" Type="Int32" />
    <asp:Parameter Name="Note" Type="String" />
    <asp:Parameter Name="Peso" Type="Int32" />
    <asp:Parameter Name="Attivo" Type="Boolean" />
  </InsertParameters>
  <SelectParameters>
    <asp:ControlParameter ControlID="hfFormatoDtmx" DefaultValue="" Name="FormatoDtmx" PropertyName="Value" Type="String" />
  </SelectParameters>
  <UpdateParameters>
    <asp:Parameter Name="ValoreStr" Type="String" />
    <asp:Parameter Name="ValoreInt" Type="Int32" />
    <asp:Parameter Name="Note" Type="String" />
    <asp:Parameter Name="Peso" Type="Int32" />
    <asp:Parameter Name="Attivo" Type="Boolean" />
    <asp:Parameter Name="Original_FormatoDtmx" Type="String" />
    <asp:Parameter Name="Original_CodSpec" Type="String" />
    <asp:Parameter Name="Original_ValoreInt" Type="Int32" />
  </UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfFormatoDtmx" />
<asp:ObjectDataSource runat="server" ID="odsAnagSpec" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_DataMatrixTableAdapters.AnagSpecDtxTableAdapter" />
