<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_offlineOrders.ascx.cs" Inherits="NKC_WF.WebUserControls.cmp_offlineOrders" %>
<%@ Register Src="~/WebUserControls/mod_righePag.ascx" TagPrefix="uc1" TagName="mod_righePag" %>
<%@ Register Src="~/WebUserControls/cmp_offOrderDetail.ascx" TagPrefix="uc1" TagName="cmp_offOrderDetail" %>



<div class="card">
  <div class="card-header text-center bg-success">
    <h4> <%: traduci("OfflineOrders") %></h4>
  </div>
  <div class="card-body">
    <uc1:cmp_offOrderDetail runat="server" ID="cmp_offOrderDetail" />
    <asp:GridView ID="grView" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="OrdID" DataSourceID="ods" CssClass="table table-sm table-condensed table-striped w-100" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged">
      <SelectedRowStyle CssClass="table-info" />
      <EmptyDataTemplate>
           <%: traduci("NoDataAvaible") %>
      </EmptyDataTemplate>
      <Columns>
        <asp:TemplateField>
          <HeaderTemplate>
            <asp:LinkButton ID="lbtReset" runat="server" CausesValidation="False" ToolTip="Reset" CssClass="btn btn-sm btn-primary" OnClick="lbtReset_Click"><i class="fa fa-refresh" aria-hidden="true"></i></asp:LinkButton>
          </HeaderTemplate>
          <ItemTemplate>
            <asp:LinkButton ID="lbtSelect" runat="server" CausesValidation="False" CommandName="Select" ToolTip="Select" CssClass="btn btn-sm btn-primary"><i class="fa fa-search" aria-hidden="true"></i></asp:LinkButton>
          </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="CreationDate" HeaderText="Created" SortExpression="CreationDate" />
        <asp:BoundField DataField="StatusDesc" HeaderText="Status" ReadOnly="True" SortExpression="StatusDesc" />
        <asp:BoundField DataField="NumItems" HeaderText="# Items" SortExpression="NumItems" />
      </Columns>
    </asp:GridView>
    <asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getBySearch" TypeName="AppData.DS_AppTableAdapters.OfflineOrderListTableAdapter">
      <SelectParameters>
        <asp:Parameter DefaultValue="2" Name="MaxOrdStatus" Type="Int32" />
      </SelectParameters>
    </asp:ObjectDataSource>
  </div>
  <div class="card-footer">
    <uc1:mod_righePag runat="server" ID="mod_righePag" />
  </div>
</div>
