<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_viewRigheListaPrelievo.ascx.cs"
  Inherits="GMW.WebUserControls.mod_viewRigheListaPrelievo" %>
<%@ Register Src="mod_selettore_ajax.ascx" TagName="mod_selettore_ajax" TagPrefix="uc1" %>

<asp:GridView ID="grView" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
  OnSelectedIndexChanged="grView_SelectedIndexChanged" OnDataBound="grView_DataBound"
  DataKeyNames="CodLista,UDC" DataSourceID="ods" OnPageIndexChanged="grView_PageIndexChanged"
  OnSorted="grView_Sorted" OnRowUpdating="grView_RowUpdating" OnRowEditing="grView_RowEditing"
  OnRowCancelingEdit="grView_RowCancelingEdit"
  OnRowDeleted="grView_RowDeleted" OnRowCommand="grView_RowCommand">
  <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>
        <div style="white-space: nowrap;">
          <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"
            Visible='<%# editEnabled(Eval("Prelevato"), Eval("UDC")) %>' ToolTip='<%# traduci("Edit") %>'
            ImageUrl='<%# imgPath(SteamWare.tipoImg.modifica, SteamWare.dimImg.small) %>' />
        </div>
      </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>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="UDC" SortExpression="UDC">
      <EditItemTemplate>
        <uc1:mod_selettore_ajax ID="mod_selettore_ajax1" runat="server" tipo="UDC_byPart"
          valore='<%# Bind("UDC") %>' />
      </EditItemTemplate>
      <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("UDC") %>' />
      </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField HeaderText="NC" ItemStyle-HorizontalAlign="Center">
      <ItemTemplate>
        <asp:Label ID="lbl" runat="server" Visible='<%# Eval("ScoreNC").ToString()!="0" %>'><i class="fa fa-ban text-danger"></i></asp:Label>
        <asp:Label ID="Label2" runat="server" Visible='<%# Eval("ScoreNC").ToString()=="0" %>'><i class="fa fa-check text-success"></i></asp:Label>
      </ItemTemplate>
    </asp:TemplateField>
    <asp:BoundField DataField="CodCella" HeaderText="CodCella" ReadOnly="True" SortExpression="CodCella" />
    <asp:BoundField DataField="Qta" HeaderText="Qta" SortExpression="Qta" ReadOnly="true" />
    <asp:CheckBoxField DataField="Proposto" HeaderText="Prop" SortExpression="Proposto"
      ReadOnly="true" />
    <asp:CheckBoxField DataField="Prelevato" HeaderText="Prel" SortExpression="Prelevato"
      ReadOnly="true" />
    <asp:TemplateField ShowHeader="False" ItemStyle-HorizontalAlign="Center">
      <HeaderTemplate>
        <asp:Button ID="btnNew" runat="server" OnClick="btnNew_Click" Text='<%# traduci("New") %>'
          Visible='<%# nuovoEnabled() %>' />
      </HeaderTemplate>
      <ItemTemplate>
        <asp:ImageButton ID="imgDelete" runat="server" CausesValidation="False" CommandName="Delete"
          CommandArgument='<%# Eval("UDC") %>' ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("Prelevato"), Eval("UDC")) %>' ImageUrl="~/images/elimina_s.png" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' />
        <%--<asp:ConfirmButtonExtender ID="cbeDelete" runat="server" ConfirmText='<%# traduci("confermaDel")%>'
                    TargetControlID="imgDelete">
                </asp:ConfirmButtonExtender>--%>
        <asp:ImageButton ID="imgPrelevato" runat="server" CausesValidation="False" CommandName="Update"
          CommandArgument="ConfermaPrelevato" ToolTip='<%# traduci("EffettuaPrelievo") %>'
          Visible='<%# prelevaEnabled(Eval("Prelevato"), Eval("UDC")) %>' ImageUrl="~/images/ArrowUpGreen_m.png"
          OnClick="imgPrelevato_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaPrelievo") %>' />
        <%--<asp:ConfirmButtonExtender ID="cbePreleva" runat="server" ConfirmText='<%# traduci("confermaPrelievo")%>'
                    TargetControlID="imgPrelevato" />--%>
        <asp:ImageButton ID="imgAnnullaPrelevato" runat="server" CausesValidation="False"
          CommandName="Update" CommandArgument="AnnullaPrelevato" ToolTip='<%# traduci("AnnullaPrelievo") %>'
          Visible='<%# annullaEnabled(Eval("Prelevato")) %>' ImageUrl="~/images/ArrowDownRed_m.png"
          OnClick="imgAnnullato_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaAnnullaPrelievo") %>' />
        <%--<asp:ConfirmButtonExtender ID="cbeAnnulla" runat="server" ConfirmText='<%# traduci("confermaAnnullaPrelievo")%>'
                    TargetControlID="imgAnnullaPrelevato" />--%>
        <asp:ImageButton ID="imgScambiaUDC" runat="server" CausesValidation="False" CommandName="Update"
          CommandArgument="ScambiaUdc" ToolTip='<%# traduci("ScambiaUdc") %>' Visible='<%# scambiaVisible(Eval("Prelevato"), Eval("UDC")) %>'
          Enabled='<%# scambiaEnabled(Eval("Prelevato"), Eval("UDC")) %>' ImageUrl="~/images/recycle_orange_s.png"
          OnClick="imgScambia_Click" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaScambiaUdc") %>' />
        <%--<asp:ConfirmButtonExtender ID="cbeScambiaUDC" runat="server" ConfirmText='<%# traduci("confermaScambiaUdc")%>'
                    TargetControlID="imgScambiaUDC" />--%>
      </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>
    </asp:TemplateField>
  </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}"
  SelectMethod="getByCodLista" TypeName="GMW_data.DS_magazzinoTableAdapters.v_righeListePrelievoPosizioneTableAdapter"
  UpdateMethod="updateUDC" DeleteMethod="DeleteQuery" OnUpdated="ods_Updated" OnUpdating="ods_Updating" FilterExpression="ScoreNC >= {0}">
  <UpdateParameters>
    <asp:Parameter Name="Original_CodLista" Type="String" />
    <asp:Parameter Name="Original_UDC" Type="String" />
    <asp:Parameter Name="UDC" Type="String" />
  </UpdateParameters>
  <SelectParameters>
    <asp:SessionParameter DefaultValue="*" Name="CodLista" SessionField="CodLista_sel"
      Type="String" />
  </SelectParameters>
  <FilterParameters>
    <asp:ControlParameter ControlID="hfMinScoreNC" Type="Int32" DefaultValue="0" PropertyName="Value" />
  </FilterParameters>
  <DeleteParameters>
    <asp:Parameter Name="Original_CodLista" Type="String" />
    <asp:Parameter Name="Original_UDC" Type="String" />
  </DeleteParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfMinScoreNC" Value="0" />
<asp:Label ID="lblNumRec" runat="server" CssClass="didascalia" />&nbsp;&nbsp;
<asp:Label ID="lblWarning" runat="server" Visible="false" CssClass="erroreMid" />
