feat : add print order , change question dialog
parent
d19937dd5c
commit
0bdd783b48
|
@ -1,14 +1,17 @@
|
|||
|
||||
@using Color = MudBlazor.Color
|
||||
@using Size = MudBlazor.Size
|
||||
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IRestWrapper RestWrapper
|
||||
@inject IUserUtility UserUtility
|
||||
@inject IDialogService DialogService
|
||||
@inject IPrintingService PrintingService
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<MudDialog class="mx-auto" DisableSidePadding="true">
|
||||
<MudDialog class="w-full">
|
||||
<DialogContent>
|
||||
<MudContainer class="max-h-[40rem] mt-4" Style="overflow-y: scroll">
|
||||
<MudGrid>
|
||||
<MudStack class="max-h-[50rem] w-full mt-4" Style="overflow-y: scroll">
|
||||
<MudGrid class="w-full">
|
||||
<MudItem xs="12" md="9">
|
||||
<MudStack>
|
||||
|
||||
|
@ -164,7 +167,9 @@
|
|||
@foreach (var item in ViewModel.PageDto.Payments)
|
||||
{
|
||||
<MudStack Row="true">
|
||||
<MudText class="my-auto" Typo="Typo.body2">@item.Type.ToDisplay()</MudText>
|
||||
<MudText class="my-auto" Typo="Typo.body2">@item.Type.ToDisplay()</MudText>
|
||||
<MudText class="my-auto" Typo="Typo.body2"> - </MudText>
|
||||
<MudText class="my-auto" Typo="Typo.body2">@item.Status.ToDisplay()</MudText>
|
||||
<MudSpacer/>
|
||||
<MudText Typo="Typo.body1"><b>@item.Amount.ToString("N0")</b> ریالــ</MudText>
|
||||
</MudStack>
|
||||
|
@ -174,7 +179,7 @@
|
|||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</MudContainer>
|
||||
</MudStack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudStack Row="true" class="w-full h-fit mx-4 mb-3 bottom-0">
|
||||
|
@ -193,7 +198,7 @@
|
|||
Icon="@Icons.Material.Outlined.Print"
|
||||
Size="Size.Small"
|
||||
Variant="Variant.Outlined" Color="Color.Info"
|
||||
OnClickCallback="@(()=> PrintingService.Print("http://localhost:32770/api/order/efc18848-fde5-4687-a9f3-0df6aff8b8ed/invoice?access_token=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJQZXJtaXNzaW9uIjpbIk1hbmFnZUJsb2dzIiwiTWFuYWdlQmxvZ3MiLCJNYW5hZ2VCcmFuZHMiLCJWaWV3QnJhbmRzIiwiTWFuYWdlQ2F0ZWdvcmllcyIsIlZpZXdDYXRlZ29yaWVzIiwiTWFuYWdlRGlzY291bnRzIiwiVmlld0Rpc2NvdW50cyIsIk1hbmFnZU9yZGVycyIsIlZpZXdBbGxPcmRlcnMiLCJWaWV3TWluZU9yZGVycyIsIkNyZWF0ZU9yZGVyIiwiTWFuYWdlUHJvZHVjdHMiLCJWaWV3UHJvZHVjdHMiLCJBZGRSZXZpZXciLCJBZGRSZXZpZXciLCJDb25maXJtUmV2aWV3IiwiVmlld0FsbFJldmlld3MiLCJWaWV3TWluZVJldmlld3MiLCJNYW5hZ2VXYXJlaG91c2VzIiwiVmlld1dhcmVob3VzZXMiLCJNYW5hZ2VTaGlwcGluZyIsIlZpZXdTaGlwcGluZyIsIk1hbmFnZVVzZXJzIiwiVmlld1VzZXJzIiwiTWFuYWdlRmlsZXMiLCJWaWV3RmlsZXMiXSwicm9sZSI6IlJvb3RBZG1pbiIsIlJvbGVJZCI6ImVmNjYxYTFkLWE2NGItNDc1NC05NDJhLWQwZTlhMWY2YWQ3NSIsIlNpZ25VcFN0YXR1cyI6IjAiLCJ1bmlxdWVfbmFtZSI6IjA5MjE0ODAyODEzIiwibmFtZWlkIjoiMjRmOTMwMDQtN2E3My00ZmRiLWE4OTMtYTRjOTkxOTRhMjBhIiwiZW1haWwiOiJhdnZhbXBpZXJAZ21haWwuY29tIiwiSnd0SUQiOiIzMmNlYTMzOCIsImdlbmRlciI6IkZlbWFsZSIsIm5iZiI6MTcwODg3MTM0NywiZXhwIjoxNzEwMTY3MzQ3LCJpYXQiOjE3MDg4NzEzNDcsImlzcyI6IkJyaXpjbyIsImF1ZCI6IkJyaXpjbyJ9.rupn8kw0V5hNkMvFkkoKo5gUbLy0k-ZxYQM-RptsRlxLhVeA9024u5tS2hY1QazxE9di8HAsebPZeVDnJ4gGuw",true))"
|
||||
OnClickCallback="@ViewModel.PrintInvoiceAsync"
|
||||
Content="چاپــ فاکتور" />
|
||||
<MudButton Variant="Variant.Outlined" Size="Size.Medium" Color="Color.Error" OnClick="ViewModel.Cancel">بستن</MudButton>
|
||||
</MudStack>
|
||||
|
@ -213,9 +218,9 @@
|
|||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if (Order == null)
|
||||
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog , PrintingService);
|
||||
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, PrintingService, JsRuntime);
|
||||
else
|
||||
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, Order, PrintingService);
|
||||
ViewModel = new OrderActionDialogBoxViewModel(Snackbar, RestWrapper, UserUtility, DialogService, MudDialog, Order , PrintingService , JsRuntime);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
using Append.Blazor.Printing;
|
||||
using NetinaShop.AdminPanel.PWA.Utilities.Models;
|
||||
using NetinaShop.Common.Extensions;
|
||||
using Syncfusion.Pdf.Graphics;
|
||||
|
||||
namespace NetinaShop.AdminPanel.PWA.Dialogs;
|
||||
|
||||
|
@ -11,10 +14,11 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
private readonly IDialogService _dialogService;
|
||||
private readonly MudDialogInstance _mudDialog;
|
||||
private readonly IPrintingService _printingService;
|
||||
private readonly IJSRuntime _jsRuntime;
|
||||
|
||||
public OrderActionDialogBoxViewModel(ISnackbar snackbar, IRestWrapper restWrapper, IUserUtility userUtility, IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
IPrintingService printingService)
|
||||
IPrintingService printingService, IJSRuntime jsRuntime)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -22,6 +26,7 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
_dialogService = dialogService;
|
||||
_mudDialog = mudDialog;
|
||||
_printingService = printingService;
|
||||
_jsRuntime = jsRuntime;
|
||||
}
|
||||
public OrderActionDialogBoxViewModel(ISnackbar snackbar,
|
||||
IRestWrapper restWrapper,
|
||||
|
@ -29,7 +34,8 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
IDialogService dialogService,
|
||||
MudDialogInstance mudDialog,
|
||||
OrderSDto order,
|
||||
IPrintingService printingService)
|
||||
IPrintingService printingService,
|
||||
IJSRuntime jsRuntime)
|
||||
{
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
|
@ -39,6 +45,7 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
PageDto.Id = order.Id;
|
||||
IsEditing = true;
|
||||
_printingService = printingService;
|
||||
_jsRuntime = jsRuntime;
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,6 +111,7 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
|
||||
public async Task PrintInvoiceAsync()
|
||||
{
|
||||
return;
|
||||
try
|
||||
{
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
|
@ -112,11 +120,11 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
IsProcessing = true;
|
||||
string fileUrl = $"{Address.OrderController}/{PageDto.Id}/invoice?access_token={token.Split("Bearer").Last().Trim()}";
|
||||
|
||||
var content = await _restWrapper.OrderRestApi.GetOrderInvoice(PageDto.Id, token);
|
||||
var bytes = await content.ReadAsByteArrayAsync();
|
||||
var base64 = Convert.ToBase64String(bytes);
|
||||
await _printingService.Print(fileUrl, showModal: true);
|
||||
Console.WriteLine(fileUrl);
|
||||
|
||||
PdfStringFormat format = new PdfStringFormat(PdfTextAlignment.Left);
|
||||
format.TextDirection = PdfTextDirection.RightToLeft;
|
||||
await _jsRuntime.InvokeVoidAsync("openFile", new {fileName = "invoice.pdf",url=fileUrl});
|
||||
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
|
@ -136,11 +144,36 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
|
||||
public async Task SubmitConfirmAsync()
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف دسته بندی اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف شرح حال", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
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();
|
||||
}
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از ثبت سفارش به {nextOrderStatus.ToDisplay()} اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
@ -150,36 +183,10 @@ public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
|
|||
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);
|
||||
_snackbar.Add($"سفارش {PageDto.FactorCode} به {nextOrderStatus.ToDisplay()} تغییر یافت", Severity.Success);
|
||||
_mudDialog.Close();
|
||||
}
|
||||
catch (ApiException ex)
|
||||
|
|
|
@ -1,17 +1,25 @@
|
|||
<MudDialog>
|
||||
<MudDialog class="overflow-y-hidden overflow-x-hidden">
|
||||
<DialogContent>
|
||||
<p>@ContentText</p>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<div class="flex flex-row w-full mt-3">
|
||||
<MudButton Color="Color.Info" Variant="Variant.Filled" OnClick="Submit" DisableElevation="true">تایید</MudButton>
|
||||
<MudStack class=" pt-8 py-8 -mb-3 w-full">
|
||||
<MudText Typo="Typo.h5" class="font-bold" Align="Align.Center">@ContentText</MudText>
|
||||
<dotlottie-player src="https://lottie.host/ca020ceb-7c2d-446f-bab7-172289c31a45/ygESvTvwHy.json"
|
||||
background="transparent" speed="1" class="mx-auto mt-4 w-40 h-40 lg:w-60 lg:h-60" loop autoplay />
|
||||
</MudStack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<MudGrid class="p-2">
|
||||
<MudItem lg="6">
|
||||
<MudButton class="w-full py-3 font-bold" Color="Color.Info" Variant="Variant.Filled" OnClick="Submit" DisableElevation="true">تایید</MudButton>
|
||||
</MudItem>
|
||||
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Error" OnClick="Cancel" class="mx-4">انصراف</MudButton>
|
||||
</div>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
@code
|
||||
{
|
||||
<MudItem lg="6">
|
||||
<MudButton class="w-full py-3 font-bold" Variant="Variant.Outlined" Color="Color.Error" OnClick="Cancel">انصراف</MudButton>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
</DialogActions>
|
||||
</MudDialog>
|
||||
@code
|
||||
{
|
||||
|
||||
[CascadingParameter]
|
||||
MudDialogInstance? MudDialog { get; set; }
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
|
||||
<AssemblyVersion>0.17.18.25</AssemblyVersion>
|
||||
<FileVersion>0.17.18.25</FileVersion>
|
||||
<AssemblyVersion>0.17.19.26</AssemblyVersion>
|
||||
<FileVersion>0.17.19.26</FileVersion>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -14,6 +14,26 @@
|
|||
<Exec Command="npm run buildcss" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="wwwroot\assets\fonts\Shabnam-Bold.ttf" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="tailwind.config.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="tailwind.config.js">
|
||||
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="wwwroot\assets\fonts\Shabnam-Bold.ttf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Append.Blazor.Printing" Version="6.3.0" />
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
|
||||
|
@ -29,6 +49,7 @@
|
|||
<PackageReference Include="Refit" Version="7.0.0" />
|
||||
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
|
||||
<PackageReference Include="Refit.Newtonsoft.Json" Version="7.0.0" />
|
||||
<PackageReference Include="Syncfusion.Pdf.Net.Core" Version="24.2.8" />
|
||||
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="2.1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -53,6 +74,7 @@
|
|||
<Using Include="NetinaShop.AdminPanel.PWA.Models.Api" />
|
||||
<Using Include="NetinaShop.AdminPanel.PWA.Services.RestServices" />
|
||||
<Using Include="NetinaShop.AdminPanel.PWA.Utilities" />
|
||||
<Using Include="NetinaShop.AdminPanel.PWA.Utilities.Models" />
|
||||
<Using Include="NetinaShop.Common.Models.Api" />
|
||||
<Using Include="NetinaShop.Common.Models.Exception" />
|
||||
<Using Include="NetinaShop.Domain.CommandQueries.Commands" />
|
||||
|
|
|
@ -111,11 +111,8 @@ public class BlogCategoriesPageViewModel:BaseViewModel<ObservableCollection<Blog
|
|||
|
||||
public async Task DeleteBlogCategoryAsync(Guid selectedCategoryId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف بلاگ اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف بلاگ", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف دسته بلاگ اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -111,11 +111,8 @@ public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>>
|
|||
|
||||
public async Task DeleteBlogAsync(Guid selectedCategoryId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف بلاگ اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف بلاگ", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف بلاگ اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -62,11 +62,8 @@ public class BrandsPageViewModel : BaseViewModel<List<BrandSDto>>
|
|||
}
|
||||
public async Task DeleteBrandAsync(Guid selectedCategoryId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف برند اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف برند", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف برند اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.ObjectModel;
|
||||
using MudBlazor;
|
||||
using NetinaShop.AdminPanel.PWA.Utilities.Models;
|
||||
using NetinaShop.Common.Models.Exception;
|
||||
|
||||
namespace NetinaShop.AdminPanel.PWA.Pages;
|
||||
|
@ -114,11 +115,8 @@ public class CategoriesPageViewModel : BaseViewModel<ObservableCollection<Produc
|
|||
|
||||
public async Task DeleteProductCategoryAsync(Guid selectedCategoryId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف دسته بندی اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف شرح حال", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف دسته بندی اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MudBlazor;
|
||||
using NetinaShop.AdminPanel.PWA.Utilities.Models;
|
||||
using NetinaShop.Domain.Entities.Discounts;
|
||||
|
||||
namespace NetinaShop.AdminPanel.PWA.Pages;
|
||||
|
@ -127,11 +128,8 @@ public class DiscountPageViewModel : BaseViewModel<ObservableCollection<Discount
|
|||
|
||||
public async Task DeleteAsync(Guid selectedDiscountId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف تخفیف اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف تخفیف", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف تخفیف اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class OrdersPageViewModel : BaseViewModel
|
|||
|
||||
public async Task ShowClicked(OrderSDto order)
|
||||
{
|
||||
DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.Large, NoHeader = true, FullWidth = true, DisableBackdropClick = true };
|
||||
DialogOptions maxWidth = new DialogOptions() { MaxWidth = MaxWidth.False, NoHeader = true, FullWidth = true, DisableBackdropClick = true };
|
||||
var parameters = new DialogParameters<OrderActionDialogBox>();
|
||||
parameters.Add(x => x.Order, order);
|
||||
var dialogResult = await _dialogService.ShowAsync<OrderActionDialogBox>($" سفارش {order.FactorCode}", parameters, maxWidth);
|
||||
|
|
|
@ -132,11 +132,8 @@ public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductS
|
|||
|
||||
public async Task DeleteProductAsync(Guid selectedCategoryId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف محصول اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف شرح حال", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف محصول اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -121,11 +121,8 @@ public class ShippingPageViewModel : BaseViewModel<ObservableCollection<Shipping
|
|||
|
||||
public async Task DeleteAsync(Guid selectedCategoryId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف روش ارسال اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف روش ارسال", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف روش ارسال اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -182,11 +182,8 @@ public class UserSettingsPageViewModel : BaseViewModel
|
|||
|
||||
public async Task DeleteRoleAsync(Guid selectedRoleId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف نقش اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف نقش", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف نقش اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
@ -245,11 +242,8 @@ public class UserSettingsPageViewModel : BaseViewModel
|
|||
|
||||
public async Task DeleteUserAsync(Guid selectedUserId)
|
||||
{
|
||||
var options = new DialogOptions { CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, "آیا از حذف کاربر اطمینان دارید ?");
|
||||
var dialogReference = await _dialogService.ShowAsync<QuestionDialog>("حذف کاربر", parameters, options);
|
||||
var result = await dialogReference.Result;
|
||||
var reference = await _dialogService.ShowQuestionDialog($"آیا از حذف کاربر اطمینان دارید ?");
|
||||
var result = await reference.Result;
|
||||
if (!result.Canceled)
|
||||
{
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
namespace NetinaShop.AdminPanel.PWA.Utilities.Models;
|
||||
|
||||
public static class DialogUtility
|
||||
{
|
||||
public static async Task<IDialogReference> ShowQuestionDialog(this IDialogService dialogService, string question)
|
||||
{
|
||||
var options = new DialogOptions { MaxWidth = MaxWidth.Small, FullWidth = true,NoHeader = true, CloseOnEscapeKey = true };
|
||||
var parameters = new DialogParameters<QuestionDialog>();
|
||||
parameters.Add(x => x.ContentText, question);
|
||||
var dialogReference = await dialogService.ShowAsync<QuestionDialog>(string.Empty, parameters, options);
|
||||
return dialogReference;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"version": "0.17.18.25",
|
||||
"versionNumber": 0.171825,
|
||||
"version": "0.17.19.26",
|
||||
"versionNumber": 0.171926,
|
||||
"versionName": "چرتکه",
|
||||
"description": "",
|
||||
"features": [
|
||||
"افزودن تم دارک",
|
||||
"تکمیل پروسه سفارش گیری",
|
||||
"قابلیت افزودن تصویر به برند ها",
|
||||
"قابلیت افزودن تصویر به دسته بندی محصولات"
|
||||
"قابلیت افزودن تصویر به دسته بندی محصولات",
|
||||
"تغییر دیالوگ پرسشی"
|
||||
],
|
||||
"bugFixes": [
|
||||
"حل مشکلات امنیتی",
|
||||
|
|
Binary file not shown.
|
@ -1104,6 +1104,9 @@ input:checked + .toggle-bg {
|
|||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
.-mb-3 {
|
||||
margin-bottom: -0.75rem;
|
||||
}
|
||||
.-ml-4 {
|
||||
margin-left: -1rem;
|
||||
}
|
||||
|
@ -1230,6 +1233,9 @@ input:checked + .toggle-bg {
|
|||
.h-4 {
|
||||
height: 1rem;
|
||||
}
|
||||
.h-40 {
|
||||
height: 10rem;
|
||||
}
|
||||
.h-5 {
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
@ -1273,8 +1279,8 @@ input:checked + .toggle-bg {
|
|||
.max-h-\[30rem\] {
|
||||
max-height: 30rem;
|
||||
}
|
||||
.max-h-\[40rem\] {
|
||||
max-height: 40rem;
|
||||
.max-h-\[50rem\] {
|
||||
max-height: 50rem;
|
||||
}
|
||||
.min-h-\[33rem\] {
|
||||
min-height: 33rem;
|
||||
|
@ -1300,6 +1306,9 @@ input:checked + .toggle-bg {
|
|||
.w-4 {
|
||||
width: 1rem;
|
||||
}
|
||||
.w-40 {
|
||||
width: 10rem;
|
||||
}
|
||||
.w-5 {
|
||||
width: 1.25rem;
|
||||
}
|
||||
|
@ -1671,6 +1680,9 @@ input:checked + .toggle-bg {
|
|||
.pt-4 {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
.pt-8 {
|
||||
padding-top: 2rem;
|
||||
}
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -2126,6 +2138,10 @@ code {
|
|||
|
||||
@media (min-width: 1024px) {
|
||||
|
||||
.lg\:h-60 {
|
||||
height: 15rem;
|
||||
}
|
||||
|
||||
.lg\:h-96 {
|
||||
height: 24rem;
|
||||
}
|
||||
|
@ -2142,6 +2158,10 @@ code {
|
|||
max-height: 35rem;
|
||||
}
|
||||
|
||||
.lg\:w-60 {
|
||||
width: 15rem;
|
||||
}
|
||||
|
||||
.lg\:w-96 {
|
||||
width: 24rem;
|
||||
}
|
||||
|
|
|
@ -1298,6 +1298,10 @@ input:checked + .toggle-bg {
|
|||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
.-mb-3 {
|
||||
margin-bottom: -0.75rem;
|
||||
}
|
||||
|
||||
.line-clamp-1 {
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
|
@ -1402,6 +1406,10 @@ input:checked + .toggle-bg {
|
|||
height: 100vh;
|
||||
}
|
||||
|
||||
.h-40 {
|
||||
height: 10rem;
|
||||
}
|
||||
|
||||
.\!max-h-\[80vh\] {
|
||||
max-height: 80vh !important;
|
||||
}
|
||||
|
@ -1414,8 +1422,8 @@ input:checked + .toggle-bg {
|
|||
max-height: 30rem;
|
||||
}
|
||||
|
||||
.max-h-\[40rem\] {
|
||||
max-height: 40rem;
|
||||
.max-h-\[50rem\] {
|
||||
max-height: 50rem;
|
||||
}
|
||||
|
||||
.min-h-\[33rem\] {
|
||||
|
@ -1483,6 +1491,10 @@ input:checked + .toggle-bg {
|
|||
width: 100vw;
|
||||
}
|
||||
|
||||
.w-40 {
|
||||
width: 10rem;
|
||||
}
|
||||
|
||||
.flex-1 {
|
||||
flex: 1 1 0%;
|
||||
}
|
||||
|
@ -1920,6 +1932,11 @@ input:checked + .toggle-bg {
|
|||
padding-bottom: 2rem;
|
||||
}
|
||||
|
||||
.py-5 {
|
||||
padding-top: 1.25rem;
|
||||
padding-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.pt-2 {
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
@ -1928,6 +1945,18 @@ input:checked + .toggle-bg {
|
|||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.pl-8 {
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
.pr-8 {
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
.pt-8 {
|
||||
padding-top: 2rem;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -2461,6 +2490,14 @@ code {
|
|||
height: 38rem;
|
||||
}
|
||||
|
||||
.lg\:h-80 {
|
||||
height: 20rem;
|
||||
}
|
||||
|
||||
.lg\:h-60 {
|
||||
height: 15rem;
|
||||
}
|
||||
|
||||
.lg\:max-h-\[25rem\] {
|
||||
max-height: 25rem;
|
||||
}
|
||||
|
@ -2477,6 +2514,14 @@ code {
|
|||
width: 38rem;
|
||||
}
|
||||
|
||||
.lg\:w-80 {
|
||||
width: 20rem;
|
||||
}
|
||||
|
||||
.lg\:w-60 {
|
||||
width: 15rem;
|
||||
}
|
||||
|
||||
.lg\:p-8 {
|
||||
padding: 2rem;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<script src="_framework/blazor.webassembly.js"></script>
|
||||
|
||||
<script src="aes-js-3.1.2.js"></script>
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
function encryptText(inputSrt, keyArray) {
|
||||
var textBytes = aesjs.utils.utf8.toBytes(inputSrt);
|
||||
var aesCtr = new aesjs.ModeOfOperation.ctr(keyArray, new aesjs.Counter(5));
|
||||
|
@ -77,6 +77,38 @@
|
|||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function saveAsFile(filename, bytesBase64) {
|
||||
if (navigator.msSaveBlob) {
|
||||
var data = window.atob(bytesBase64);
|
||||
var bytes = new Unit8Array(data.length);
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
bytes[i] = data.charCodeAt(i);
|
||||
}
|
||||
var blob = new Blob([bytes.buffer], { type: "application/octet-stream" });
|
||||
navigator.msSaveBlob(blob, filename);
|
||||
}
|
||||
else {
|
||||
var link = document.createElement('a');
|
||||
link.download = filename;
|
||||
link.href = "data:application/octet-stream;base64," + bytesBase64;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function openFile(data) {
|
||||
var link = this.document.createElement('a');
|
||||
link.download = data.fileName;
|
||||
link.href = data.url;
|
||||
link.target = "_blank";
|
||||
this.document.body.appendChild(link);
|
||||
link.click();
|
||||
this.document.body.removeChild(link);
|
||||
}
|
||||
</script>
|
||||
<script src="ckeditor.js"></script>
|
||||
|
||||
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script>
|
||||
|
|
Loading…
Reference in New Issue