-
-
diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor
index e692cdc..8100cec 100644
--- a/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor
+++ b/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor
@@ -34,10 +34,10 @@
- @ViewModel.PageDto.OrderDelivery.Address
+ @ViewModel.PageDto?.OrderDelivery?.Address
- @ViewModel.PageDto.OrderDelivery.ShippingMethod
+ @ViewModel.PageDto?.OrderDelivery?.ShippingMethod
@@ -180,18 +180,18 @@
+ Content="@ViewModel.ConfirmOrderButtonText" OnClickCallback="ViewModel.SubmitConfirmAsync" />
+ Content="لغو سفارش" />
+ Content="چاپــ فاکتور" />
بستن
diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor.cs b/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor.cs
index 79964ac..8de30ae 100644
--- a/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor.cs
+++ b/NetinaShop.AdminPanel.PWA/Dialogs/OrderActionDialogBox.razor.cs
@@ -36,6 +36,8 @@ public class OrderActionDialogBoxViewModel : BaseViewModel
public void Cancel() => _mudDialog.Cancel();
+ public string ConfirmOrderButtonText { get; set; } = string.Empty;
+
public bool IsEditing = false;
@@ -54,6 +56,23 @@ public class OrderActionDialogBoxViewModel : BaseViewModel
var order = await _restWrapper.OrderRestApi.ReadOne(PageDto.Id, token);
PageDto = order;
+ switch (PageDto.OrderStatus)
+ {
+ case OrderStatus.Submitted:
+ ConfirmOrderButtonText = "ثبت پرداختی سفارش";
+ break;
+ case OrderStatus.Paid:
+ ConfirmOrderButtonText = "ثبت سفارش";
+ break;
+ case OrderStatus.Processing:
+ ConfirmOrderButtonText = "ثبت ارسال سفارش";
+ break;
+ case OrderStatus.Delivered:
+ ConfirmOrderButtonText = "ثبت انجام سفارش";
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
}
catch (ApiException ex)
{
@@ -74,29 +93,71 @@ public class OrderActionDialogBoxViewModel : BaseViewModel
};
}
- public async Task SubmitEditAsync()
+ public async Task SubmitConfirmAsync()
{
- try
- {
- IsProcessing = true;
- _snackbar.Add($"ویرایش سفارش {PageDto.FactorCode} با موفقیت انجام شد", Severity.Success);
- _mudDialog.Close();
- }
- catch (ApiException ex)
- {
- var exe = await ex.GetContentAsAsync();
- _snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
- _mudDialog.Cancel();
- }
- catch (Exception e)
- {
- _snackbar.Add(e.Message, Severity.Error);
- _mudDialog.Cancel();
- }
- finally
+ var options = new DialogOptions { CloseOnEscapeKey = true };
+ var parameters = new DialogParameters();
+ parameters.Add(x => x.ContentText, "آیا از حذف دسته بندی اطمینان دارید ?");
+ var dialogReference = await _dialogService.ShowAsync("حذف شرح حال", parameters, options);
+ var result = await dialogReference.Result;
+ if (!result.Canceled)
{
- IsProcessing = false;
+ try
+ {
+ var token = await _userUtility.GetBearerTokenAsync();
+ if (token == null)
+ throw new Exception("Token is null");
+ IsProcessing = true;
+ OrderStatus nextOrderStatus = OrderStatus.Canceled;
+ switch (PageDto.OrderStatus)
+ {
+ case OrderStatus.OrderBag:
+ return;
+ break;
+ case OrderStatus.Submitted:
+ nextOrderStatus = OrderStatus.Paid;
+ break;
+ case OrderStatus.Paid:
+ nextOrderStatus = OrderStatus.Processing;
+ break;
+ case OrderStatus.Processing:
+ nextOrderStatus = OrderStatus.Delivered;
+ break;
+ case OrderStatus.Delivered:
+ nextOrderStatus = OrderStatus.Done;
+ break;
+ case OrderStatus.Done:
+ return;
+ break;
+ case OrderStatus.Canceled:
+ return;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException();
+ }
+
+ await _restWrapper.OrderRestApi.ConfirmOrderStepAsync(PageDto.Id, nextOrderStatus, token);
+ _snackbar.Add($"ویرایش سفارش {PageDto.FactorCode} با موفقیت انجام شد", Severity.Success);
+ _mudDialog.Close();
+ }
+ catch (ApiException ex)
+ {
+ var exe = await ex.GetContentAsAsync();
+ _snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
+ _mudDialog.Cancel();
+ }
+ catch (Exception e)
+ {
+ _snackbar.Add(e.Message, Severity.Error);
+ _mudDialog.Cancel();
+ }
+ finally
+ {
+
+ IsProcessing = false;
+ }
}
+
}
}
\ No newline at end of file
diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor
index bdc3478..fa75cfa 100644
--- a/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor
+++ b/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor
@@ -7,286 +7,286 @@
-
-
-
-
-
-
+
+
+
+
+
+
- اطلاعات کلی
- اطلاعات کلی محصول را به دقت وارد کنید
-
-
+ اطلاعات کلی
+ اطلاعات کلی محصول را به دقت وارد کنید
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
- توضیحات تکمیلی
- می توانید توضیحاتــ تکمیلی محصول را کامل وارد کنید
-
-
-
-
-
+ ویژگی های کلی
+ می توانید ویگی های تکمیلی محصول را کامل وارد کنید
+
+
-
-
-
-
-
+
+
+
-
-
+
+
+
- تصاویر محصول
- می توانید برای محصول چند تصویر اپلود کنید
-
-
-
-
- @foreach (var item in ViewModel.Files)
- {
-
-
+
+ افزودن
+
-
- @if (item.IsHeader)
- {
-
هدر
- }
- @if (item.IsPrimary)
- {
-
اصلی
- }
-
- }
+
+
+
+
+
+
+
+
+ حذف
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+ توضیحات تکمیلی
+ می توانید توضیحاتــ تکمیلی محصول را کامل وارد کنید
+
+
+
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
-
+ تصاویر محصول
+ می توانید برای محصول چند تصویر اپلود کنید
+
+
+
+
+ @foreach (var item in ViewModel.Files)
+ {
+