<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagMagazzini.ascx.cs" Inherits="GMW.WebUserControls.mod_anagMagazzini" %>
<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound" CssClass="table table-striped table-condensed  table-sm" DataKeyNames="CodMag" DataSourceID="ods">
   <HeaderStyle CssClass="default" />
  <PagerStyle CssClass="active GridPager" />
  <PagerSettings Mode="NumericFirstLast" />
  <SelectedRowStyle CssClass="table-info" />
  <EmptyDataTemplate>
    <asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False">
      <HeaderTemplate>
        <asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click" CssClass="btn btn-default btn-sm" Visible="true"><i class="fa fa-refresh"></i> <%: traduci("Reset") %></asp:LinkButton>
      </HeaderTemplate>
      <ItemTemplate>
        <asp:ImageButton ID="imgSelect" runat="server" CausesValidation="False" CommandName="Select"
          ToolTip='<%# traduci("Select") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.seleziona, SteamWare.dimImg.small) %>' />
        <asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
          ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:ImageButton ID="imgUpdate" runat="server" CausesValidation="False" CommandName="Update"
          ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
        <asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
          ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:ImageButton ID="imgInsert" runat="server" CausesValidation="False" CommandName="Insert"
          ToolTip='<%# traduci("insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
          OnClick="lblIns_click" />
        <asp:ImageButton ID="imgCancel" runat="server" CausesValidation="False" CommandName="Cancel"
          ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="CodMag" SortExpression="CodMag">
      <EditItemTemplate>
        <asp:TextBox ID="txtCodMag" runat="server" Text='<%# Bind("CodMag") %>' Width="10em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblCodMag" runat="server" Text='<%# Bind("CodMag") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtCodMag" runat="server" Text='<%# Bind("CodMag") %>' Width="10em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="DescMag" SortExpression="DescMag">
      <EditItemTemplate>
        <asp:TextBox ID="txtDescMag" runat="server" Text='<%# Bind("DescMag") %>' Width="35em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblDescMag" runat="server" Text='<%# Bind("DescMag") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtDescMag" runat="server" Text='<%# Bind("DescMag") %>' Width="35em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Nascosto" SortExpression="Nascosto">
      <EditItemTemplate>
        <asp:CheckBox ID="chkNascosto" runat="server" Checked='<%# Bind("Nascosto") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:CheckBox ID="chkNascosto" runat="server" Checked='<%# Eval("Nascosto") %>' Enabled="false" />
      </ItemTemplate>
      <FooterTemplate>
        <asp:CheckBox ID="chkNascosto" runat="server" Checked='<%# Bind("Nascosto") %>' />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField ShowHeader="False">
      <HeaderTemplate>
        <asp:LinkButton ID="btnNew" runat="server" OnClick="btnNew_Click" CssClass="btn btn-default btn-sm" Visible="true"><i class="fa fa-plus"></i> <%: traduci("New") %></asp:LinkButton>
      </HeaderTemplate>
      <ItemTemplate>
        <asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
          CommandArgument='<%# Eval("CodMag") %>' ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("CodMag")) %>'
          ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina , SteamWare.dimImg.small) %>' OnClientClick="return confirm('Confermi eliminazione?')" />
      </ItemTemplate>
      <EditItemTemplate>
        <asp:ImageButton ID="imgUpdate2" runat="server" CausesValidation="False" CommandName="Update"
          ToolTip='<%# traduci("Update")%>' ImageUrl='<%# imgPath(SteamWare.tipoImg.conferma , SteamWare.dimImg.small) %>' />
        <asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
          ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
      </EditItemTemplate>
      <FooterTemplate>
        <asp:ImageButton ID="imgInsert2" runat="server" CausesValidation="False" CommandName="Insert"
          ToolTip='<%# traduci("insert") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.nuovo , SteamWare.dimImg.small) %>'
          OnClick="lblIns_click" />
        <asp:ImageButton ID="imgCancel2" runat="server" CausesValidation="False" CommandName="Cancel"
          ToolTip='<%# traduci("Cancel") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.annulla , SteamWare.dimImg.small) %>' />
      </FooterTemplate>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
  SelectMethod="getByCodCS" TypeName="GMW_data.DS_magazzinoTableAdapters.AnagMagTableAdapter"
  OnInserting="recuperaFooter" FilterExpression=" CodMag LIKE '%{0}%' OR DescMag LIKE '%{0}%' "
  OnInserted="ods_Updated" OnUpdated="ods_Updated"
  DeleteMethod="DeleteQuery" InsertMethod="Insert" UpdateMethod="UpdateQuery">
  <FilterParameters>
    <asp:SessionParameter DefaultValue="*" Name="ricerca" SessionField="valoreCercato" />
  </FilterParameters>
  <DeleteParameters>
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="Original_CodMag" Type="String" />
  </DeleteParameters>
  <UpdateParameters>
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="CodMag" Type="String" />
    <asp:Parameter Name="DescMag" Type="String" />
    <asp:Parameter Name="Nascosto" Type="Boolean" />
    <asp:SessionParameter Name="Original_CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="Original_CodMag" Type="String" />
  </UpdateParameters>
  <SelectParameters>
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
  </SelectParameters>
  <InsertParameters>
    <asp:Parameter Name="CodMag" Type="String" />
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="DescMag" Type="String" />
    <asp:Parameter Name="Nascosto" Type="Boolean" />
  </InsertParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />