Compare commits

...

2 Commits

162 changed files with 528 additions and 212 deletions

View File

@ -1,4 +1,6 @@
@using NetinaShop.AdminPanel.PWA.Pages @using Netina.AdminPanel.PWA.Models
@using Netina.AdminPanel.PWA.Layout
@using Netina.AdminPanel.PWA.Pages
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
<Router AppAssembly="@typeof(App).Assembly"> <Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData"> <Found Context="routeData">

View File

@ -63,14 +63,13 @@
</MudNavGroup> </MudNavGroup>
<MudNavGroup Title="فروشگاه من" Expanded="false" <MudNavGroup Title="فروشگاه من" Expanded="false" Icon="@Icons.Material.Outlined.Settings">
Icon="@Icons.Material.Outlined.Settings"> <MudNavLink Href="management/shop" Icon="@Icons.Material.Filled.Shop2">فروشگاه</MudNavLink>
<MudNavLink Href="management/marketer" Icon="@Icons.Material.Filled.Person4">بازاریاب ها</MudNavLink>
<MudNavLink Href="management/faqs" Icon="@Icons.Material.Filled.ManageAccounts">سوالات متداول</MudNavLink> <MudNavLink Href="management/faqs" Icon="@Icons.Material.Filled.ManageAccounts">سوالات متداول</MudNavLink>
</MudNavGroup> </MudNavGroup>
<MudNavGroup Title="تنظیماتـــ" Expanded="false" <MudNavGroup Title="تنظیماتـــ" Expanded="false" Icon="@Icons.Material.Outlined.Settings">
Icon="@Icons.Material.Outlined.Settings">
<MudNavLink Href="management/shop" Icon="@Icons.Material.Filled.Shop2">فروشگاه</MudNavLink>
<MudNavLink Href="setting/users" Icon="@Icons.Material.Filled.ManageAccounts">نقش ها و کاربران</MudNavLink> <MudNavLink Href="setting/users" Icon="@Icons.Material.Filled.ManageAccounts">نقش ها و کاربران</MudNavLink>
</MudNavGroup> </MudNavGroup>
</MudNavMenu> </MudNavMenu>

View File

