diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor index 77b033f..3b9cbfc 100644 --- a/NetinaShop.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor +++ b/NetinaShop.AdminPanel.PWA/Dialogs/DiscountActionDialogBox.razor @@ -31,7 +31,7 @@ - + @@ -47,21 +47,21 @@ - + - + - + - + diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor index 4097aa5..4a340b7 100644 --- a/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor +++ b/NetinaShop.AdminPanel.PWA/Dialogs/ProductActionDialogBox.razor @@ -74,16 +74,16 @@ - + - + - + - + @@ -282,11 +282,11 @@ - + - + diff --git a/NetinaShop.AdminPanel.PWA/Dialogs/ShippingActionDialogBox.razor b/NetinaShop.AdminPanel.PWA/Dialogs/ShippingActionDialogBox.razor index 7f49522..c2183b2 100644 --- a/NetinaShop.AdminPanel.PWA/Dialogs/ShippingActionDialogBox.razor +++ b/NetinaShop.AdminPanel.PWA/Dialogs/ShippingActionDialogBox.razor @@ -31,7 +31,7 @@ - + diff --git a/NetinaShop.AdminPanel.PWA/NetinaShop.AdminPanel.PWA.csproj b/NetinaShop.AdminPanel.PWA/NetinaShop.AdminPanel.PWA.csproj index 06f73b8..ad49088 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.2.5.11 - 0.2.5.11 + 0.4.3.12 + 0.4.3.12 diff --git a/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor b/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor index 3274c2a..2d13f52 100644 --- a/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor +++ b/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor @@ -35,12 +35,44 @@ OnAdornmentClick="@ViewModel.SearchAsync"> - - - - - - + + + @if (context.Item.HasCode) + { +

@context.Item.Code

+ } + else + { +

بدون کد

+ } +
+
+ + + +

@context.Item.StartDate.ToPersianDateTime().ToLongDateString()

+
+
+ + + +

@context.Item.ExpireDate.ToPersianDateTime().ToLongDateString()

+
+
+ + + + + @if (context.Item.IsInfinity) + { +

--

+ } + else + { +

@context.Item.Count

+ } +
+
diff --git a/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor.cs b/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor.cs index f2f0bad..0142d0b 100644 --- a/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor.cs +++ b/NetinaShop.AdminPanel.PWA/Pages/DiscountPage.razor.cs @@ -1,4 +1,5 @@ -using NetinaShop.Domain.Entities.Discounts; +using MudBlazor; +using NetinaShop.Domain.Entities.Discounts; namespace NetinaShop.AdminPanel.PWA.Pages; @@ -103,7 +104,12 @@ public class DiscountPageViewModel : BaseViewModel("افزودن بلاگ جدید", maxWidth); + var dialogResult = await _dialogService.ShowAsync("افزودن تخفیف جدید", maxWidth); + var result = await dialogResult.Result; + if (!result.Canceled && result.Data is bool and true) + { + await InitializeAsync(); + } } public async Task EditAsync(DiscountSDto discount) @@ -111,7 +117,12 @@ public class DiscountPageViewModel : BaseViewModel(); parameters.Add(x => x.Discount, discount); - await _dialogService.ShowAsync($"ویرایش تخفیف {discount.Code}", parameters, maxWidth); + var dialogResult= await _dialogService.ShowAsync($"ویرایش تخفیف {discount.Code}", parameters, maxWidth); + var result = await dialogResult.Result; + if (!result.Canceled && result.Data is bool and true) + { + await InitializeAsync(); + } } public async Task DeleteAsync(Guid selectedDiscountId) @@ -119,7 +130,7 @@ public class DiscountPageViewModel : BaseViewModel(); parameters.Add(x => x.ContentText, "آیا از حذف تخفیف اطمینان دارید ?"); - var dialogReference = await _dialogService.ShowAsync("حذف بلاگ", parameters, options); + var dialogReference = await _dialogService.ShowAsync("حذف تخفیف", parameters, options); var result = await dialogReference.Result; if (!result.Canceled) { @@ -131,7 +142,7 @@ public class DiscountPageViewModel : BaseViewModel(Address.BlogController) + await _restWrapper.CrudDtoApiRest(Address.DiscountController) .Delete(selectedDiscountId, token); _snackbar.Add("حذف تخفیف با موفقیت انجام شد", Severity.Success); diff --git a/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor b/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor index f40499f..1ecf0b5 100644 --- a/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor +++ b/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor @@ -78,7 +78,11 @@ } - + + +

@context.Item.Cost.ToString("N0") ریالــ

+
+
diff --git a/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor.cs b/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor.cs index 453ef43..a2c5cb2 100644 --- a/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor.cs +++ b/NetinaShop.AdminPanel.PWA/Pages/ProductsPage.razor.cs @@ -1,4 +1,6 @@ -namespace NetinaShop.AdminPanel.PWA.Pages; +using MudBlazor; + +namespace NetinaShop.AdminPanel.PWA.Pages; public class ProductsPageViewModel : BaseViewModel> { @@ -95,7 +97,12 @@ public class ProductsPageViewModel : BaseViewModel("افزودن محصول جدید", maxWidth); + var dialogResult = await _dialogService.ShowAsync("افزودن محصول جدید", maxWidth); + var result = await dialogResult.Result; + if (!result.Canceled && result.Data is bool and true) + { + await InitializeAsync(); + } } public async Task EditProductClicked(ProductSDto product) @@ -103,7 +110,12 @@ public class ProductsPageViewModel : BaseViewModel(); parameters.Add(x => x.Product, product); - await _dialogService.ShowAsync($"ویرایش محصول {product.PersianName}", parameters, maxWidth); + var dialogResult = await _dialogService.ShowAsync($"ویرایش محصول {product.PersianName}", parameters, maxWidth); + var result = await dialogResult.Result; + if (!result.Canceled && result.Data is bool and true) + { + await InitializeAsync(); + } } public async Task DeleteProductAsync(Guid selectedCategoryId) @@ -124,6 +136,7 @@ public class ProductsPageViewModel : BaseViewModel(Address.ProductController) .Delete(selectedCategoryId, token); _snackbar.Add("حذف محصول با موفقیت انجام شد", Severity.Success); + await InitializeAsync(); } catch (ApiException ex)