<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_trascPn2Part.ascx.cs" Inherits="GMW.WebUserControls.mod_trascPn2Part" %>
<asp:GridView runat="server" ID="grView" AutoGenerateColumns="False" DataKeyNames="PartNumber" DataSourceID="ods" AllowSorting="True" Width="100%" CssClass="table table-striped table-condensed table-responsive table-sm" OnSelectedIndexChanged="grView_SelectedIndexChanged">
  <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") %>' OnClick="lblIns_click"><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:TemplateField HeaderText="Formato" SortExpression="FormatoDtmx">
      <EditItemTemplate>
        <asp:DropDownList runat="server" ID="dlFormatoDtmx" DataSourceID="odsFormDmtx" DataTextField="FormatoDtmx" DataValueField="FormatoDtmx" SelectedValue='<%# Bind("FormatoDtmx") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblFormatoDtmx" runat="server" Text='<%# Eval("FormatoDtmx") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:DropDownList runat="server" ID="dlFormatoDtmx" DataSourceID="odsFormDmtx" DataTextField="FormatoDtmx" DataValueField="FormatoDtmx" SelectedValue='<%# Bind("FormatoDtmx") %>' />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="PartNumber" SortExpression="PartNumber">
      <EditItemTemplate>
        <asp:TextBox ID="txtPartNumber" runat="server" Text='<%# Bind("PartNumber") %>' Width="8em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblPartNumber" runat="server" Text='<%# Bind("PartNumber") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtPartNumber" runat="server" Text='<%# Bind("PartNumber") %>' Width="8em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Particolare" SortExpression="Particolare">
      <EditItemTemplate>
        <asp:TextBox ID="txtParticolare" runat="server" Text='<%# Bind("Particolare") %>' Width="8em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblParticolare" runat="server" Text='<%# Bind("Particolare") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtParticolare" runat="server" Text='<%# Bind("Particolare") %>' Width="8em" />
      </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") %>' OnClick="lblIns_click"><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:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandArgument='<%# Eval("PartNumber") %>' CommandName="Delete" ImageUrl="~/images/elimina_m.png" ToolTip='<%# traduci("Delete") %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' Visible='<%# delEnabled(Eval("PartNumber")) %>' />
      </ItemTemplate>
      <ItemStyle HorizontalAlign="Center" Width="54px"></ItemStyle>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="original_{0}" SelectMethod="getByPnFormato" TypeName="GMW_data.DS_DataMatrixTableAdapters.TrascDatamatrixTableAdapter" DeleteMethod="deleteQuery" UpdateMethod="updateQuery" InsertMethod="Insert" OnInserting="recuperaFooter" OnDeleting="ods_Deleting" OnUpdating="ods_Updating">
  <InsertParameters>
    <asp:Parameter Name="PartNumber" Type="String" />
    <asp:Parameter Name="Particolare" Type="String" />
    <asp:Parameter Name="FormatoDtmx" Type="String" />
  </InsertParameters>
  <SelectParameters>
    <asp:ControlParameter ControlID="hfFormatoDtmx" DefaultValue="" Name="FormatoDtmx" PropertyName="Value" Type="String" />
    <asp:ControlParameter ControlID="hfPartNumber" DefaultValue="" Name="PartNumber" PropertyName="Value" Type="String" />
  </SelectParameters>
  <DeleteParameters>
    <asp:Parameter Name="Original_PartNumber" Type="String" />
  </DeleteParameters>
  <UpdateParameters>
    <asp:Parameter Name="FormatoDtmx" Type="String" />
    <asp:Parameter Name="Particolare" Type="String" />
    <asp:Parameter Name="PartNumber" Type="String" />
    <asp:Parameter Name="Original_PartNumber" Type="String" />
  </UpdateParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfFormatoDtmx" />
<asp:HiddenField runat="server" ID="hfPartNumber" />
<asp:ObjectDataSource runat="server" ID="odsFormDmtx" SelectMethod="GetData" TypeName="GMW_data.DS_DataMatrixTableAdapters.AnagFormatiDtmxTableAdapter"></asp:ObjectDataSource>
