Files
FrontOffice/src/FrontOffice.Main/Pages/Store/Orders.razor.cs

36 lines
1.0 KiB
C#

using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
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<GetUserOrderResponse> _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 string GetStatusText(PaymentStatus contextPaymentStatus)
{
return contextPaymentStatus switch
{
PaymentStatus.Pending => "در انتظار پرداخت",
PaymentStatus.Success => "پرداخت شده",
PaymentStatus.Reject => "پرداخت ناموفق",
_ => "نامشخص",
};
}
}