@ -1,7 +1,4 @@
@using Radzen.Blazor @inject ISnackbar Snackbar
@using NetinaShop.AdminPanel.PWA.Extensions
@inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject IUserUtility UserUtility @inject IUserUtility UserUtility
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,8 +1,10 @@
using NetinaShop.Domain.Dtos.LargDtos; using Netina.AdminPanel.PWA.Models;
using NetinaShop.Domain.Entities.Blogs; using Netina.AdminPanel.PWA.Models.Api;
using NetinaShop.Domain.Entities.Products; using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.Domain.Entities.Blogs;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class BlogActionDialogBoxViewModel : BaseViewModel public class BlogActionDialogBoxViewModel : BaseViewModel
{ {

View File

@ -1,5 +1,8 @@
@using NetinaShop.Common.Models.Exception @using Netina.AdminPanel.PWA.Models.Api
@using NetinaShop.Domain.Entities.Blogs @using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Models
@using Netina.Domain.Entities.Blogs
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper

View File

@ -1,6 +1,9 @@
@using NetinaShop.Common.Models.Exception @using Netina.AdminPanel.PWA.Models.Api
@using NetinaShop.Domain.CommandQueries.Commands @using Netina.AdminPanel.PWA.Services.RestServices
@using NetinaShop.Domain.Entities.Brands @using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Models
@using Netina.Common.Extensions
@using Netina.Domain.Entities.Brands
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper

View File

@ -1,4 +1,4 @@
@using NetinaShop.Domain.Dtos.ResponseDtos @using Netina.Domain.Dtos.ResponseDtos
<MudDialog DisableSidePadding="true" class="mx-auto"> <MudDialog DisableSidePadding="true" class="mx-auto">
<DialogContent > <DialogContent >
<MudStack> <MudStack>

View File

@ -1,4 +1,5 @@
@using NetinaShop.Domain.Entities.Users @using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper

View File

@ -1,6 +1,6 @@
using NetinaShop.Domain.Dtos.ScraperDtos.Response; using Netina.Domain.Dtos.ScraperDtos.Response;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class DigikalaProductActionDialogBoxViewModel : BaseViewModel<ObservableCollection<ScraperProductDto>> public class DigikalaProductActionDialogBoxViewModel : BaseViewModel<ObservableCollection<ScraperProductDto>>
{ {

View File

@ -1,15 +1,11 @@
@using Radzen.Blazor @using Netina.AdminPanel.PWA.Services.RestServices
@using NetinaShop.AdminPanel.PWA.Extensions @using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Extensions
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject IUserUtility UserUtility @inject IUserUtility UserUtility
@inject IDialogService DialogService @inject IDialogService DialogService
<head>
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
</head>
<MudDialog class="mx-auto" DisableSidePadding="true"> <MudDialog class="mx-auto" DisableSidePadding="true">
<DialogContent > <DialogContent >
<MudContainer class="max-h-[30rem] lg:max-h-[35rem] overflow-y-scroll"> <MudContainer class="max-h-[30rem] lg:max-h-[35rem] overflow-y-scroll">
@ -30,6 +26,15 @@
<MudSwitch @bind-Value="@ViewModel.PageDto.HasCode" class="mt-2" Size="Size.Large" T="bool" Label="با کد تخفیف باشد" Color="Color.Info" /> <MudSwitch @bind-Value="@ViewModel.PageDto.HasCode" class="mt-2" Size="Size.Large" T="bool" Label="با کد تخفیف باشد" Color="Color.Info" />
</MudItem> </MudItem>
<MudItem sm="8">
<MudTextField @bind-Value="@ViewModel.PageDto.Description" T="string" Label="توضیحاتــ" Variant="Variant.Outlined" />
</MudItem>
<MudItem sm="4">
<MudSwitch @bind-Value="@ViewModel.PageDto.IsForFirstPurchase" class="mt-2" Size="Size.Large" T="bool" Label="مخصوص اولین خرید" Color="Color.Info" />
</MudItem>
<MudItem sm="8"> <MudItem sm="8">
<MudTextField Disabled="@ViewModel.PageDto.IsInfinity" Format="N0" @bind-Value="@ViewModel.PageDto.Count" T="int" Label="تعداد قابل استفاده" Variant="Variant.Outlined" /> <MudTextField Disabled="@ViewModel.PageDto.IsInfinity" Format="N0" @bind-Value="@ViewModel.PageDto.Count" T="int" Label="تعداد قابل استفاده" Variant="Variant.Outlined" />
</MudItem> </MudItem>

View File

@ -1,10 +1,6 @@
using Mapster; using Netina.Domain.Entities.Discounts;
using NetinaShop.Domain.Dtos.ResponseDtos;
using NetinaShop.Domain.Entities.Blogs;
using NetinaShop.Domain.Entities.Discounts;
using NetinaShop.Domain.Mappers;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto> public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto>
{ {
@ -202,7 +198,7 @@ public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto>
await _restWrapper.CrudApiRest<Discount, Guid>(Address.DiscountController).Create<CreateDiscountCommand>(request, token); await _restWrapper.CrudApiRest<Discount, Guid>(Address.DiscountController).Create<CreateDiscountCommand>(request, token);
_snackbar.Add($"ساخت تخفیف با موفقیت انجام شد", Severity.Success); _snackbar.Add($"ساخت تخفیف با موفقیت انجام شد", Severity.Success);
_mudDialog.Close(); _mudDialog.Close(true);
} }
catch (ApiException ex) catch (ApiException ex)
{ {
@ -255,7 +251,7 @@ public class DiscountActionDialogBoxViewModel : BaseViewModel<DiscountLDto>
var request = PageDto.Adapt<UpdateDiscountCommand>(); var request = PageDto.Adapt<UpdateDiscountCommand>();
await _restWrapper.CrudApiRest<Discount, Guid>(Address.DiscountController).Update<UpdateDiscountCommand>(request, token); await _restWrapper.CrudApiRest<Discount, Guid>(Address.DiscountController).Update<UpdateDiscountCommand>(request, token);
_snackbar.Add($"ویرایش تخفیف با موفقیت انجام شد", Severity.Success); _snackbar.Add($"ویرایش تخفیف با موفقیت انجام شد", Severity.Success);
_mudDialog.Close(); _mudDialog.Close(true);
} }
catch (ApiException ex) catch (ApiException ex)
{ {

View File

@ -1,5 +1,7 @@
@using Color = MudBlazor.Color @using Color = MudBlazor.Color
@using Size = MudBlazor.Size @using Size = MudBlazor.Size
@using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper

View File

@ -1,9 +1,7 @@
using Append.Blazor.Printing; using Append.Blazor.Printing;
using NetinaShop.AdminPanel.PWA.Utilities.Models;
using NetinaShop.Common.Extensions;
using Syncfusion.Pdf.Graphics; using Syncfusion.Pdf.Graphics;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto> public class OrderActionDialogBoxViewModel : BaseViewModel<OrderLDto>
{ {

View File

@ -1,5 +1,4 @@
@using NetinaShop.AdminPanel.PWA.Extensions @using Netina.AdminPanel.PWA.Extensions
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject IUserUtility UserUtility @inject IUserUtility UserUtility

View File

@ -1,6 +1,9 @@
using Mapster; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class ProductActionDialogBoxViewModel : BaseViewModel<ProductLDto> public class ProductActionDialogBoxViewModel : BaseViewModel<ProductLDto>
{ {

View File

@ -1,4 +1,6 @@
@inject ISnackbar Snackbar @using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject IUserUtility UserUtility @inject IUserUtility UserUtility
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,11 +1,9 @@
using MediatR; using Netina.AdminPanel.PWA.Models;
using NetinaShop.Common.Models.Mapper; using Netina.AdminPanel.PWA.Models.Api;
using NetinaShop.Domain.Dtos.LargDtos; using Netina.AdminPanel.PWA.Services.RestServices;
using NetinaShop.Domain.Entities.Discounts; using Netina.AdminPanel.PWA.Utilities;
using NetinaShop.Domain.Entities.Products;
using System.Linq.Dynamic.Core.Tokenizer;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class ProductCategoryActionDialogBoxViewModel:BaseViewModel public class ProductCategoryActionDialogBoxViewModel:BaseViewModel
{ {

View File

@ -1,4 +1,6 @@
@using NetinaShop.Domain.Entities.Users @using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@using Netina.Domain.Entities.Users
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper

View File

@ -1,9 +1,7 @@
using NetinaShop.Domain.Entities.Blogs; using Netina.Domain.Entities.Users;
using NetinaShop.Domain.Entities.Users; using Netina.Domain.Models.Claims;
using System.Reflection.Metadata;
using NetinaShop.Domain.Models.Claims;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class RoleActionDialogBoxViewModel : BaseViewModel<RoleActionRequestDto> public class RoleActionDialogBoxViewModel : BaseViewModel<RoleActionRequestDto>
{ {

View File

@ -1,4 +1,4 @@
@using NetinaShop.Domain.Entities.Users 
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper

View File

@ -1,7 +1,10 @@
using Mapster; using Netina.AdminPanel.PWA.Models;
using NetinaShop.Domain.Entities.Warehouses; using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.Domain.Entities.Warehouses;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class ShippingActionDialogBoxViewModel : BaseViewModel<ShippingSDto> public class ShippingActionDialogBoxViewModel : BaseViewModel<ShippingSDto>
{ {

View File

@ -1,5 +1,5 @@
@using NetinaShop.AdminPanel.PWA.Extensions @using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject IUserUtility UserUtility @inject IUserUtility UserUtility
@inject ISnackbar Snackbar @inject ISnackbar Snackbar

View File

@ -1,6 +1,10 @@
using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Forms;
using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class StorageDialogBoxViewModel : BaseViewModel public class StorageDialogBoxViewModel : BaseViewModel
{ {
@ -124,6 +128,8 @@ public class StorageDialogBoxViewModel : BaseViewModel
StringBaseFile = Convert.ToBase64String(memoryStream.ToArray()) StringBaseFile = Convert.ToBase64String(memoryStream.ToArray())
}; };
var token = await _userUtility.GetBearerTokenAsync(); var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("token is null");
var rest = await _restWrapper.FileRestApi.UploadFileAsync(fileUpload, token); var rest = await _restWrapper.FileRestApi.UploadFileAsync(fileUpload, token);
Files.Insert(0, new StorageFileSDto Files.Insert(0, new StorageFileSDto
{ {

View File

@ -1,5 +1,4 @@
@using NetinaShop.Domain.Entities.Users 
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@inject IRestWrapper RestWrapper @inject IRestWrapper RestWrapper
@inject IUserUtility UserUtility @inject IUserUtility UserUtility

View File

@ -1,8 +1,11 @@
using Mapster; using Mapster;
using NetinaShop.Domain.Entities.Users; using Netina.AdminPanel.PWA.Models;
using NetinaShop.Domain.Models.Claims; using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.Domain.Entities.Users;
namespace NetinaShop.AdminPanel.PWA.Dialogs; namespace Netina.AdminPanel.PWA.Dialogs;
public class UserActionDialogBoxViewModel : BaseViewModel<UserActionRequestDto> public class UserActionDialogBoxViewModel : BaseViewModel<UserActionRequestDto>
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Extensions; namespace Netina.AdminPanel.PWA.Extensions;
public class AesJsProvider : IEncryptProvider public class AesJsProvider : IEncryptProvider
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Extensions; namespace Netina.AdminPanel.PWA.Extensions;
public static class BoolExtension public static class BoolExtension
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Extensions; namespace Netina.AdminPanel.PWA.Extensions;
public interface IEncryptProvider public interface IEncryptProvider
{ {

View File

@ -1,7 +1,7 @@
using System.Globalization; using System.Globalization;
using System.Reflection; using System.Reflection;
namespace NetinaShop.AdminPanel.PWA.Extensions; namespace Netina.AdminPanel.PWA.Extensions;
public static class PersianCultureInfo public static class PersianCultureInfo
{ {

View File

@ -1,6 +1,4 @@
using NetinaShop.Common.Extensions; namespace Netina.AdminPanel.PWA.Extensions;
namespace NetinaShop.AdminPanel.PWA.Extensions;
public static class StorageFileExtension public static class StorageFileExtension
{ {

View File

@ -1,5 +1,7 @@
@using NetinaShop.AdminPanel.PWA.Pages @using Netina.AdminPanel.PWA.Pages
@using Radzen.Blazor @using Radzen.Blazor
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Models
@inherits LayoutComponentBase @inherits LayoutComponentBase
@inject IPWAUpdaterService PwaUpdaterService @inject IPWAUpdaterService PwaUpdaterService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager

View File

@ -1,10 +1,10 @@
namespace NetinaShop.AdminPanel.PWA.Models; namespace Netina.AdminPanel.PWA.Models;
public static class Address public static class Address
{ {
#if DEBUG #if DEBUG
public static string BaseAddress = "http://localhost:32770/api"; //public static string BaseAddress = "http://localhost:32770/api";
//public static string BaseAddress = "https://api.vesmeh.com/api"; public static string BaseAddress = "https://api.vesmeh.com/api";
#else #else
public static string BaseAddress = "https://api.vesmeh.com/api"; public static string BaseAddress = "https://api.vesmeh.com/api";
#endif #endif

View File

@ -1,7 +1,4 @@
using NetinaShop.Common.Extensions; namespace Netina.AdminPanel.PWA.Models.Api;
using NetinaShop.Common.Models.Api;
namespace NetinaShop.AdminPanel.PWA.Models.Api;
public class ApiResult public class ApiResult
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Models; namespace Netina.AdminPanel.PWA.Models;
public class BaseViewModel public class BaseViewModel
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Models; namespace Netina.AdminPanel.PWA.Models;
public static class LocalStorageKeys public static class LocalStorageKeys
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Models; namespace Netina.AdminPanel.PWA.Models;
public static class MainTheme public static class MainTheme
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Models; namespace Netina.AdminPanel.PWA.Models;
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse); // Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
public class OrderProduct public class OrderProduct

View File

@ -5,8 +5,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest> <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<AssemblyVersion>0.17.21.32</AssemblyVersion> <AssemblyVersion>0.21.24.41</AssemblyVersion>
<FileVersion>0.17.21.32</FileVersion> <FileVersion>0.21.24.41</FileVersion>
<AssemblyName>$(MSBuildProjectName)</AssemblyName> <AssemblyName>$(MSBuildProjectName)</AssemblyName>
</PropertyGroup> </PropertyGroup>
@ -42,6 +42,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.JSInterop.WebAssembly" Version="8.0.1" /> <PackageReference Include="Microsoft.JSInterop.WebAssembly" Version="8.0.1" />
<PackageReference Include="MudBlazor" Version="6.13.0" /> <PackageReference Include="MudBlazor" Version="6.13.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
@ -54,7 +55,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\NetinaShop\NetinaShop.Domain\NetinaShop.Domain.csproj" /> <ProjectReference Include="..\..\Netina\Netina.Domain\Netina.Domain.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -63,30 +64,33 @@
<ItemGroup> <ItemGroup>
<Using Include="Blazored.LocalStorage" /> <Using Include="Blazored.LocalStorage" />
<Using Include="Mapster" />
<Using Include="Microsoft.AspNetCore.Components" /> <Using Include="Microsoft.AspNetCore.Components" />
<Using Include="Microsoft.IdentityModel.Tokens" /> <Using Include="Microsoft.IdentityModel.Tokens" />
<Using Include="Microsoft.JSInterop" /> <Using Include="Microsoft.JSInterop" />
<Using Include="MudBlazor" /> <Using Include="MudBlazor" />
<Using Include="NetinaShop.AdminPanel.PWA.Dialogs" /> <Using Include="Netina.AdminPanel.PWA.Dialogs" />
<Using Include="NetinaShop.AdminPanel.PWA.Dialogs.Originals" /> <Using Include="Netina.AdminPanel.PWA.Dialogs.Originals" />
<Using Include="NetinaShop.AdminPanel.PWA.Extensions" /> <Using Include="Netina.AdminPanel.PWA.Extensions" />
<Using Include="NetinaShop.AdminPanel.PWA.Models" /> <Using Include="Netina.AdminPanel.PWA.Models" />
<Using Include="NetinaShop.AdminPanel.PWA.Models.Api" /> <Using Include="Netina.AdminPanel.PWA.Models.Api" />
<Using Include="NetinaShop.AdminPanel.PWA.Services.RestServices" /> <Using Include="Netina.AdminPanel.PWA.Services.RestServices" />
<Using Include="NetinaShop.AdminPanel.PWA.Utilities" /> <Using Include="Netina.AdminPanel.PWA.Utilities" />
<Using Include="NetinaShop.AdminPanel.PWA.Utilities.Models" /> <Using Include="Netina.AdminPanel.PWA.Utilities.Models" />
<Using Include="NetinaShop.Common.Models.Api" /> <Using Include="Netina.Common.Extensions" />
<Using Include="NetinaShop.Common.Models.Exception" /> <Using Include="Netina.Common.Models.Api" />
<Using Include="NetinaShop.Domain.CommandQueries.Commands" /> <Using Include="Netina.Common.Models.Exception" />
<Using Include="NetinaShop.Domain.Dtos.DashboardDtos" /> <Using Include="Netina.Domain.CommandQueries.Commands" />
<Using Include="NetinaShop.Domain.Dtos.LargDtos" /> <Using Include="Netina.Domain.Dtos.DashboardDtos" />
<Using Include="NetinaShop.Domain.Dtos.RequestDtos" /> <Using Include="Netina.Domain.Dtos.LargDtos" />
<Using Include="NetinaShop.Domain.Dtos.SmallDtos" /> <Using Include="Netina.Domain.Dtos.RequestDtos" />
<Using Include="NetinaShop.Domain.Entities.ProductCategories" /> <Using Include="Netina.Domain.Dtos.ResponseDtos" />
<Using Include="NetinaShop.Domain.Entities.Products" /> <Using Include="Netina.Domain.Dtos.SmallDtos" />
<Using Include="NetinaShop.Domain.Enums" /> <Using Include="Netina.Domain.Entities.ProductCategories" />
<Using Include="NetinaShop.Domain.MartenEntities.Pages" /> <Using Include="Netina.Domain.Entities.Products" />
<Using Include="NetinaShop.Domain.Models.Districts" /> <Using Include="Netina.Domain.Enums" />
<Using Include="Netina.Domain.MartenEntities.Pages" />
<Using Include="Netina.Domain.Models.Districts" />
<Using Include="Newtonsoft.Json" /> <Using Include="Newtonsoft.Json" />
<Using Include="Refit" /> <Using Include="Refit" />
<Using Include="System.Collections.ObjectModel" /> <Using Include="System.Collections.ObjectModel" />

View File

@ -1,4 +1,6 @@
@page "/blog/categories" @page "/blog/categories"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,6 +1,11 @@
using NetinaShop.Domain.Entities.Blogs; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
using Netina.Domain.Entities.Blogs;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class BlogCategoriesPageViewModel:BaseViewModel<ObservableCollection<BlogCategorySDto>> public class BlogCategoriesPageViewModel:BaseViewModel<ObservableCollection<BlogCategorySDto>>
{ {

View File

@ -1,4 +1,6 @@
@page "/blogs" @page "/blogs"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,6 +1,11 @@
using NetinaShop.Domain.Entities.Blogs; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
using Netina.Domain.Entities.Blogs;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>> public class BlogsPageViewModel : BaseViewModel<ObservableCollection<BlogSDto>>
{ {

View File

@ -1,4 +1,6 @@
@page "/product/brands" @page "/product/brands"
@using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@inject IDialogService DialogService @inject IDialogService DialogService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager

View File

@ -1,6 +1,11 @@
using NetinaShop.Domain.Entities.Brands; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
using Netina.Domain.Entities.Brands;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class BrandsPageViewModel : BaseViewModel<List<BrandSDto>> public class BrandsPageViewModel : BaseViewModel<List<BrandSDto>>
{ {

View File

@ -1,4 +1,6 @@
@using Radzen.Blazor @using Radzen.Blazor
@using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@page "/product/categories" @page "/product/categories"
@inject IDialogService DialogService @inject IDialogService DialogService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager

View File

@ -1,9 +1,10 @@
using System.Collections.ObjectModel; using Netina.AdminPanel.PWA.Models;
using MudBlazor; using Netina.AdminPanel.PWA.Models.Api;
using NetinaShop.AdminPanel.PWA.Utilities.Models; using Netina.AdminPanel.PWA.Services.RestServices;
using NetinaShop.Common.Models.Exception; using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class CategoriesPageViewModel : BaseViewModel<ObservableCollection<ProductCategorySDto>> public class CategoriesPageViewModel : BaseViewModel<ObservableCollection<ProductCategorySDto>>
{ {

View File

@ -1,4 +1,6 @@
@page "/discounts" @page "/discounts"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService
@ -60,12 +62,43 @@
</CellTemplate> </CellTemplate>
</TemplateColumn> </TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="نوع تخفیف">
<CellTemplate>
<p>@context.Item.Type.ToDisplay()</p>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="نوع کسرشدن">
<CellTemplate>
<p>@context.Item.AmountType.ToDisplay()</p>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="نوع کسرشدن">
<CellTemplate>
<p>@context.Item.AmountType.ToDisplay()</p>
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="مقدار تخفیف">
<CellTemplate>
@if (context.Item.AmountType == DiscountAmountType.Percent)
{
<p>@context.Item.DiscountPercent %</p>
}
else
{
<p>@context.Item.DiscountAmount ریالـ</p>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn T="DiscountSDto" Title="تعداد قابل استفاده"> <TemplateColumn T="DiscountSDto" Title="تعداد قابل استفاده">
<CellTemplate> <CellTemplate>
@if (context.Item.IsInfinity) @if (context.Item.IsInfinity)
{ {
<p>--</p> <p>نامحدود</p>
} }
else else
{ {

View File

@ -1,8 +1,11 @@
using MudBlazor; using Netina.AdminPanel.PWA.Models;
using NetinaShop.AdminPanel.PWA.Utilities.Models; using Netina.AdminPanel.PWA.Models.Api;
using NetinaShop.Domain.Entities.Discounts; using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
using Netina.Domain.Entities.Discounts;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class DiscountPageViewModel : BaseViewModel<ObservableCollection<DiscountSDto>> public class DiscountPageViewModel : BaseViewModel<ObservableCollection<DiscountSDto>>
{ {

View File

@ -1,4 +1,6 @@
@page "/management/faqs" @page "/management/faqs"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,4 +1,9 @@
namespace NetinaShop.AdminPanel.PWA.Pages; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace Netina.AdminPanel.PWA.Pages;
public class FaqManagementPageViewModel : BaseViewModel<FAQPage> public class FaqManagementPageViewModel : BaseViewModel<FAQPage>
{ {

View File

@ -1,5 +1,7 @@
@page "/" @page "/"
@page "/home" @page "/home"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,6 +1,9 @@
using NetinaShop.Domain.Entities.Brands; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class HomeViewModel : BaseViewModel<HomeDashboardDto> public class HomeViewModel : BaseViewModel<HomeDashboardDto>
{ {

View File

@ -1,4 +1,6 @@
@using Microsoft.AspNetCore.Authorization @using Microsoft.AspNetCore.Authorization
@using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.AdminPanel.PWA.Utilities
@attribute [AllowAnonymous] @attribute [AllowAnonymous]
@page "/login" @page "/login"

View File

@ -1,4 +1,9 @@
namespace NetinaShop.AdminPanel.PWA.Pages; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace Netina.AdminPanel.PWA.Pages;
public class LoginPageViewModel : BaseViewModel public class LoginPageViewModel : BaseViewModel
{ {

View File

@ -0,0 +1,64 @@
@page "/management/marketer"
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService
@inject NavigationManager NavigationManager
@inject ISnackbar Snackbar
@inject IUserUtility UserUtility
@inject IRestWrapper RestWrapper
<MudStack class="w-full p-8 h-screen bg-[--mud-palette-background-grey]">
<MudGrid>
<MudItem xs="12">
<MudPaper class="px-5 py-5">
<MudStack Row="true">
<MudStack class="mb-5 mx-2">
<MudText Typo="Typo.h4">jتنظیماتـــ بازاریاب ها</MudText>
<MudText Typo="Typo.caption">شما می توانید تنظیمات بازاریاب های خود را ویرایش نمایید</MudText>
</MudStack>
<MudSpacer />
<BaseButtonUi Size="Size.Large"
OnClickCallback="ViewModel.SubmitSettingAsync"
class="mt-2 mb-8 w-64 rounded-md"
IsProcessing="@ViewModel.IsProcessing"
Icon="@Icons.Material.Outlined.Check"
Content="ثبتـــ اطلاعات" Variant="Variant.Filled" Color="Color.Success" />
</MudStack>
<MudGrid>
<MudItem xs="12" sm="12">
<MudTextField T="int" @bind-Value="@ViewModel.PageDto.ProfitPercent" Variant="Variant.Outlined" Label="درصد از هر فروش"></MudTextField>
</MudItem>
<MudItem xs="12" sm="12">
<div class="min-h-[33rem] w-full">
<MudStack class="mt-4" Spacing="0">
<MudText Typo="Typo.h6">قرارداد بازاریاب ها</MudText>
<MudText Typo="Typo.caption">قراردادی که بازاریاب ها در مرحله ثبت نام باید با ان موافقت کنند</MudText>
</MudStack>
<MudGrid>
<MudItem sm="12">
<RichTextEditorUi @bind-Text="@ViewModel.PageDto.ContractTerms" />
</MudItem>
</MudGrid>
</div>
</MudItem>
</MudGrid>
</MudPaper>
</MudItem>
</MudGrid>
</MudStack>
@code
{
public MarketerManagementPageViewModel ViewModel { get; set; }
protected override async Task OnInitializedAsync()
{
ViewModel = new MarketerManagementPageViewModel(NavigationManager, Snackbar, UserUtility, RestWrapper, DialogService);
await ViewModel.InitializeAsync();
await base.OnInitializedAsync();
}
}

View File

@ -0,0 +1,78 @@
using Netina.Domain.MartenEntities.Settings;
namespace Netina.AdminPanel.PWA.Pages;
public class MarketerManagementPageViewModel : BaseViewModel<MarketerSetting>
{
private readonly NavigationManager _navigationManager;
private readonly ISnackbar _snackbar;
private readonly IUserUtility _userUtility;
private readonly IDialogService _dialogService;
private readonly IRestWrapper _restWrapper;
public MarketerManagementPageViewModel(NavigationManager navigationManager, ISnackbar snackbar, IUserUtility userUtility, IRestWrapper restWrapper, IDialogService dialogService)
{
_navigationManager = navigationManager;
_snackbar = snackbar;
_userUtility = userUtility;
_restWrapper = restWrapper;
_dialogService = dialogService;
}
public override async Task InitializeAsync()
{
try
{
IsProcessing = true;
var token = await _userUtility.GetBearerTokenAsync();
if (token == null)
throw new Exception("Token is null");
PageDto = await _restWrapper.SettingRestApi.GetSettingAsync<MarketerSetting>("MarketerSetting", token);
}
catch (ApiException e)
{
var exe = await e.GetContentAsAsync<ApiResult>();
_snackbar.Add(exe != null ? exe.Message : e.Content, Severity.Error);
}
catch (Exception ex)
{
_snackbar.Add(ex.Message, Severity.Error);
}
finally
{
IsProcessing = false;
}
await base.InitializeAsync();
}
public async Task SubmitSettingAsync()
{
try
{
var token = await _userUtility.GetBearerTokenAsync();
if (token == null) throw new Exception("Token is null");
await _restWrapper.SettingRestApi.PostSettingAsync("MarketerSetting", PageDto, token);
_snackbar.Add("تنظیمات بازاریاب ها با موفقیت به روز شد", Severity.Success);
}
catch (ApiException ex)
{
var exe = await ex.GetContentAsAsync<ApiResult>();
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
}
catch (Exception e)
{
_snackbar.Add(e.Message, Severity.Error);
}
finally
{
IsProcessing = false;
}
}
}

View File

@ -1,4 +1,6 @@
@page "/newsletler" @page "/newsletler"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,6 +1,10 @@
using NetinaShop.Domain.Entities.Users; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.Domain.Entities.Users;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class NewsletterManagementPageViewModel : BaseViewModel public class NewsletterManagementPageViewModel : BaseViewModel
{ {

View File

@ -1,5 +1,10 @@
@page "/orders" @page "/orders"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@using Netina.Common.Extensions
@using Netina.Domain.Models.Claims
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@attribute [PermissionAuthorize(ApplicationPermission.ManageDashboard)]
@inject IDialogService DialogService @inject IDialogService DialogService
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
@ -57,7 +62,7 @@
</ToolBarContent> </ToolBarContent>
<Columns> <Columns>
<PropertyColumn Title="کد سفارش" Property="arg => arg.FactorCode" /> <PropertyColumn Title="کد سفارش" Property="arg => arg.FactorCode" />
<PropertyColumn Title="نام خریدار" Property="arg => arg.UserFullName" /> <PropertyColumn Title="نام خریدار" Property="arg => arg.CustomerFullName" />
<TemplateColumn T="OrderSDto" Title="تاریخ سفارش"> <TemplateColumn T="OrderSDto" Title="تاریخ سفارش">
<CellTemplate> <CellTemplate>
<p>@context.Item.OrderAt.ToPersianDateTime().ToLongDateString()</p> <p>@context.Item.OrderAt.ToPersianDateTime().ToLongDateString()</p>

View File

@ -1,4 +1,9 @@
namespace NetinaShop.AdminPanel.PWA.Pages; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace Netina.AdminPanel.PWA.Pages;
public class OrdersPageViewModel : BaseViewModel public class OrdersPageViewModel : BaseViewModel
{ {

View File

@ -1,4 +1,6 @@
@page "/pages" @page "/pages"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService
@ -29,8 +31,8 @@
</ToolBarContent> *@ </ToolBarContent> *@
<Columns> <Columns>
<PropertyColumn Title="شماره فاکتور" Property="arg => arg.FactorNumber" /> <PropertyColumn Title="شماره فاکتور" Property="arg => arg.FactorNumber" />
<PropertyColumn Title="پرداخت کننده" Property="arg => arg.UserFullName" /> <PropertyColumn Title="پرداخت کننده" Property="arg => arg.CustomerFullName" />
<PropertyColumn Title="شماره تماس" Property="arg => arg.UserPhoneNumber" /> <PropertyColumn Title="شماره تماس" Property="arg => arg.CustomerPhoneNumber" />
<TemplateColumn T="PaymentSDto" Title="نوع پرداخت"> <TemplateColumn T="PaymentSDto" Title="نوع پرداخت">
<CellTemplate> <CellTemplate>

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class PagesManagementPageViewModel public class PagesManagementPageViewModel
{ {

View File

@ -1,4 +1,6 @@
@page "/payments" @page "/payments"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService
@ -29,8 +31,8 @@
</ToolBarContent> *@ </ToolBarContent> *@
<Columns> <Columns>
<PropertyColumn Title="شماره فاکتور" Property="arg => arg.FactorNumber" /> <PropertyColumn Title="شماره فاکتور" Property="arg => arg.FactorNumber" />
<PropertyColumn Title="پرداخت کننده" Property="arg => arg.UserFullName" /> <PropertyColumn Title="پرداخت کننده" Property="arg => arg.CustomerFullName" />
<PropertyColumn Title="شماره تماس" Property="arg => arg.UserPhoneNumber" /> <PropertyColumn Title="شماره تماس" Property="arg => arg.CustomerPhoneNumber" />
<TemplateColumn T="PaymentSDto" Title="نوع پرداخت"> <TemplateColumn T="PaymentSDto" Title="نوع پرداخت">
<CellTemplate> <CellTemplate>

View File

@ -1,4 +1,9 @@
namespace NetinaShop.AdminPanel.PWA.Pages; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
namespace Netina.AdminPanel.PWA.Pages;
public class PaymentsPageViewModel : BaseViewModel<ObservableCollection<PaymentSDto>> public class PaymentsPageViewModel : BaseViewModel<ObservableCollection<PaymentSDto>>
{ {

View File

@ -1,4 +1,6 @@
@page "/products" @page "/products"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,7 +1,10 @@
using MudBlazor; using Netina.AdminPanel.PWA.Models;
using NetinaShop.Domain.Dtos.ResponseDtos; using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductSDto>> public class ProductsPageViewModel : BaseViewModel<ObservableCollection<ProductSDto>>
{ {

View File

@ -1,4 +1,6 @@
@page "/inventory/shipping" @page "/inventory/shipping"
@using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,6 +1,11 @@
using NetinaShop.Domain.Entities.Warehouses; using Netina.AdminPanel.PWA.Models;
using Netina.AdminPanel.PWA.Models.Api;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
using Netina.Domain.Entities.Warehouses;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class ShippingPageViewModel : BaseViewModel<ObservableCollection<ShippingSDto>> public class ShippingPageViewModel : BaseViewModel<ObservableCollection<ShippingSDto>>
{ {

View File

@ -1,5 +1,4 @@
@page "/management/shop" @page "/management/shop"
@using NetinaShop.Domain.Models.Districts
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,7 +1,6 @@
using NetinaShop.Domain.MartenEntities.Settings; using Netina.Domain.MartenEntities.Settings;
using NetinaShop.Domain.Models.Districts;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class ShopManagementPageViewModel : BaseViewModel public class ShopManagementPageViewModel : BaseViewModel
{ {

View File

@ -1,5 +1,6 @@
@page "/setting/users" @page "/setting/users"
@using NetinaShop.Domain.Entities.Users @using Netina.AdminPanel.PWA.Utilities
@using Netina.AdminPanel.PWA.Services.RestServices
@attribute [Microsoft.AspNetCore.Authorization.Authorize] @attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject IDialogService DialogService @inject IDialogService DialogService

View File

@ -1,9 +1,11 @@
using MudBlazor; using Netina.AdminPanel.PWA.Models;
using NetinaShop.Common.Models.Mapper; using Netina.AdminPanel.PWA.Models.Api;
using NetinaShop.Domain.Entities.Blogs; using Netina.AdminPanel.PWA.Services.RestServices;
using NetinaShop.Domain.Entities.Users; using Netina.AdminPanel.PWA.Utilities;
using Netina.AdminPanel.PWA.Utilities.Models;
using Netina.Domain.Entities.Users;
namespace NetinaShop.AdminPanel.PWA.Pages; namespace Netina.AdminPanel.PWA.Pages;
public class UserSettingsPageViewModel : BaseViewModel public class UserSettingsPageViewModel : BaseViewModel
{ {

View File

@ -3,8 +3,11 @@ using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services; using MudBlazor.Services;
using NetinaShop.AdminPanel.PWA; using Netina.AdminPanel.PWA;
using NetinaShop.AdminPanel.PWA.Services; using Netina.AdminPanel.PWA.Extensions;
using Netina.AdminPanel.PWA.Services;
using Netina.AdminPanel.PWA.Services.RestServices;
using Netina.AdminPanel.PWA.Utilities;
using Toolbelt.Blazor.Extensions.DependencyInjection; using Toolbelt.Blazor.Extensions.DependencyInjection;
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);

View File

@ -1,7 +1,8 @@
using System.Security.Claims; using System.Security.Claims;
using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Authorization;
using Netina.AdminPanel.PWA.Utilities;
namespace NetinaShop.AdminPanel.PWA.Services; namespace Netina.AdminPanel.PWA.Services;
public class CustomAuthenticationStateProvider : AuthenticationStateProvider public class CustomAuthenticationStateProvider : AuthenticationStateProvider
{ {
@ -13,7 +14,6 @@ public class CustomAuthenticationStateProvider : AuthenticationStateProvider
} }
public override async Task<AuthenticationState> GetAuthenticationStateAsync() public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{ {
var token = await _userUtility.GetBearerTokenAsync(); var token = await _userUtility.GetBearerTokenAsync();
if (token.IsNullOrEmpty()) if (token.IsNullOrEmpty())
return new AuthenticationState(new()); return new AuthenticationState(new());

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IAuthRestApi public interface IAuthRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IBlogCategoryRestApi public interface IBlogCategoryRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IBlogRestApi public interface IBlogRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IBrandRestApi public interface IBrandRestApi
{ {

View File

@ -1,6 +1,4 @@
using Refit; namespace Netina.AdminPanel.PWA.Services.RestServices;
namespace NetinaShop.AdminPanel.PWA.Services.RestServices;
public interface ICrudApiRest<T, in TKey> where T : class public interface ICrudApiRest<T, in TKey> where T : class
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IDashboardApiRest public interface IDashboardApiRest
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IDiscountRestApi public interface IDiscountRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IDistrictApiRest public interface IDistrictApiRest
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IFileRestApi public interface IFileRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IOrderRestApi public interface IOrderRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IPageRestApi public interface IPageRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IPaymentRestApi public interface IPaymentRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IProductCategoryRestApi public interface IProductCategoryRestApi
{ {

View File

@ -1,6 +1,6 @@
using NetinaShop.Domain.Dtos.ResponseDtos; using Netina.Domain.Dtos.ResponseDtos;
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IProductRestApi public interface IProductRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IRestWrapper public interface IRestWrapper
{ {

View File

@ -1,6 +1,6 @@
using NetinaShop.Domain.Entities.Users; using Netina.Domain.Entities.Users;
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IRoleRestApi public interface IRoleRestApi
{ {

View File

@ -1,6 +1,6 @@
using NetinaShop.Domain.Dtos.ScraperDtos.Response; using Netina.Domain.Dtos.ScraperDtos.Response;
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface IScraperRestApi public interface IScraperRestApi
{ {

View File

@ -1,4 +1,4 @@
namespace NetinaShop.AdminPanel.PWA.Services.RestServices; namespace Netina.AdminPanel.PWA.Services.RestServices;
public interface ISettingRestApi public interface ISettingRestApi
{ {

View File

@ -1,6 +1,4 @@
using NetinaShop.Domain.Dtos.ResponseDtos; namespace Netina.AdminPanel.PWA.Services.RestServices;
namespace NetinaShop.AdminPanel.PWA.Services.RestServices;
public interface IUserRestApi public interface IUserRestApi
{ {

Some files were not shown because too many files have changed in this diff Show More