<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_UdcCella.ascx.cs"
  Inherits="GMW.WebUserControls.mod_UdcCella" %>
<div class="row">
  <div class="col-sm-6">
    <div class="input-group" style="width: 400px; margin: auto;">
      <span class="input-group-addon">
        <asp:LinkButton runat="server" ID="lbnSearch" OnClick="btnCerca_Click" AccessKey="i"><i class="fa fa-search"></i> <%: traduci("lblCerca") %></asp:LinkButton>
      </span>
      <asp:TextBox runat="server" ID="txtCerca" OnTextChanged="txtCerca_TextChanged" CssClass="searchinput form-control" placeholder="..." AutoPostBack="True" />
      <span class="input-group-addon">
        <asp:LinkButton runat="server" ID="lnkReset" Text="X" type="button" Font-Size="0.8em" />
      </span>
    </div>
    <div style="min-width: 400px;">
      <asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
        OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
        DataKeyNames="UDC" DataSourceID="ods" OnPageIndexChanged="grView_PageIndexChanged" Width="100%"
        OnRowUpdated="grView_RowUpdated" OnSorted="grView_Sorted">
        <RowStyle CssClass="ctrRowStyle" />
        <AlternatingRowStyle CssClass="ctrAltRowStyle" />
        <EditRowStyle CssClass="ctrEditRowStyle" />
        <SelectedRowStyle CssClass="ctrSelRowStyle" />
        <FooterStyle CssClass="ctrFooter" />
        <PagerStyle CssClass="ctrHeaderPager" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle CssClass="ctrHeaderPager" ForeColor="White" Font-Bold="True" />
        <EmptyDataRowStyle CssClass="ctrRowStyle" />
        <EmptyDataTemplate>
          <asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("noRecord") %>' />
        </EmptyDataTemplate>
        <Columns>
          <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
            <HeaderTemplate>
              <asp:LinkButton ID="lbtReset" 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) %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="UDC" SortExpression="UDC">
            <ItemTemplate>
              <asp:Label ID="lblUDC" runat="server" Text='<%# Eval("UDC") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Particolare" SortExpression="Particolare">
            <ItemTemplate>
              <asp:Label ID="lblParticolare" runat="server" Text='<%# Eval("Particolare") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="Qta" SortExpression="Qta" ItemStyle-HorizontalAlign="Right">
            <ItemTemplate>
              <asp:Label ID="lblQta" runat="server" Text='<%# Eval("Qta","{0:#}") %>' />
            </ItemTemplate>
          </asp:TemplateField>
          <asp:TemplateField HeaderText="MagLog" SortExpression="IdxPosizione" ItemStyle-HorizontalAlign="Right">
            <ItemTemplate>
              <asp:Label ID="lblIdxPosizione" runat="server" Text='<%# Eval("IdxPosizione") %>' />
            </ItemTemplate>
          </asp:TemplateField>
        </Columns>
      </asp:GridView>
      <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
        SelectMethod="getUdcDetailByIdxCella" TypeName="GMW_data.DS_magazzinoTableAdapters.v_UdcDetailTableAdapter"
        OnDataBinding="ods_DataBinding" FilterExpression="UDC LIKE '%{0}%' OR PARTICOLARE LIKE '%{0}%'">
        <SelectParameters>
          <asp:SessionParameter Name="IdxCella" Type="Int32" SessionField="IdxCellaMag" DefaultValue="0" />
        </SelectParameters>
        <FilterParameters>
          <asp:SessionParameter Name="search" Type="String" SessionField="valoreCercatoCella"
            DefaultValue="" />
        </FilterParameters>
      </asp:ObjectDataSource>
      <asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&nbsp;
            <asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
    </div>
  </div>
  <div class="col-sm-6">
    <div class="col-sm-6">
      <asp:Panel runat="server" ID="pnlQta">
        <table>
          <tr>
            <td>
              <asp:Label ID="lblQta" runat="server" />
            </td>
          </tr>
          <tr>
            <td>
              <asp:TextBox runat="server" ID="txtQta" />
            </td>
          </tr>
          <tr>
            <td>[ALT-U]<br />
              <asp:Button runat="server" ID="btnQta" OnClick="btnQta_Click" AccessKey="U" OnClientClick="return confirm('Confermi modifica?')" />
            </td>
          </tr>
        </table>
      </asp:Panel>
    </div>
    <div class="col-sm-6">
      <asp:Panel runat="server" ID="pnlSposta">
        <table>
          <tr>
            <td>
              <asp:Label runat="server" ID="lblNewPos" />
            </td>
          </tr>
          <tr>
            <td>
              <asp:TextBox runat="server" ID="txtNewCella" />
            </td>
          </tr>
          <tr>
            <td>[ALT-W]<br />
              <asp:Button runat="server" ID="btnSposta" OnClick="btnSposta_Click1" AccessKey="W" OnClientClick="return confirm('Confermi Spostamento?')" />
            </td>
          </tr>
        </table>
      </asp:Panel>
    </div>
    <div class="col-sm-8 col-sm-offset-2">
      <asp:Label ID="lblErrore" runat="server" CssClass="erroreMid" />
    </div>
  </div>
</div>
