85 lines
2.8 KiB
Plaintext
85 lines
2.8 KiB
Plaintext
![]() |
@using Front.Services
|
||
|
@using Shared.DTOs
|
||
|
@inject HttpClientController hc;
|
||
|
<Preload LoadingText="در حال بارگذاری..." />
|
||
|
@* alert *@
|
||
|
<div class="row">
|
||
|
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||
|
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||
|
@alertMessage
|
||
|
</Alert>
|
||
|
|
||
|
</div>
|
||
|
<div class="row g-3">
|
||
|
<div class="col-md-4">
|
||
|
<label class="col-sm-5 col-form-label">وضغیت</label>
|
||
|
<InputText @value="order.StatusTitle" type="text" class="form-control" id="StatusTitle" placeholder="وضغیت" />
|
||
|
</div>
|
||
|
<div class="col-md-4">
|
||
|
<label class="col-sm-5 col-form-label">تاریخ ایحاد</label>
|
||
|
<InputText @bind-Value="order.DateCreate" type="text" class="form-control" id="DateCreate" placeholder="تاریخ ایجاد" />
|
||
|
</div>
|
||
|
@if (order.Status!=StatusOrder.Create)
|
||
|
{
|
||
|
<div class="col-md-4">
|
||
|
<label class="col-sm-5 col-form-label">@titledateapp</label>
|
||
|
<InputText @bind-Value="order.ApprovalDate" type="text" class="form-control" id="ApprovalDate" placeholder="@titledateapp" />
|
||
|
</div>
|
||
|
}
|
||
|
|
||
|
</div>
|
||
|
|
||
|
@code {
|
||
|
|
||
|
#region Alert
|
||
|
// alert
|
||
|
AlertColor alertColor = AlertColor.Primary;
|
||
|
IconName alertIconName = IconName.CheckCircleFill;
|
||
|
bool Hidealert = true;
|
||
|
string alertMessage = "";
|
||
|
#endregion
|
||
|
|
||
|
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||
|
[Parameter] public EventCallback<ActionInResultComponent> OnMultipleOfThree { get; set; }
|
||
|
[Parameter] public OrderDto order { get; set; }
|
||
|
List<OrderItemDto> OrderItems = new List<OrderItemDto>();
|
||
|
string titledateapp = "تاریخ";
|
||
|
protected override async Task OnParametersSetAsync()
|
||
|
{
|
||
|
if (order.Status==StatusOrder.Cancel)
|
||
|
{
|
||
|
titledateapp += " ابطال";
|
||
|
}
|
||
|
else if (order.Status == StatusOrder.Cancel)
|
||
|
{
|
||
|
titledateapp += " پرداخت";
|
||
|
}
|
||
|
await base.OnParametersSetAsync();
|
||
|
}
|
||
|
}
|
||
|
@functions{
|
||
|
private void ShowSuccessAlert(string msg)
|
||
|
{
|
||
|
Hidealert = false;
|
||
|
alertColor = AlertColor.Success;
|
||
|
alertIconName = IconName.CheckCircleFill;
|
||
|
alertMessage = msg;
|
||
|
}
|
||
|
private void ShowDangerAlert(string msg)
|
||
|
{
|
||
|
Hidealert = false;
|
||
|
alertColor = AlertColor.Danger;
|
||
|
alertIconName = IconName.ExclamationTriangleFill;
|
||
|
alertMessage = msg;
|
||
|
}
|
||
|
private async Task LoadOrderItem(){
|
||
|
|
||
|
PreloadService.Show(SpinnerColor.Dark);
|
||
|
var rsp = await hc.Get($"Orderss/GetOrderDetails/{order.ID}");
|
||
|
if (rsp.IsSuccessStatusCode)
|
||
|
OrderItems = await rsp.Content.ReadFromJsonAsync<List<OrderItemDto>?>();
|
||
|
else
|
||
|
ShowDangerAlert("خطایی در بارگیری");
|
||
|
PreloadService.Hide();
|
||
|
}
|
||
|
}
|