<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagKit.ascx.cs" Inherits="GMW.WebUserControls.mod_anagKit" %>
<% if (false)
  { %>
<link href="../Content/Style.css" rel="stylesheet" type="text/css" />
<% } %>
<asp:GridView ID="grView" runat="server" DataSourceID="ods" DataKeyNames="CodKIT" AutoGenerateColumns="False" AllowSorting="True" Width="100%" OnSelectedIndexChanged="grView_SelectedIndexChanged" CssClass="table table-striped table-condensed table-responsive" AllowPaging="True" PageSize="5">
  <HeaderStyle CssClass="default" />
  <PagerStyle CssClass="active GridPager" />
  <PagerSettings Mode="NumericFirstLast" />
  <SelectedRowStyle CssClass="info" />
  <EmptyDataTemplate>
    Nessun Record
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="2em">
      <HeaderTemplate>
        <asp:Button ID="btnReset" runat="server" Text='<%# traduci("Reset") %>' OnClick="btnReset_Click" Visible="true" />
      </HeaderTemplate>
      <ItemTemplate>
        <div style="white-space: nowrap;">                                       
          <asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip='<%# traduci("Select") %>' ImageUrl="~/images/view_m.png" Visible='<%# Eval("CodKIT").ToString()!="" %>' />
          <asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip='<%# traduci("Edit") %>' ImageUrl="~/images/edit_m.png" Visible='<%# Eval("CodKIT").ToString()!="" %>' />
        </div>
      </ItemTemplate>  
      <EditItemTemplate>
        <div style="white-space: nowrap;">                                       
          <asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update") %>' ImageUrl="~/images/apply_m.png" />
          <asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>' ImageUrl="~/images/cancel_m.png" />
        </div>
      </EditItemTemplate>
      <ItemStyle HorizontalAlign="Center" Width="2em"></ItemStyle>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="CodKIT" SortExpression="CodKIT">
      <EditItemTemplate>
        <asp:TextBox ID="txtCodKIT" runat="server" Text='<%# Bind("CodKIT") %>'></asp:TextBox>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblCodKIT" runat="server" Text='<%# Eval("CodKIT") %>'></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Descrizione" SortExpression="Descrizione">
      <EditItemTemplate>
        <asp:TextBox ID="txtDescrizione" runat="server" Text='<%# Bind("Descrizione") %>'></asp:TextBox>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblDescrizione" runat="server" Text='<%# Eval("Descrizione") %>'></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="QtaKIT" SortExpression="QtaKIT">
      <EditItemTemplate>
        <asp:TextBox ID="txtQtaKIT" runat="server" Text='<%# Bind("QtaKIT") %>'></asp:TextBox>
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblQtaKIT" runat="server" Text='<%# Eval("QtaKIT") %>'></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="2em">
      <HeaderTemplate>
        <asp:Button ID="btnNew" runat="server" Text='<%# traduci("New") %>' OnClick="btnNew_Click" Visible="true" />
      </HeaderTemplate>
      <ItemTemplate>
        <div style="white-space: nowrap;">
          <asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete" ToolTip='<%# traduci("Delete") %>' Visible='<%# Eval("CodKIT").ToString()!="" %>' ImageUrl="~/images/elimina_m.png" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' />
        </div>
      </ItemTemplate> 
      <EditItemTemplate>
        <div style="white-space: nowrap;">                                       
          <asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update" ToolTip='<%# traduci("Update") %>' ImageUrl="~/images/apply_m.png" />
          <asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip='<%# traduci("Cancel") %>' ImageUrl="~/images/cancel_m.png" />
        </div>
      </EditItemTemplate>
      <ItemStyle HorizontalAlign="Center" Width="2em"></ItemStyle>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagKitTableAdapter" FilterExpression=" CodKIT LIKE '%{0}%' OR Descrizione LIKE '%{0}%' " DeleteMethod="deleteQuery" InsertMethod="insertQuery" UpdateMethod="updateQuery">
  <DeleteParameters>
    <asp:Parameter Name="Original_CodKIT" Type="String" />
  </DeleteParameters>
  <FilterParameters>
    <asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
  </FilterParameters>
  <InsertParameters>
    <asp:Parameter Name="CodKIT" Type="String" />
    <asp:Parameter Name="Descrizione" Type="String" />
    <asp:Parameter Name="QtaKIT" Type="Int32" />
  </InsertParameters>
  <UpdateParameters>       
    <asp:Parameter Name="CodKIT" Type="String" />
    <asp:Parameter Name="Descrizione" Type="String" />
    <asp:Parameter Name="QtaKIT" Type="Int32" />
    <asp:Parameter Name="Original_CodKIT" Type="String" />
  </UpdateParameters>
</asp:ObjectDataSource>
