28 lines
754 B
C#
28 lines
754 B
C#
|
|
using FrontOffice.Main.Utilities;
|
||
|
|
using Microsoft.AspNetCore.Components;
|
||
|
|
|
||
|
|
namespace FrontOffice.Main.Pages.Store;
|
||
|
|
|
||
|
|
public partial class Orders : ComponentBase
|
||
|
|
{
|
||
|
|
[Inject] private OrderService OrderService { get; set; } = default!;
|
||
|
|
|
||
|
|
private List<Order> _orders = new();
|
||
|
|
private bool _loading;
|
||
|
|
|
||
|
|
protected override async Task OnInitializedAsync()
|
||
|
|
{
|
||
|
|
_loading = true;
|
||
|
|
_orders = await OrderService.GetOrdersAsync();
|
||
|
|
_loading = false;
|
||
|
|
}
|
||
|
|
|
||
|
|
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
|
||
|
|
private static string GetStatusText(OrderStatus status) => status switch
|
||
|
|
{
|
||
|
|
OrderStatus.Paid => "پرداختشده",
|
||
|
|
_ => "در انتظار",
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|