diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/BlogActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/BlogActionDialogBox.razor index cca1243..300e619 100644 --- a/NetinaShop.AdminPanel.PWA/Dialogs/BlogActionDialogBox.razor +++ b/NetinaShop.AdminPanel.PWA/Dialogs/BlogActionDialogBox.razor @@ -6,9 +6,6 @@ @inject IUserUtility UserUtility @inject IDialogService DialogService - - - 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 @@ - - - - -
- + + + + +
+ - اطلاعات کلی - اطلاعات کلی محصول را به دقت وارد کنید - - + اطلاعات کلی + اطلاعات کلی محصول را به دقت وارد کنید + + - - - - - - + + + + + + - - - - -
- -

منتظر بمانید

-
-
-
-
- -

@e.Name

-
-
-
+ + + + +
+ +

منتظر بمانید

+
+
+
+
+ +

@e.Name

+
+
+ - - - - -
- -

منتظر بمانید

-
-
-
-
- -

@e.PersianName

-
-
-
- + + + + +
+ +

منتظر بمانید

+
+
+
+
+ +

@e.PersianName

+
+
+
+ - - + + - - + + - - - - + - - - - - - - - + + - - - - - - - - - - + + + + + + + + + + + + + + - - -
-
-
- -
- - - - ویژگی های کلی - می توانید ویگی های تکمیلی محصول را کامل وارد کنید - - - - - - - - - - - - - افزودن - - - - - - - - - - - حذف + + - - - - - - -
-
- + + + + + +
+
+ +
-
- + - توضیحات تکمیلی - می توانید توضیحاتــ تکمیلی محصول را کامل وارد کنید - - - - - + ویژگی های کلی + می توانید ویگی های تکمیلی محصول را کامل وارد کنید + + - - -
- - + + + -
- + + + - تصاویر محصول - می توانید برای محصول چند تصویر اپلود کنید - - - - - @foreach (var item in ViewModel.Files) - { -
- + + افزودن + - - @if (item.IsHeader) - { -

هدر

- } - @if (item.IsPrimary) - { -

اصلی

- } -
- } + + + + + + + + + حذف + + + + + + + +
+
+ - -
+
+ - + توضیحات تکمیلی + می توانید توضیحاتــ تکمیلی محصول را کامل وارد کنید + + + - + -
- - - - - - - + + +
+
+ - - - - -
+
+ - + تصاویر محصول + می توانید برای محصول چند تصویر اپلود کنید + + + + + @foreach (var item in ViewModel.Files) + { +
+ + + + @if (item.IsHeader) + { +

هدر

+ } + @if (item.IsPrimary) + { +

اصلی

+ } +
+ } + +
+
+ + + + + +
+ + + + + + + + + + + + + + + - + - - - - - - - - - - - - - + + + - -
-
- - - - - + + - @if (ViewModel.IsEditing) - { - - } - else - { - - } - - بستن - - + + + + + + + +
+
+
+
+
+
+ + + + @if (ViewModel.IsEditing) + { + + } + else + { + + } + + بستن + +
@code { diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/ProductCategoryActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/ProductCategoryActionDialogBox.razor index eb4069e..51e7186 100644 --- a/NetinaShop.AdminPanel.PWA/Dialogs/ProductCategoryActionDialogBox.razor +++ b/NetinaShop.AdminPanel.PWA/Dialogs/ProductCategoryActionDialogBox.razor @@ -1,16 +1,10 @@ -@using NetinaShop.Common.Models.Exception -@using NetinaShop.Domain.CommandQueries.Commands -@using Radzen.Blazor - -@inject ISnackbar Snackbar +@inject ISnackbar Snackbar @inject IRestWrapper RestWrapper @inject IUserUtility UserUtility - - - + - + @@ -23,7 +17,7 @@ - + @@ -49,7 +43,7 @@ - + توضیحات تکمیلی diff --git a/NetinaShop.AdminPanel.PWA/Models/Address.cs b/NetinaShop.AdminPanel.PWA/Models/Address.cs index b1fb35c..828f544 100644 --- a/NetinaShop.AdminPanel.PWA/Models/Address.cs +++ b/NetinaShop.AdminPanel.PWA/Models/Address.cs @@ -3,8 +3,8 @@ public static class Address { #if DEBUG - //public static string BaseAddress = "http://localhost:32770/api"; - public static string BaseAddress = "https://api.vesmook.com/api"; + public static string BaseAddress = "http://localhost:32770/api"; + //public static string BaseAddress = "https://api.vesmook.com/api"; #else public static string BaseAddress = "https://api.vesmook.com/api"; #endif diff --git a/NetinaShop.AdminPanel.PWA/Models/MainTheme.cs b/NetinaShop.AdminPanel.PWA/Models/MainTheme.cs index 6556a60..6ee391b 100644 --- a/NetinaShop.AdminPanel.PWA/Models/MainTheme.cs +++ b/NetinaShop.AdminPanel.PWA/Models/MainTheme.cs @@ -19,7 +19,7 @@ public static class MainTheme }, PaletteDark = new PaletteDark() { - Primary = "#001A46", + Primary = "#E59F2E", Secondary = "#E59F2E", } }; diff --git a/NetinaShop.AdminPanel.PWA/NetinaShop.AdminPanel.PWA.csproj b/NetinaShop.AdminPanel.PWA/NetinaShop.AdminPanel.PWA.csproj index 9f38236..ccaacd9 100644 --- a/NetinaShop.AdminPanel.PWA/NetinaShop.AdminPanel.PWA.csproj +++ b/NetinaShop.AdminPanel.PWA/NetinaShop.AdminPanel.PWA.csproj @@ -5,8 +5,8 @@ enable enable service-worker-assets.js - 0.17.16.23 - 0.17.16.23 + 0.17.18.25 + 0.17.18.25 $(MSBuildProjectName) diff --git a/NetinaShop.AdminPanel.PWA/Services/RestServices/IOrderRestApi.cs b/NetinaShop.AdminPanel.PWA/Services/RestServices/IOrderRestApi.cs index 954cedc..1adac03 100644 --- a/NetinaShop.AdminPanel.PWA/Services/RestServices/IOrderRestApi.cs +++ b/NetinaShop.AdminPanel.PWA/Services/RestServices/IOrderRestApi.cs @@ -7,4 +7,7 @@ public interface IOrderRestApi [Get("/{id}")] Task ReadOne(Guid id, [Header("Authorization")] string authorization); + + [Post("/{id}/confirm")] + Task ConfirmOrderStepAsync(Guid id,[Query] OrderStatus nextOrderStatus , [Header("Authorization")] string authorization); } \ No newline at end of file diff --git a/NetinaShop.AdminPanel.PWA/version.json b/NetinaShop.AdminPanel.PWA/version.json index d0de1a4..0aac904 100644 --- a/NetinaShop.AdminPanel.PWA/version.json +++ b/NetinaShop.AdminPanel.PWA/version.json @@ -1,5 +1,5 @@ { - "version": "0.17.16.23", + "version": "0.17.18.25", "versionNumber": 0.101623, "versionName": "چرتکه", "description": "", diff --git a/NetinaShop.AdminPanel.PWA/wwwroot/css/app.min.css b/NetinaShop.AdminPanel.PWA/wwwroot/css/app.min.css index 096a869..4d17956 100644 --- a/NetinaShop.AdminPanel.PWA/wwwroot/css/app.min.css +++ b/NetinaShop.AdminPanel.PWA/wwwroot/css/app.min.css @@ -1076,6 +1076,10 @@ input:checked + .toggle-bg { margin-left: 1rem; margin-right: 1rem; } +.mx-5 { + margin-left: 1.25rem; + margin-right: 1.25rem; +} .mx-auto { margin-left: auto; margin-right: auto; @@ -1437,6 +1441,9 @@ input:checked + .toggle-bg { .overflow-x-hidden { overflow-x: hidden; } +.overflow-y-hidden { + overflow-y: hidden; +} .overflow-x-scroll { overflow-x: scroll; } diff --git a/NetinaShop.AdminPanel.PWA/wwwroot/css/app.output.css b/NetinaShop.AdminPanel.PWA/wwwroot/css/app.output.css index 5d86be2..d79945e 100644 --- a/NetinaShop.AdminPanel.PWA/wwwroot/css/app.output.css +++ b/NetinaShop.AdminPanel.PWA/wwwroot/css/app.output.css @@ -1155,6 +1155,11 @@ input:checked + .toggle-bg { margin-right: 1rem; } +.mx-5 { + margin-left: 1.25rem; + margin-right: 1.25rem; +} + .mx-auto { margin-left: auto; margin-right: auto; @@ -1628,6 +1633,10 @@ input:checked + .toggle-bg { overflow-x: hidden; } +.overflow-y-hidden { + overflow-y: hidden; +} + .overflow-x-scroll { overflow-x: scroll; }