<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_anagBlocchi.ascx.cs"
  Inherits="GMW.WebUserControls.mod_anagBlocchi" %>
<%--<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>--%>
<div class="filtro_1">
  <asp:Label ID="lblTitolo" runat="server" />
</div>
<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" OnRowUpdating="grView_RowUpdating" DataKeyNames="IdxBlocco" 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") %>' />
    <asp:LinkButton ID="btnNew" runat="server" OnClick="btnNewFromEmpty_Click" CssClass="btn btn-default btn-sm" Visible='<%# isWritable() %>'><i class="fa fa-plus"></i> <%: traduci("New") %></asp:LinkButton>
  </EmptyDataTemplate>
  <Columns>
    <asp:TemplateField ShowHeader="False">
      <HeaderTemplate>
        <asp:LinkButton ID="btnReset" runat="server" OnClick="btnReset_Click" CssClass="btn btn-default btn-sm small" Visible="false"><i class="fa fa-refresh"></i> <%: traduci("Reset") %></asp:LinkButton>
      </HeaderTemplate>
      <ItemTemplate>
        <asp:ImageButton ID="imgEdit" runat="server" CausesValidation="False" CommandName="Edit"
          ToolTip='<%# traduci("Edit") %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
        <asp:ImageButton ID="imgCreaChild" runat="server" CausesValidation="False" ToolTip='<%# traduci("creaCelleMancanti") %>'
          ImageUrl="~/images/createChildObj.png" CommandArgument="creaChildObj" CommandName="Update"
          OnClick="imgCreaChild_Click" Visible='<%# childObjNeeded(Eval("IdxBlocco")) %>' OnClientClick="return confirm('Confermi eliminazione celle mancanti?')" />
        <asp:ImageButton ID="imgShowDetail" runat="server" CausesValidation="False" CommandName="Select"
          ToolTip='<%# traduci("MostraCelleBlocco") %>' ImageUrl="~/images/ShowDetail.png" />
      </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="CodBlocco" SortExpression="CodBlocco">
      <EditItemTemplate>
        <asp:TextBox ID="txtCodBlocco" runat="server" Text='<%# Bind("CodBlocco") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblCodBlocco" runat="server" Text='<%# Bind("CodBlocco") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtCodBlocco" runat="server" Text='<%# Bind("CodBlocco") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="DescBlocco" SortExpression="DescBlocco">
      <EditItemTemplate>
        <asp:TextBox ID="txtDescBlocco" runat="server" Text='<%# Bind("DescBlocco") %>' Width="15em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblDescBlocco" runat="server" Text='<%# Bind("DescBlocco") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtDescBlocco" runat="server" Text='<%# Bind("DescBlocco") %>' Width="15em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="NumX" SortExpression="NumX">
      <EditItemTemplate>
        <asp:TextBox ID="txtNumX" runat="server" Text='<%# Bind("NumX") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblNumX" runat="server" Text='<%# Bind("NumX") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtNumX" runat="server" Text='<%# Bind("NumX") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="NumY" SortExpression="NumY">
      <EditItemTemplate>
        <asp:TextBox ID="txtNumY" runat="server" Text='<%# Bind("NumY") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblNumY" runat="server" Text='<%# Bind("NumY") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtNumY" runat="server" Text='<%# Bind("NumY") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="NumZ" SortExpression="NumZ">
      <EditItemTemplate>
        <asp:TextBox ID="txtNumZ" runat="server" Text='<%# Bind("NumZ") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblNumZ" runat="server" Text='<%# Bind("NumZ") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtNumZ" runat="server" Text='<%# Bind("NumZ") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField ShowHeader="False">
      <HeaderTemplate>
        <asp:LinkButton ID="btnNew" runat="server" OnClick="btnNew_Click" CssClass="btn btn-default btn-sm small" 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("IdxBlocco") %>' ToolTip='<%# traduci("Delete") %>'
          Visible='<%# delEnabled(Eval("IdxBlocco")) %>' 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="getByCodMag" TypeName="GMW_data.DS_magazzinoTableAdapters.BlocchiTableAdapter"
  OnInserting="recuperaFooter" OnInserted="ods_Updated" OnUpdated="ods_Updated"
  DeleteMethod="DeleteQuery" InsertMethod="insertQuery" UpdateMethod="UpdateQuery">
  <DeleteParameters>
    <asp:Parameter Name="Original_IdxBlocco" Type="Int32" />
  </DeleteParameters>
  <UpdateParameters>
    <asp:SessionParameter Name="CodMag" Type="String" SessionField="CodMag_sel" DefaultValue="MM" />
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="CodBlocco" Type="String" />
    <asp:Parameter Name="DescBlocco" Type="String" />
    <asp:Parameter Name="NumX" Type="Int32" />
    <asp:Parameter Name="NumY" Type="Int32" />
    <asp:Parameter Name="NumZ" Type="Int32" />
    <asp:Parameter Name="Original_IdxBlocco" Type="Int32" />
  </UpdateParameters>
  <SelectParameters>
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:SessionParameter Name="CodMag" Type="String" SessionField="CodMag_sel" DefaultValue="MM" />
  </SelectParameters>
  <InsertParameters>
    <asp:SessionParameter Name="CodMag" Type="String" SessionField="CodMag_sel" DefaultValue="MM" />
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="CodBlocco" Type="String" />
    <asp:Parameter Name="DescBlocco" Type="String" />
    <asp:Parameter Name="NumX" Type="Int32" />
    <asp:Parameter Name="NumY" Type="Int32" />
    <asp:Parameter Name="NumZ" Type="Int32" />
  </InsertParameters>
</asp:ObjectDataSource>
<asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />