<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_tipoCella.ascx.cs"
  Inherits="GMW.WebUserControls.mod_tipoCella" %>
<%--<%@ 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" DataKeyNames="IdxTipoCella" 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 p-0" 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="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="#">
      <EditItemTemplate>
        <asp:Label ID="lblIdxTipoCella" runat="server" Text='<%# Eval("IdxTipoCella","[{0}]") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblIdxTipoCella" runat="server" Text='<%# Eval("IdxTipoCella","[{0}]") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:Label ID="lblIdxTipoCella" runat="server" Text='<%# Eval("IdxTipoCella","[{0}]") %>' />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Quantita" SortExpression="Quantita">
      <EditItemTemplate>
        <asp:TextBox ID="txtQuantita" runat="server" Text='<%# Bind("Quantita") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblQuantita" runat="server" Text='<%# Bind("Quantita") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtQuantita" runat="server" Text='<%# Bind("Quantita") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Capienza" SortExpression="Capienza">
      <EditItemTemplate>
        <asp:TextBox ID="txtCapienza" runat="server" Text='<%# Bind("Capienza") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblCapienza" runat="server" Text='<%# Bind("Capienza") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtCapienza" runat="server" Text='<%# Bind("Capienza") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Max_X" SortExpression="Max_X">
      <EditItemTemplate>
        <asp:TextBox ID="txtMax_X" runat="server" Text='<%# Bind("Max_X") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblMax_X" runat="server" Text='<%# Bind("Max_X") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtMax_X" runat="server" Text='<%# Bind("Max_X") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Max_Y" SortExpression="Max_Y">
      <EditItemTemplate>
        <asp:TextBox ID="txtMax_Y" runat="server" Text='<%# Bind("Max_Y") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblMax_Y" runat="server" Text='<%# Bind("Max_Y") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtMax_Y" runat="server" Text='<%# Bind("Max_Y") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Max_Z" SortExpression="Max_Z">
      <EditItemTemplate>
        <asp:TextBox ID="txtMax_Z" runat="server" Text='<%# Bind("Max_Z") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblMax_Z" runat="server" Text='<%# Bind("Max_Z") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtMax_Z" runat="server" Text='<%# Bind("Max_Z") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="Max_Kg" SortExpression="Max_Kg">
      <EditItemTemplate>
        <asp:TextBox ID="txtMax_Kg" runat="server" Text='<%# Bind("Max_Kg") %>' Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="lblMax_Kg" runat="server" Text='<%# Bind("Max_Kg") %>' />
      </ItemTemplate>
      <FooterTemplate>
        <asp:TextBox ID="txtMax_Kg" runat="server" Text='<%# Bind("Max_Kg") %>' Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="CheckPiena" SortExpression="CheckPiena">
      <EditItemTemplate>
        <asp:CheckBox ID="chkCheckPiena" runat="server" Checked='<%# Bind("CheckPiena") %>'
          Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:CheckBox ID="chkCheckPiena" runat="server" Checked='<%# Bind("CheckPiena") %>'
          Enabled="false" />
      </ItemTemplate>
      <FooterTemplate>
        <asp:CheckBox ID="chkCheckPiena" runat="server" Checked='<%# Bind("CheckPiena") %>'
          Width="3em" />
      </FooterTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="SetMag" SortExpression="SetMag">
      <EditItemTemplate>
        <asp:CheckBox ID="chkSetMag" runat="server" Checked='<%# Bind("SetMag") %>'
          Width="3em" />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:CheckBox ID="chkSetMag" runat="server" Checked='<%# Bind("SetMag") %>'
          Enabled="false" />
      </ItemTemplate>
      <FooterTemplate>
        <asp:CheckBox ID="chkSetMag" runat="server" Checked='<%# Bind("SetMag") %>'
          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("IdxTipoCella") %>' ToolTip='<%# traduci("Delete") %>'
          Visible='<%# delEnabled(Eval("IdxTipoCella")) %>' ImageUrl='<%# imgPath(SteamWare.tipoImg.elimina , SteamWare.dimImg.small) %>' OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' />
      </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.TipoCellaTableAdapter"
  OnInserting="recuperaFooter" OnInserted="ods_Updated" OnUpdated="ods_Updated"
  DeleteMethod="DeleteQuery" UpdateMethod="UpdateQuery" InsertMethod="Insert">
  <DeleteParameters>
    <asp:Parameter Name="Original_IdxTipoCella" Type="Int32" />
  </DeleteParameters>
  <UpdateParameters>
    <asp:Parameter Name="Original_IdxTipoCella" Type="Int32" />
    <asp:SessionParameter Name="CodMag" Type="String" SessionField="CodMag_sel" DefaultValue="MM" />
    <asp:SessionParameter Name="CodCS" Type="String" SessionField="CodCS" DefaultValue="MM" />
    <asp:Parameter Name="Quantita" Type="Int32" />
    <asp:Parameter Name="Capienza" Type="Int32" />
    <asp:Parameter Name="Max_X" Type="Double" />
    <asp:Parameter Name="Max_Y" Type="Double" />
    <asp:Parameter Name="Max_Z" Type="Double" />
    <asp:Parameter Name="Max_Kg" Type="Double" />
    <asp:Parameter Name="CheckPiena" Type="Boolean" />
    <asp:Parameter Name="SetMag" Type="Boolean" />
  </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="Quantita" Type="Int32" />
    <asp:Parameter Name="Capienza" Type="Int32" />
    <asp:Parameter Name="Max_X" Type="Double" />
    <asp:Parameter Name="Max_Y" Type="Double" />
    <asp:Parameter Name="Max_Z" Type="Double" />
    <asp:Parameter Name="Max_Kg" Type="Double" />
    <asp:Parameter Name="CheckPiena" Type="Boolean" />
    <asp:Parameter Name="SetMag" 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" />