Convert to Devexpress solution; impovements, clean, etc...
|
|
@ -0,0 +1,223 @@
|
||||||
|
#################
|
||||||
|
## Visual Studio
|
||||||
|
#################
|
||||||
|
|
||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
|
||||||
|
.vs/
|
||||||
|
[Dd]ebug/
|
||||||
|
[Rr]elease/
|
||||||
|
x64/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
|
||||||
|
# Build scripts folder
|
||||||
|
[Aa]pp[Bb]uild/
|
||||||
|
[Oo]ut/
|
||||||
|
|
||||||
|
# Visual Studio Code files
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.log
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
*.ncrunch*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.Publish.xml
|
||||||
|
*.pubxml
|
||||||
|
|
||||||
|
#Launch settings
|
||||||
|
**/Properties/launchSettings.json
|
||||||
|
|
||||||
|
# NuGet Packages Directory
|
||||||
|
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
|
||||||
|
#packages/
|
||||||
|
|
||||||
|
# Windows Azure Build Output
|
||||||
|
csx
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Windows Store app package directory
|
||||||
|
AppPackages/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
sql/
|
||||||
|
*.Cache
|
||||||
|
ClientBin/
|
||||||
|
[Ss]tyle[Cc]op.*
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file to a newer
|
||||||
|
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
App_Data/*.mdf
|
||||||
|
App_Data/*.ldf
|
||||||
|
|
||||||
|
#############
|
||||||
|
## Windows detritus
|
||||||
|
#############
|
||||||
|
|
||||||
|
# Windows image file caches
|
||||||
|
Thumbs.db
|
||||||
|
ehthumbs.db
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Mac crap
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
|
||||||
|
#######################
|
||||||
|
## nopCommerce specific
|
||||||
|
###########
|
||||||
|
glob:*.user
|
||||||
|
*.patch
|
||||||
|
*.hg
|
||||||
|
Presentation/Nop.Web/.config/*
|
||||||
|
Presentation/Nop.Web/App_Data/Gmail/AuthStore/*
|
||||||
|
!Presentation/Nop.Web/App_Data/Gmail/AuthStore/Index.htm
|
||||||
|
Presentation/Nop.Web/App_Data/browscap.xml
|
||||||
|
Presentation/Nop.Web/App_Data/additional.crawlers.xml
|
||||||
|
Presentation/Nop.Web/App_Data/installedPlugins.json
|
||||||
|
Presentation/Nop.Web/App_Data/plugins.json
|
||||||
|
Presentation/Nop.Web/App_Data/dataSettings.json
|
||||||
|
Presentation/Nop.Web/App_Data/appsettings.json
|
||||||
|
Presentation/Nop.Web/App_Data/TempUploads/*
|
||||||
|
!Presentation/Nop.Web/App_Data/TempUploads/Index.htm
|
||||||
|
Presentation/Nop.Web/App_Data/DataProtectionKeys/*
|
||||||
|
!Presentation/Nop.Web/App_Data/DataProtectionKeys/Index.htm
|
||||||
|
Presentation/Nop.Web/node_modules/*
|
||||||
|
Presentation/Nop.Web/Plugins/*
|
||||||
|
Presentation/Nop.Web/[Bb]in/*
|
||||||
|
Presentation/Nop.Web/[Oo]bj/*
|
||||||
|
Presentation/Nop.Web.FrameWork/[Bb]in/*
|
||||||
|
Presentation/Nop.Web.FrameWork/[Oo]bj/*
|
||||||
|
!Presentation/Nop.Web/Plugins/Uploaded
|
||||||
|
Presentation/Nop.Web/Plugins/Uploaded/*
|
||||||
|
!Presentation/Nop.Web/Plugins/Uploaded/placeholder.txt
|
||||||
|
Presentation/Nop.Web/wwwroot/.well-known/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/.well-known/Index.htm
|
||||||
|
Presentation/Nop.Web/wwwroot/bundles/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/bundles/Index.htm
|
||||||
|
Presentation/Nop.Web/wwwroot/db_backups/*.bak
|
||||||
|
!Presentation/Nop.Web/wwwroot/db_backups/Index.htm
|
||||||
|
Presentation/Nop.Web/wwwroot/images/thumbs/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/images/thumbs/placeholder.txt
|
||||||
|
Presentation/Nop.Web/wwwroot/images/uploaded/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/images/uploaded/placeholder.txt
|
||||||
|
Presentation/Nop.Web/wwwroot/files/exportimport/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/files/exportimport/Index.htm
|
||||||
|
Presentation/Nop.Web/wwwroot/lib_npm/cldr-data/main/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/lib_npm/cldr-data/main/en/
|
||||||
|
!Presentation/Nop.Web/wwwroot/lib_npm/cldr-data/main/main.zip
|
||||||
|
Presentation/Nop.Web/wwwroot/sitemaps/*
|
||||||
|
!Presentation/Nop.Web/wwwroot/sitemaps/Index.htm
|
||||||
|
packages/*
|
||||||
|
Tests/Nop.Tests/Connections.resx
|
||||||
|
/.vs
|
||||||
|
/FruitBankHybrid.Web/bin
|
||||||
|
/FruitBankHybrid.Web.Client/bin
|
||||||
|
/FruitBankHybrid/bin
|
||||||
|
/FruitBankHybrid/obj
|
||||||
|
/FruitBankHybrid.Shared/bin
|
||||||
|
/FruitBankHybrid.Shared/obj
|
||||||
|
/FruitBankHybrid.Web.Client/obj
|
||||||
|
obj
|
||||||
|
obj
|
||||||
|
obj
|
||||||
|
obj
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Common" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Models.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Models.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.AspNetCore.SignalR.Core">
|
||||||
|
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.8\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mango.Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using AyCode.Core.Consts;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Server
|
||||||
|
{
|
||||||
|
public class FruitBankConst : AcConst
|
||||||
|
{
|
||||||
|
public static string ProjectIdString = "aad53443-2ee2-4650-8a99-97e907265e4e";
|
||||||
|
public static string MeasuringRoleSystemName = "Measuring";
|
||||||
|
|
||||||
|
static FruitBankConst()
|
||||||
|
{
|
||||||
|
ProjectId = Guid.Parse(ProjectIdString);
|
||||||
|
ProjectSalt = GenerateProjectSalt(ProjectId.ToString("N"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using AyCode.Core.Enums;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Server.Services.Loggers;
|
||||||
|
|
||||||
|
public class ConsoleLogWriter : AcConsoleLogWriter
|
||||||
|
{
|
||||||
|
public ConsoleLogWriter() : this(null)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public ConsoleLogWriter(string? categoryName = null) : base(categoryName)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public ConsoleLogWriter(AppType appType, LogLevel logLevel, string? callerClassName = null) : base(appType, logLevel, callerClassName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Server.Services.Loggers;
|
||||||
|
|
||||||
|
public class LoggerToLoggerApiController : Logger<LoggerToLoggerApiController>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Server.SignalRs;
|
||||||
|
using AyCode.Services.SignalRs;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Server.Services.SignalRs;
|
||||||
|
|
||||||
|
public class AcWebSignalRHubWithSessionBase<TSignalRTags, TLogger>(IConfiguration configuration, TLogger logger)
|
||||||
|
: AcWebSignalRHubBase<TSignalRTags, TLogger>(configuration, logger) where TSignalRTags : AcSignalRTags where TLogger : AcLoggerBase//Hub<ISignalRHubItemServer>, IAcSignalRHubServer
|
||||||
|
{
|
||||||
|
public override async Task OnConnectedAsync()
|
||||||
|
{
|
||||||
|
await base.OnConnectedAsync();
|
||||||
|
|
||||||
|
////insert or update them into database.
|
||||||
|
//var CId = _context.UserIdToCId.Find(userId);
|
||||||
|
//CId.ConnectionId = connectionid;
|
||||||
|
//_context.Update(CId);
|
||||||
|
//await _context.SaveChangesAsync();
|
||||||
|
//await base.OnConnectedAsync();
|
||||||
|
////await Groups.AddToGroupAsync(Context.ConnectionId, "SignalR Users");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task OnDisconnectedAsync(Exception? exception)
|
||||||
|
{
|
||||||
|
await base.OnDisconnectedAsync(exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,114 @@
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Models.Server.DynamicMethods;
|
||||||
|
using AyCode.Services.SignalRs;
|
||||||
|
using FruitBank.Common.Interfaces;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
using FruitBank.Common.SignalRs;
|
||||||
|
using Microsoft.Extensions.Configuration;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Server.Services.SignalRs;
|
||||||
|
|
||||||
|
//public class DevAdminSignalRHub : AcWebSignalRHubWithSessionBase<SignalRTags, Logger<DevAdminSignalRHub>>
|
||||||
|
//{
|
||||||
|
// public DevAdminSignalRHub(IConfiguration configuration, IEnumerable<IAcLogWriterBase> logWriters)
|
||||||
|
// : base(configuration, new Logger<DevAdminSignalRHub>(logWriters.ToArray()))
|
||||||
|
// {
|
||||||
|
// Logger.Info("DevAdminSignalRHub");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public Task ReceiveMessage(int messageTag, byte[]? message, int? requestId)
|
||||||
|
// {
|
||||||
|
|
||||||
|
// Clients.All.SendAsync("TestMessage", "Hello from server");
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
public class DevAdminSignalRHub : AcWebSignalRHubWithSessionBase<SignalRTags, Logger<DevAdminSignalRHub>>
|
||||||
|
{
|
||||||
|
public DevAdminSignalRHub(IConfiguration configuration, IFruitBankDataControllerServer fruitBankDataController/*, SessionService sessionService*/, IEnumerable<IAcLogWriterBase> logWriters)
|
||||||
|
: base(configuration, new Logger<DevAdminSignalRHub>(logWriters.ToArray()))
|
||||||
|
{
|
||||||
|
DynamicMethodCallModels.Add(new AcDynamicMethodCallModel<SignalRAttribute>(fruitBankDataController));
|
||||||
|
}
|
||||||
|
|
||||||
|
//public override Task OnReceiveMessage(int messageTag, byte[]? message, int? requestId)
|
||||||
|
//{
|
||||||
|
// return ProcessOnReceiveMessage(messageTag, message, requestId, async tagName =>
|
||||||
|
// {
|
||||||
|
// switch (messageTag)
|
||||||
|
// {
|
||||||
|
// case SignalRTags.GetAddress:
|
||||||
|
// //var id = Guid.Parse((string)message!.MessagePackTo<SignalPostJsonDataMessage<IdMessage>>().PostData.Ids[0]);
|
||||||
|
// var id = message!.MessagePackTo<SignalPostJsonDataMessage<IdMessage>>().PostData.Ids[0].JsonTo<Guid[]>()![0];
|
||||||
|
|
||||||
|
// var address = await _adminDal.GetAddressByIdAsync(id);
|
||||||
|
// await ResponseToCaller(messageTag, new SignalResponseJsonMessage(messageTag, SignalResponseStatus.Success, address), requestId);
|
||||||
|
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// case SignalRTags.GetAddressesByContextId:
|
||||||
|
// //id = Guid.Parse((string)message!.MessagePackTo<SignalPostJsonDataMessage<IdMessage>>().PostData.Ids[0]);
|
||||||
|
// id = message!.MessagePackTo<SignalPostJsonDataMessage<IdMessage>>().PostData.Ids[0].JsonTo<Guid[]>()![0];
|
||||||
|
|
||||||
|
// address = await _adminDal.GetAddressByIdAsync(id);
|
||||||
|
// await ResponseToCaller(messageTag, new SignalResponseJsonMessage(messageTag, SignalResponseStatus.Success, new List<Address> { address! }), requestId);
|
||||||
|
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// case SignalRTags.UpdateAddress:
|
||||||
|
// address = message!.MessagePackTo<SignalPostJsonDataMessage<Address>>().PostData;
|
||||||
|
|
||||||
|
// await _adminDal.UpdateAddressAsync(address);
|
||||||
|
// await ResponseToCaller(messageTag, new SignalResponseJsonMessage(messageTag, SignalResponseStatus.Success, address), requestId);
|
||||||
|
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// case SignalRTags.UpdateProfile:
|
||||||
|
// var profile = message!.MessagePackTo<SignalPostJsonDataMessage<Profile>>().PostData;
|
||||||
|
|
||||||
|
// await _adminDal.UpdateProfileAsync(profile);
|
||||||
|
// await ResponseToCaller(messageTag, new SignalResponseJsonMessage(messageTag, SignalResponseStatus.Success, profile), requestId);
|
||||||
|
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// //case SignalRTags.GetTransfersAsync:
|
||||||
|
// // await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, await _transferDataApiController.GetTransfers()), requestId);
|
||||||
|
|
||||||
|
// // return;
|
||||||
|
|
||||||
|
// //case SignalRTags.GetPropertiesByOwnerIdAsync:
|
||||||
|
// // var ownerId = message!.MessagePackTo<SignalRequestByIdMessage>().Id;
|
||||||
|
|
||||||
|
// // await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, await _serviceProviderApiController.GetServiceProvidersByOwnerId(ownerId)), requestId);
|
||||||
|
|
||||||
|
// // return;
|
||||||
|
|
||||||
|
// //case SignalRTags.UpdateTransferAsync:
|
||||||
|
// // var transfer = message!.MessagePackTo<SignalPostJsonDataMessage<Transfer>>().PostData;
|
||||||
|
|
||||||
|
// // await _transferDataApiController.UpdateTransfer(transfer);
|
||||||
|
// // await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, transfer), requestId);
|
||||||
|
|
||||||
|
// // return;
|
||||||
|
|
||||||
|
// //case SignalRTags.GetCompaniesAsync:
|
||||||
|
// // await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, await _serviceProviderApiController.GetServiceProviders()), requestId);
|
||||||
|
|
||||||
|
// // return;
|
||||||
|
// //case SignalRTags.UpdateCompanyAsync:
|
||||||
|
|
||||||
|
// // var updateCompany = message!.MessagePackTo<SignalPostJsonDataMessage<Company>>().PostData;
|
||||||
|
|
||||||
|
// // await _serviceProviderApiController.UpdateServiceProvider(updateCompany);
|
||||||
|
// // await ResponseToCaller(messageTag, new SignalResponseJsonMessage(SignalResponseStatus.Success, updateCompany), requestId);
|
||||||
|
|
||||||
|
// // return;
|
||||||
|
|
||||||
|
// default:
|
||||||
|
// Logger.Error($"Server OnReceiveMessage; messageTag not found! {tagName}");
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
using AyCode.Services.Server.SignalRs;
|
||||||
|
using FruitBank.Common.Server.Services.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Server.Services.SignalRs;
|
||||||
|
|
||||||
|
|
||||||
|
public class LoggerSignalRHub(LoggerToLoggerApiController logger) : AcLoggerSignalRHub<LoggerToLoggerApiController>(logger)
|
||||||
|
{ }
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
using FruitBank.Common.Interfaces;
|
||||||
|
using LinqToDB.Mapping;
|
||||||
|
using Mango.Nop.Core.Entities;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
[Table(Name = FruitBankConstClient.PartnerDbTableName)]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PartnerDbTableName)]
|
||||||
|
public class Partner : MgEntityBase, IPartner
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string PostalCode { get; set; }
|
||||||
|
public string Country { get; set; }
|
||||||
|
public string State { get; set; }
|
||||||
|
public string County { get; set; }
|
||||||
|
public string City { get; set; }
|
||||||
|
public string Street { get; set; }
|
||||||
|
|
||||||
|
[Association(ThisKey = nameof(Id), OtherKey = nameof(ShippingDocument.ShippingId))]
|
||||||
|
public List<ShippingDocument>? ShippingDocuments { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[SkipValuesOnUpdate]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
public DateTime Modified { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
using FruitBank.Common.Interfaces;
|
||||||
|
using LinqToDB.Mapping;
|
||||||
|
using Mango.Nop.Core.Entities;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
[Table(Name = FruitBankConstClient.ShippingDbTableName)]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)]
|
||||||
|
public class Shipping : MgEntityBase, IShipping
|
||||||
|
{
|
||||||
|
public int PartnerId { get; set; }
|
||||||
|
public DateTime ShippingDate { get; set; }
|
||||||
|
public string LicencePlate { get; set; }
|
||||||
|
public bool IsAllMeasured { get; set; }
|
||||||
|
|
||||||
|
[Association(ThisKey = nameof(Id), OtherKey = nameof(ShippingDocument.ShippingId))]
|
||||||
|
public List<ShippingDocument>? ShippingDocuments { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[SkipValuesOnUpdate]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
public DateTime Modified { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
using FruitBank.Common.Interfaces;
|
||||||
|
using LinqToDB.Mapping;
|
||||||
|
using Mango.Nop.Core.Entities;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
[Table(Name = FruitBankConstClient.ShippingDocumentDbTableName)]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)]
|
||||||
|
public class ShippingDocument : MgEntityBase, IShippingDocument
|
||||||
|
{
|
||||||
|
public int PartnerId { get; set; }
|
||||||
|
public int ShippingId { get; set; }
|
||||||
|
public DateTime ShippingDate { get; set; }
|
||||||
|
public string Country { get; set; }
|
||||||
|
public bool IsAllMeasured { get; set; }
|
||||||
|
|
||||||
|
[Association(ThisKey = nameof(ShippingId), OtherKey = nameof(Shipping.Id))]
|
||||||
|
public Shipping? Shipping{ get; set; }
|
||||||
|
|
||||||
|
[Association(ThisKey = nameof(PartnerId), OtherKey = nameof(Partner.Id))]
|
||||||
|
public Partner? Partner { get; set; }
|
||||||
|
|
||||||
|
[Association(ThisKey = nameof(Id), OtherKey = nameof(ShippingItem.ShippingDocumentId))]
|
||||||
|
public List<ShippingItem>? ShippingItems { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[SkipValuesOnUpdate]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
public DateTime Modified { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
using AyCode.Core.Interfaces;
|
||||||
|
using FruitBank.Common.Interfaces;
|
||||||
|
using LinqToDB.Mapping;
|
||||||
|
using Mango.Nop.Core.Entities;
|
||||||
|
using Nop.Core.Domain.Customers;
|
||||||
|
using Nop.Core.Domain.Orders;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
[Table(Name = FruitBankConstClient.ShippingItemDbTableName)]
|
||||||
|
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemDbTableName)]
|
||||||
|
public class ShippingItem : MgEntityBase, IShippingItem
|
||||||
|
{
|
||||||
|
public int? ProductId { get; set; }
|
||||||
|
//[Association(ThisKey = nameof(ShippingDocumentId), OtherKey = nameof(Shipping.Id))]
|
||||||
|
//public IEnumerable<Shipping> Shippings { get; set; }
|
||||||
|
|
||||||
|
public int ShippingDocumentId { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public double NetWeight { get; set; }
|
||||||
|
public double GrossWeight { get; set; }
|
||||||
|
public double? MeasuredNetWeight { get; set; }
|
||||||
|
public double? MeasuredGrossWeight { get; set; }
|
||||||
|
public bool IsMeasured { get; set; }
|
||||||
|
|
||||||
|
[Association(ThisKey = nameof(ShippingDocumentId), OtherKey = nameof(ShippingDocument.Id))]
|
||||||
|
public ShippingDocument? ShippingDocument { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[SkipValuesOnUpdate]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
public DateTime Modified { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="linq2db.EntityFrameworkCore" Version="9.0.0" />
|
||||||
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Interfaces">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Interfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Models">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Models.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mango.Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Dtos\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
using AyCode.Core.Consts;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common;
|
||||||
|
|
||||||
|
public static class FruitBankConstClient
|
||||||
|
{
|
||||||
|
public static string DefaultLocale = "en-US";
|
||||||
|
|
||||||
|
public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop
|
||||||
|
//public static string BaseUrl = "http://10.0.2.2:59579"; //FrutiBank (android) nop
|
||||||
|
//public static string BaseUrl = "https://localhost:7144"; //HybridApp
|
||||||
|
|
||||||
|
|
||||||
|
public static string DefaultHubName = "fbHub";
|
||||||
|
public static string LoggerHubName = "loggerHub";
|
||||||
|
|
||||||
|
public const string PartnerDbTableName = "fbPartner";
|
||||||
|
public const string ShippingDbTableName = "fbShipping";
|
||||||
|
public const string ShippingItemDbTableName = "fbShippingItem";
|
||||||
|
public const string ShippingDocumentDbTableName = "fbShippingDocument";
|
||||||
|
|
||||||
|
|
||||||
|
//public static Guid[] DevAdminIds = new Guid[2] { Guid.Parse("dcf451d2-cc4c-4ac2-8c1f-da00041be1fd"), Guid.Parse("4cbaed43-2465-4d99-84f1-c8bc6b7025f7") };
|
||||||
|
//public static Guid[] SysAdmins = new Guid[3]
|
||||||
|
//{
|
||||||
|
// Guid.Parse("dcf451d2-cc4c-4ac2-8c1f-da00041be1fd"),
|
||||||
|
// Guid.Parse("4cbaed43-2465-4d99-84f1-c8bc6b7025f7"),
|
||||||
|
// Guid.Parse("540271f6-c604-4c16-8160-d5a7cafedf00")
|
||||||
|
//};
|
||||||
|
//public static Dictionary<string, Guid> SysAccounts = new Dictionary<string, Guid>
|
||||||
|
//{
|
||||||
|
// { "SystemEmailSender", Guid.Parse("5e13e051-4fd6-4a30-a371-75cc785cfb84")},
|
||||||
|
//};
|
||||||
|
|
||||||
|
public static string WelcomeEmailTemplateName = "WelcomeEmailTemplate";
|
||||||
|
public static string NewTransferEmailTemplateName = "NewTransferEmailTemplate";
|
||||||
|
public static string TransferModifiedEmailTemplateName = "TramsferModifiedEmailTemplate";
|
||||||
|
public static string ForgotPasswordEmailTemplateName = "ForgotPasswordEmailTemplate";
|
||||||
|
public static string GeneralEmailTemplateName = "GeneralEmailTemplate";
|
||||||
|
|
||||||
|
public static List<string> WelcomeEmailParameters = new List<string>()
|
||||||
|
{
|
||||||
|
"UserName",
|
||||||
|
"SettingBaseUrl",
|
||||||
|
"UserId",
|
||||||
|
"Token"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static List<string> ForgotPasswordEmailParameters = new List<string>()
|
||||||
|
{
|
||||||
|
//string userName, string settingBaseUrl, string userId, string token
|
||||||
|
"UserName",
|
||||||
|
"SettingBaseUrl",
|
||||||
|
"UserId",
|
||||||
|
"Token"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static List<string> NewTransferEmailParameters = new List<string>()
|
||||||
|
{
|
||||||
|
//string userName, string fromAddress, string toAddress, string appointment,
|
||||||
|
//string fullname,string passengerCount, string luggageCount, string settingBaseUrl, string transferId
|
||||||
|
"UserName",
|
||||||
|
"FromAddress",
|
||||||
|
"ToAddress",
|
||||||
|
"Appointment",
|
||||||
|
"FullName",
|
||||||
|
"PassengerCount",
|
||||||
|
"LuggageCount",
|
||||||
|
"SettingBaseUrl",
|
||||||
|
"TransferId"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static List<string> GeneralEmailParameters = new List<string>()
|
||||||
|
{
|
||||||
|
//string userName, string settingBaseUrl, string userId, string token
|
||||||
|
"UserName",
|
||||||
|
"MessageBody",
|
||||||
|
"SettingBaseUrl",
|
||||||
|
"UserId"
|
||||||
|
};
|
||||||
|
|
||||||
|
#if RELEASE
|
||||||
|
public static string SystemEmailAddress = "test@touriam.com";
|
||||||
|
public static LogLevel DefaultLogLevelClient = LogLevel.Error;
|
||||||
|
#else
|
||||||
|
public static string SystemEmailAddress = "test@touriam.com";
|
||||||
|
public static LogLevel DefaultLogLevelClient = LogLevel.Detail;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
using Mango.Nop.Core.Models;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IFruitBankDataControllerClient : IFruitBankDataControllerCommon
|
||||||
|
{
|
||||||
|
Task<MgLoginModelResponse?> LoginMeasuringUser(string customerEmail, string customerPassword);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
using FruitBank.Common.Models;
|
||||||
|
using Mango.Nop.Core.Dtos;
|
||||||
|
using Mango.Nop.Core.Models;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IFruitBankDataControllerCommon
|
||||||
|
{
|
||||||
|
public Task<List<MeasuringModel>?> GetMeasuringModels();
|
||||||
|
public Task<MeasuringModel?> GetMeasuringModelByShippingId(int shippingId);
|
||||||
|
|
||||||
|
#region Partner
|
||||||
|
public Task<List<Partner>?> GetPartners();
|
||||||
|
public Task<Partner?> GetPartnerById(int id);
|
||||||
|
public Task<Partner?> UpdatePartner(Partner partner);
|
||||||
|
#endregion Partner
|
||||||
|
|
||||||
|
#region Shipping
|
||||||
|
public Task<List<Shipping>?> GetShippings();
|
||||||
|
Task<List<Shipping>?> GetNotMeasuredShippings();
|
||||||
|
public Task<Shipping?> GetShippingById(int id);
|
||||||
|
public Task<Shipping?> UpdateShipping(Shipping shipping);
|
||||||
|
#endregion Shipping
|
||||||
|
|
||||||
|
#region ShippingItem
|
||||||
|
public Task<List<ShippingItem>?> GetShippingItems();
|
||||||
|
public Task<ShippingItem?> GetShippingItemById(int id);
|
||||||
|
public Task<ShippingItem?> UpdateShippingItem(ShippingItem shippingItem);
|
||||||
|
#endregion ShippingItem
|
||||||
|
|
||||||
|
#region ShippingDocument
|
||||||
|
public Task<List<ShippingDocument>?> GetShippingDocuments();
|
||||||
|
public Task<ShippingDocument?> GetShippingDocumentById(int id);
|
||||||
|
public Task<ShippingDocument?> UpdateShippingDocument(ShippingDocument shippingDocument);
|
||||||
|
#endregion ShippingDocument
|
||||||
|
|
||||||
|
#region Customer
|
||||||
|
public Task<List<CustomerDto>?> GetMeasuringUsers();
|
||||||
|
#endregion Customer
|
||||||
|
|
||||||
|
#region Product
|
||||||
|
public Task<List<ProductDto>?> GetProductDtos();
|
||||||
|
#endregion Product
|
||||||
|
|
||||||
|
Task<MgLoginModelResponse?> LoginMeasuringUser(MgLoginModelRequest loginModelRequest);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
using Mango.Nop.Core.Models;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IFruitBankDataControllerServer : IFruitBankDataControllerCommon
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
using AyCode.Interfaces.Entities;
|
||||||
|
using AyCode.Interfaces.TimeStampInfo;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IPartner : IEntityInt, ITimeStampInfo
|
||||||
|
{
|
||||||
|
string Name { get; set; }
|
||||||
|
string PostalCode { get; set; }
|
||||||
|
string Country { get; set; }
|
||||||
|
string State { get; set; }
|
||||||
|
string County { get; set; }
|
||||||
|
string City { get; set; }
|
||||||
|
string Street { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
using AyCode.Interfaces.Entities;
|
||||||
|
using AyCode.Interfaces.TimeStampInfo;
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IShipping : IEntityInt, ITimeStampInfo
|
||||||
|
{
|
||||||
|
int PartnerId { get; set; }
|
||||||
|
DateTime ShippingDate { get; set; }
|
||||||
|
string LicencePlate { get; set; }
|
||||||
|
bool IsAllMeasured { get; set; }
|
||||||
|
|
||||||
|
public List<ShippingDocument>? ShippingDocuments { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using AyCode.Interfaces.Entities;
|
||||||
|
using AyCode.Interfaces.TimeStampInfo;
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IShippingDocument: IEntityInt, ITimeStampInfo
|
||||||
|
{
|
||||||
|
public int PartnerId { get; set; }
|
||||||
|
public int ShippingId { get; set; }
|
||||||
|
public DateTime ShippingDate { get; set; }
|
||||||
|
public string Country { get; set; }
|
||||||
|
public bool IsAllMeasured { get; set; }
|
||||||
|
|
||||||
|
public Partner? Partner { get; set; }
|
||||||
|
public List<ShippingItem>? ShippingItems { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
using AyCode.Interfaces.Entities;
|
||||||
|
using AyCode.Interfaces.TimeStampInfo;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Interfaces;
|
||||||
|
|
||||||
|
public interface IShippingItem : IEntityInt, ITimeStampInfo
|
||||||
|
{
|
||||||
|
int ShippingDocumentId { get; set; }
|
||||||
|
int? ProductId { get; set; }
|
||||||
|
|
||||||
|
string Name { get; set; }
|
||||||
|
double NetWeight { get; set; }
|
||||||
|
double GrossWeight { get; set; }
|
||||||
|
double? MeasuredNetWeight { get; set; }
|
||||||
|
double? MeasuredGrossWeight { get; set; }
|
||||||
|
|
||||||
|
bool IsMeasured { get; set; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Loggers;
|
||||||
|
|
||||||
|
public interface ILogger<TCategory> : ILogger
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public interface ILogger : IAcLoggerBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
using AyCode.Core.Enums;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Loggers;
|
||||||
|
|
||||||
|
public class Logger<TCategory> : Logger, ILogger<TCategory>
|
||||||
|
{
|
||||||
|
public Logger() : base(typeof(TCategory).Name)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public Logger(params IAcLogWriterBase[] logWriters) : base(typeof(TCategory).Name, logWriters)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public Logger(AppType appType, LogLevel logLevel, params IAcLogWriterBase[] logWriters) : base(appType, logLevel, typeof(TCategory).Name, logWriters)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Logger : AcLoggerBase, ILogger
|
||||||
|
{
|
||||||
|
public Logger() : this(null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public Logger(string? categoryName) : base(categoryName)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public Logger(string? categoryName, params IAcLogWriterBase[] logWriters) : base(categoryName, logWriters)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public Logger(AppType appType, LogLevel logLevel, string? categoryName, params IAcLogWriterBase[] logWriters) : base(appType, logLevel, categoryName, logWriters)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using AyCode.Core.Enums;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Loggers
|
||||||
|
{
|
||||||
|
public class SignaRClientLogItemWriter : AcSignaRClientLogItemWriter
|
||||||
|
{
|
||||||
|
public SignaRClientLogItemWriter() : this(AppType.Web, LogLevel.Detail, null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public SignaRClientLogItemWriter(AppType appType, LogLevel logLevel, string? categoryName = null) : base($"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.LoggerHubName}", appType, logLevel, categoryName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
using AyCode.Core.Interfaces;
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.Models
|
||||||
|
{
|
||||||
|
public class MeasuringModel : IAcSerializableToJson
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public Shipping Shipping { get; set; }
|
||||||
|
public List<Partner> Partners { get; set; }
|
||||||
|
public List<ShippingItem> ShippingItems { get; set; }
|
||||||
|
public List<ShippingDocument> ShippingDocuments { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public MeasuringModel()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public MeasuringModel(string name) : this()
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MeasuringModel(Shipping shipping, List<Partner> partners, List<ShippingItem> shippingItems, List<ShippingDocument> shippingDocuments) : this()
|
||||||
|
{
|
||||||
|
Shipping = shipping;
|
||||||
|
Partners = partners ?? [];
|
||||||
|
ShippingItems = shippingItems ?? [];
|
||||||
|
ShippingDocuments = shippingDocuments ?? [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
using AyCode.Services.SignalRs;
|
||||||
|
|
||||||
|
namespace FruitBank.Common.SignalRs;
|
||||||
|
|
||||||
|
public class SignalRTags : AcSignalRTags
|
||||||
|
{
|
||||||
|
public const int GetSiteViewModelByUserId = int.MaxValue;
|
||||||
|
|
||||||
|
public const int GetMeasuringModels = 10;
|
||||||
|
public const int GetMeasuringModelByShippingId = 11;
|
||||||
|
|
||||||
|
public const int GetPartners = 20;
|
||||||
|
public const int GetPartnerById = 21;
|
||||||
|
public const int AddPartner = 25;
|
||||||
|
public const int UpdatePartner = 26;
|
||||||
|
|
||||||
|
public const int GetShippings = 40;
|
||||||
|
public const int GetNotMeasuredShippings = 41;
|
||||||
|
public const int GetShippingById = 42;
|
||||||
|
public const int AddShipping = 45;
|
||||||
|
public const int UpdateShipping = 46;
|
||||||
|
|
||||||
|
public const int GetShippingItems = 50;
|
||||||
|
public const int GetShippingItemById = 51;
|
||||||
|
public const int AddShippingItem = 55;
|
||||||
|
public const int UpdateShippingItem = 56;
|
||||||
|
|
||||||
|
public const int GetShippingDocuments = 60;
|
||||||
|
public const int GetShippingDocumentById = 61;
|
||||||
|
public const int AddShippingDocument = 65;
|
||||||
|
public const int UpdateShippingDocument = 66;
|
||||||
|
|
||||||
|
public const int GetMeasuringUsers = 70;
|
||||||
|
public const int GetCustomerDtoById = 71;
|
||||||
|
|
||||||
|
public const int GetProductDtos = 80;
|
||||||
|
public const int GetProductDtoById = 81;
|
||||||
|
|
||||||
|
public const int AuthenticateUser = 160;
|
||||||
|
public const int RefreshToken = 200;
|
||||||
|
|
||||||
|
public const int GetAllLogItemsByFilterText = 1000;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,264 @@
|
||||||
|
using AyCode.Core.Enums;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Utils.Extensions;
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
using FruitBankHybrid.Shared.Services.SignalRs;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Tests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public sealed class FruitBankClientTests
|
||||||
|
{
|
||||||
|
private const string Fixture = "_test.temp";
|
||||||
|
|
||||||
|
private FruitBankSignalRClient _signalRClient = null!;
|
||||||
|
|
||||||
|
private static string GetFixtureName(string name) => $"{GetOriginalName(name)}{Fixture}";
|
||||||
|
private static string GetOriginalName(string name) => name.Replace(Fixture, string.Empty);
|
||||||
|
|
||||||
|
[TestInitialize]
|
||||||
|
public void TestInit()
|
||||||
|
{
|
||||||
|
_signalRClient = new FruitBankSignalRClient(new List<IAcLogWriterClientBase>
|
||||||
|
{
|
||||||
|
//new ConsoleLogWriter(AppType.TestUnit, LogLevel.Detail, nameof(FruitBankClientTests)),
|
||||||
|
new SignaRClientLogItemWriter(AppType.TestUnit, LogLevel.Detail, nameof(FruitBankClientTests))
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Partner
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetPartnersTest()
|
||||||
|
{
|
||||||
|
var partners = await _signalRClient.GetPartners();
|
||||||
|
|
||||||
|
Assert.IsNotNull(partners);
|
||||||
|
Assert.IsTrue(partners.Count != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//[DataTestMethod]
|
||||||
|
//[DataRow(1)]
|
||||||
|
public async Task<Partner> GetPartnerByIdTest(int partnerId)
|
||||||
|
{
|
||||||
|
var partner = await _signalRClient.GetPartnerById(partnerId);
|
||||||
|
|
||||||
|
Assert.IsNotNull(partner);
|
||||||
|
Assert.IsTrue(partner.Id == partnerId);
|
||||||
|
|
||||||
|
return partner;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DataTestMethod]
|
||||||
|
[DataRow(2)]
|
||||||
|
public async Task UpdatePartnerTest(int partnerId)
|
||||||
|
{
|
||||||
|
var partner = await GetPartnerByIdTest(partnerId);
|
||||||
|
|
||||||
|
var newName = GetFixtureName(partner.Name);
|
||||||
|
|
||||||
|
partner.Name = newName;
|
||||||
|
await _signalRClient.UpdatePartner(partner);
|
||||||
|
|
||||||
|
partner = await GetPartnerByIdTest(partnerId);
|
||||||
|
Assert.IsTrue(partner.Name == newName);
|
||||||
|
|
||||||
|
partner.Name = GetOriginalName(partner.Name);
|
||||||
|
await _signalRClient.UpdatePartner(partner);
|
||||||
|
}
|
||||||
|
#endregion Partner
|
||||||
|
|
||||||
|
#region Shipping
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetShippingsTest()
|
||||||
|
{
|
||||||
|
var shippings = await _signalRClient.GetShippings();
|
||||||
|
|
||||||
|
Assert.IsNotNull(shippings);
|
||||||
|
Assert.IsTrue(shippings.Count != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetNotMeasuredShippingsTest()
|
||||||
|
{
|
||||||
|
var shippings = await _signalRClient.GetNotMeasuredShippings();
|
||||||
|
|
||||||
|
Assert.IsNotNull(shippings);
|
||||||
|
Assert.IsTrue(shippings.All(s => !s.IsAllMeasured));
|
||||||
|
}
|
||||||
|
|
||||||
|
//[TestMethod]
|
||||||
|
//[DataRow(1)]
|
||||||
|
public async Task<Shipping> GetShippingByIdTest(int shippingId)
|
||||||
|
{
|
||||||
|
var shipping = await _signalRClient.GetShippingById(shippingId);
|
||||||
|
|
||||||
|
Assert.IsNotNull(shipping);
|
||||||
|
Assert.IsNotNull(shipping.ShippingDocuments);
|
||||||
|
|
||||||
|
Assert.IsTrue(shipping.Id == shippingId);
|
||||||
|
Assert.IsTrue(shipping.ShippingDocuments.All(s => s.ShippingId == shippingId));
|
||||||
|
Assert.IsTrue(shipping.ShippingDocuments.All(sd => sd.ShippingItems != null && sd.ShippingItems.Any(si => si.ShippingDocumentId == sd.Id)));
|
||||||
|
|
||||||
|
return shipping;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DataTestMethod]
|
||||||
|
[DataRow(1)]
|
||||||
|
public async Task UpdateShippingTest(int shippingId)
|
||||||
|
{
|
||||||
|
var shipping = await GetShippingByIdTest(shippingId);
|
||||||
|
var newLicencePlate = GetFixtureName(shipping.LicencePlate);
|
||||||
|
|
||||||
|
shipping.LicencePlate = newLicencePlate;
|
||||||
|
await _signalRClient.UpdateShipping(shipping);
|
||||||
|
|
||||||
|
shipping = await GetShippingByIdTest(shippingId);
|
||||||
|
Assert.IsTrue(shipping.LicencePlate == newLicencePlate);
|
||||||
|
|
||||||
|
shipping.LicencePlate = GetOriginalName(shipping.LicencePlate);
|
||||||
|
await _signalRClient.UpdateShipping(shipping);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Shipping
|
||||||
|
|
||||||
|
#region ShippingItem
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetShippingItemsTest()
|
||||||
|
{
|
||||||
|
var shippingItems = await _signalRClient.GetShippingItems();
|
||||||
|
|
||||||
|
Assert.IsNotNull(shippingItems);
|
||||||
|
Assert.IsTrue(shippingItems.Count != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//[TestMethod]
|
||||||
|
//[DataRow(1)]
|
||||||
|
public async Task<ShippingItem> GetShippingItemByIdTest(int shippingItemeId)
|
||||||
|
{
|
||||||
|
var shippingItem = await _signalRClient.GetShippingItemById(shippingItemeId);
|
||||||
|
|
||||||
|
Assert.IsNotNull(shippingItem);
|
||||||
|
Assert.IsTrue(shippingItem.Id == shippingItemeId);
|
||||||
|
|
||||||
|
return shippingItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DataTestMethod]
|
||||||
|
[DataRow(1)]
|
||||||
|
public async Task UpdateShippingItemTest(int shippingItemId)
|
||||||
|
{
|
||||||
|
var shippingItem = await GetShippingItemByIdTest(shippingItemId);
|
||||||
|
var newName = GetFixtureName(shippingItem.Name);
|
||||||
|
|
||||||
|
shippingItem.Name = newName;
|
||||||
|
await _signalRClient.UpdateShippingItem(shippingItem);
|
||||||
|
|
||||||
|
shippingItem = await GetShippingItemByIdTest(shippingItemId);
|
||||||
|
Assert.IsTrue(shippingItem.Name == newName);
|
||||||
|
|
||||||
|
shippingItem.Name = GetOriginalName(shippingItem.Name);
|
||||||
|
await _signalRClient.UpdateShippingItem(shippingItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion ShippingItem
|
||||||
|
|
||||||
|
#region ShippingDocument
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetShippingDocumentsTest()
|
||||||
|
{
|
||||||
|
var shippingDocuments = await _signalRClient.GetShippingDocuments();
|
||||||
|
|
||||||
|
Assert.IsNotNull(shippingDocuments);
|
||||||
|
Assert.IsTrue(shippingDocuments.Count != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//[TestMethod]
|
||||||
|
//[DataRow(2)]
|
||||||
|
public async Task<ShippingDocument> GetShippingDocumentByIdTest(int shippingDocumentId)
|
||||||
|
{
|
||||||
|
var shippingDocument = await _signalRClient.GetShippingDocumentById(shippingDocumentId);
|
||||||
|
|
||||||
|
Assert.IsNotNull(shippingDocument);
|
||||||
|
Assert.IsTrue(shippingDocument.Id == shippingDocumentId);
|
||||||
|
|
||||||
|
return shippingDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
[DataTestMethod]
|
||||||
|
[DataRow(2)]
|
||||||
|
public async Task UpdateShippingDocumentTest(int shippingDocumentId)
|
||||||
|
{
|
||||||
|
var shippingDocument = await GetShippingDocumentByIdTest(shippingDocumentId);
|
||||||
|
var newCountry = GetFixtureName(shippingDocument.Country);
|
||||||
|
|
||||||
|
shippingDocument.Country = newCountry;
|
||||||
|
await _signalRClient.UpdateShippingDocument(shippingDocument);
|
||||||
|
|
||||||
|
shippingDocument = await GetShippingDocumentByIdTest(shippingDocumentId);
|
||||||
|
Assert.IsTrue(shippingDocument.Country == newCountry);
|
||||||
|
|
||||||
|
shippingDocument.Country = GetOriginalName(shippingDocument.Country);
|
||||||
|
await _signalRClient.UpdateShippingDocument(shippingDocument);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion ShippingDocument
|
||||||
|
|
||||||
|
#region Customer
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetMeasuringUsersTest()
|
||||||
|
{
|
||||||
|
var users = await _signalRClient.GetMeasuringUsers();
|
||||||
|
|
||||||
|
Assert.IsNotNull(users);
|
||||||
|
Assert.IsTrue(users.Count != 0);
|
||||||
|
Assert.IsTrue(users.All(x => !x.Email.IsNullOrEmpty() && !x.Deleted));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Customer
|
||||||
|
|
||||||
|
#region Product
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public async Task GetProductDtosTest()
|
||||||
|
{
|
||||||
|
var productDto = await _signalRClient.GetProductDtos();
|
||||||
|
|
||||||
|
Assert.IsNotNull(productDto);
|
||||||
|
Assert.IsTrue(productDto.Count != 0);
|
||||||
|
Assert.IsTrue(productDto.All(x => !x.Name.IsNullOrEmpty() && !x.Deleted));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Product
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
[DataRow("aasd@dsserver.com", "Asdasd123456")]
|
||||||
|
public async Task LoginMeasuringUserTest_TrueIfHasCustomerDto(string email, string password)
|
||||||
|
{
|
||||||
|
var loginModelResponse = await _signalRClient.LoginMeasuringUser(email, password);
|
||||||
|
|
||||||
|
Assert.IsNotNull(loginModelResponse);
|
||||||
|
Assert.IsNotNull(loginModelResponse.CustomerDto, loginModelResponse.ErrorMessage);
|
||||||
|
|
||||||
|
Assert.IsTrue(loginModelResponse.CustomerDto.Email == email, loginModelResponse.ErrorMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
[DataRow("adam.g@aycode.com", "123")]
|
||||||
|
public async Task LoginMeasuringUserTest_TrueIfHasNotCustomerDto(string email, string password)
|
||||||
|
{
|
||||||
|
var loginModelResponse = await _signalRClient.LoginMeasuringUser(email, password);
|
||||||
|
|
||||||
|
Assert.IsNotNull(loginModelResponse);
|
||||||
|
Assert.IsNull(loginModelResponse.CustomerDto);
|
||||||
|
|
||||||
|
Assert.IsFalse(loginModelResponse.ErrorMessage.IsNullOrWhiteSpace());
|
||||||
|
Console.WriteLine($"Succes: {loginModelResponse.ErrorMessage}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
<Project Sdk="MSTest.Sdk/3.6.4">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<!--
|
||||||
|
Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
|
||||||
|
For more information, visit https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-integration-dotnet-test#show-failure-per-test
|
||||||
|
-->
|
||||||
|
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Shared.Common\FruitBankHybrid.Shared.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Utils">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mango.Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Data">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Data.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Services">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<SupportedPlatform Include="browser" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Blazor" Version="25.1.*" />
|
||||||
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Interfaces">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Interfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Models">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Models.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Utils">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.Resources.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.Resources.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.v25.1.Viewer">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.v25.1.Viewer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Data.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Data.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Utils.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Utils.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mango.Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nop.Core">
|
||||||
|
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
@inherits LayoutComponentBase
|
||||||
|
|
||||||
|
<div class="page">
|
||||||
|
<div class="sidebar">
|
||||||
|
<NavMenu />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<div class="top-row px-4">
|
||||||
|
<a href="">Kijelentkezés</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<article class="content px-4">
|
||||||
|
@Body
|
||||||
|
</article>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="blazor-error-ui" data-nosnippet>
|
||||||
|
An unhandled error has occurred.
|
||||||
|
<a href="." class="reload">Reload</a>
|
||||||
|
<span class="dismiss">🗙</span>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
.page {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
border-bottom: 1px solid #d6d5d5;
|
||||||
|
justify-content: flex-end;
|
||||||
|
height: 3.5rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row ::deep a:first-child {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640.98px) {
|
||||||
|
.top-row {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 641px) {
|
||||||
|
.page {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
width: 250px;
|
||||||
|
height: 100vh;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row.auth ::deep a:first-child {
|
||||||
|
flex: 1;
|
||||||
|
text-align: right;
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row, article {
|
||||||
|
padding-left: 2rem !important;
|
||||||
|
padding-right: 1.5rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#blazor-error-ui {
|
||||||
|
background: lightyellow;
|
||||||
|
bottom: 0;
|
||||||
|
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: none;
|
||||||
|
left: 0;
|
||||||
|
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#blazor-error-ui .dismiss {
|
||||||
|
cursor: pointer;
|
||||||
|
position: absolute;
|
||||||
|
right: 0.75rem;
|
||||||
|
top: 0.5rem;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
<div class="top-row ps-3 navbar navbar-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="">FruitBank Measuring</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
|
||||||
|
|
||||||
|
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
|
||||||
|
<nav class="flex-column">
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||||
|
<span class="icon home-icon" aria-hidden="true"></span> Kezdőlap
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="MeasuringIn">
|
||||||
|
<span class="icon counter-icon" aria-hidden="true"></span> Bejövő mérés
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="MeasuringOut">
|
||||||
|
<span class="icon counter-icon" aria-hidden="true"></span> Kimenő mérés
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="Login">
|
||||||
|
<span class="icon weather-icon" aria-hidden="true"></span> Bejelentkezés
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<div class="top-row ps-3 navbar navbar-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<a class="navbar-brand" href="">FruitBankHybrid</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
|
||||||
|
|
||||||
|
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
|
||||||
|
<nav class="flex-column">
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
|
||||||
|
<span class="icon home-icon" aria-hidden="true"></span> Home
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="counter">
|
||||||
|
<span class="icon counter-icon" aria-hidden="true"></span> Counter
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="nav-item px-3">
|
||||||
|
<NavLink class="nav-link" href="weather">
|
||||||
|
<span class="icon weather-icon" aria-hidden="true"></span> Weather
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,101 @@
|
||||||
|
.navbar-toggler {
|
||||||
|
appearance: none;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 3.5rem;
|
||||||
|
height: 2.5rem;
|
||||||
|
color: white;
|
||||||
|
position: absolute;
|
||||||
|
top: 0.5rem;
|
||||||
|
right: 1rem;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 0.3rem;
|
||||||
|
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-toggler:checked {
|
||||||
|
background-color: rgb(10, 14, 57);
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row {
|
||||||
|
height: 3.5rem;
|
||||||
|
background-color: rgba(0,0,0,0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-brand {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
::deep .icon {
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
margin-right: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
::deep .home-icon {
|
||||||
|
--icon-mask-image: var(--icon-home-mask-image);
|
||||||
|
}
|
||||||
|
|
||||||
|
::deep .weather-icon {
|
||||||
|
--icon-mask-image: var(--icon-weather-mask-image);
|
||||||
|
}
|
||||||
|
|
||||||
|
::deep .counter-icon {
|
||||||
|
--icon-mask-image: var(--icon-counter-mask-image);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:first-of-type {
|
||||||
|
padding-top: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:last-of-type {
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item ::deep .nav-link {
|
||||||
|
color: #d7d7d7;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
height: 3rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
line-height: 3rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item ::deep a.active {
|
||||||
|
background-color: rgba(255,255,255,0.37);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item ::deep .nav-link:hover {
|
||||||
|
background-color: rgba(255,255,255,0.1);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-scrollable {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-toggler:checked ~ .nav-scrollable {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 641px) {
|
||||||
|
.navbar-toggler {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-scrollable {
|
||||||
|
/* Never collapse the sidebar for wide screens */
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
/* Allow sidebar to scroll for tall menus */
|
||||||
|
height: calc(100vh - 3.5rem);
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
@page "/"
|
||||||
|
@using FruitBankHybrid.Shared.Services
|
||||||
|
@inject IFormFactor FormFactor
|
||||||
|
|
||||||
|
<PageTitle>Kezdőlap</PageTitle>
|
||||||
|
|
||||||
|
<h1>Kezdőlap</h1>
|
||||||
|
|
||||||
|
Welcome to your new app running on <em>@Factor</em> using <em>@Platform</em>.
|
||||||
|
|
||||||
|
<div class="row cw-480" style="margin-top: 100px;">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<NavLink href="MeasuringIn">
|
||||||
|
<span class="icon counter-icon" aria-hidden="true"></span> Bejövő mérés
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<NavLink href="MeasuringOut">
|
||||||
|
<span class="icon counter-icon" aria-hidden="true"></span> Kimenő mérés
|
||||||
|
</NavLink>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Pages;
|
||||||
|
|
||||||
|
public partial class Home : ComponentBase
|
||||||
|
{
|
||||||
|
private string Factor => FormFactor.GetFormFactor();
|
||||||
|
private string Platform => FormFactor.GetPlatform();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
@page "/Login"
|
||||||
|
@using Mango.Nop.Core.Dtos
|
||||||
|
|
||||||
|
<h3>Bejelentkezés</h3>
|
||||||
|
|
||||||
|
<div class="row cw-480" style="margin-top: 30px;">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<DxComboBox Data="@Users"
|
||||||
|
@bind-Value="@SelectedUser"
|
||||||
|
Text="Select Employee"
|
||||||
|
ValueFieldName="@nameof(CustomerDto.Id)"
|
||||||
|
TextFieldName="@nameof(CustomerDto.FullName)"
|
||||||
|
CssClass="cw-480"
|
||||||
|
InputId="cbItemTemplate">
|
||||||
|
<ItemDisplayTemplate>
|
||||||
|
<div class="combobox-item-template">
|
||||||
|
<img src="@GetImageFileName(context.DataItem)" alt="@context.DataItem.Email" />
|
||||||
|
<div class="combobox-item-template-text">
|
||||||
|
<span>@context.DataItem.FullName</span>
|
||||||
|
<span class="combobox-item-template-employee-phone">@context.DataItem.Email</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ItemDisplayTemplate>
|
||||||
|
</DxComboBox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<DxTextBox @bind-Text="@PasswordValue"
|
||||||
|
@onkeydown="OnPasswordKeyDown"
|
||||||
|
Password="true"
|
||||||
|
CssClass="cw-320"
|
||||||
|
ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"
|
||||||
|
BindValueMode="BindValueMode.OnInput"
|
||||||
|
NullText="Enter password"
|
||||||
|
InputId="tbPassword" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cw-480" style="margin-top: 20px;">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<DxButton Text="Bejelentkezés"
|
||||||
|
Click="OnLoginClick"
|
||||||
|
CssClass="w-100" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cw-480" style="margin-top: 30px;">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<b>@(LoginModelResponse?.CustomerDto == null ? LoginModelResponse?.ErrorMessage : LoginModelResponse?.CustomerDto.FullName)</b>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
using AyCode.Core.Helpers;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Interfaces.Users;
|
||||||
|
using AyCode.Utils.Extensions;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
using FruitBankHybrid.Shared.Services.Loggers;
|
||||||
|
using FruitBankHybrid.Shared.Services.SignalRs;
|
||||||
|
using Mango.Nop.Core.Dtos;
|
||||||
|
using Mango.Nop.Core.Models;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.AspNetCore.Components.Web;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Pages;
|
||||||
|
|
||||||
|
public partial class Login : ComponentBase
|
||||||
|
{
|
||||||
|
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||||
|
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
|
||||||
|
|
||||||
|
private ILogger _logger = null!;
|
||||||
|
private List<CustomerDto> Users { get; set; }
|
||||||
|
private CustomerDto? SelectedUser { get; set; }
|
||||||
|
private string PasswordValue { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
private MgLoginModelResponse? LoginModelResponse { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
_logger = new LoggerClient<Login>(LogWriters.ToArray());
|
||||||
|
_logger.Info("OnInitializedAsync");
|
||||||
|
|
||||||
|
Users = await FruitBankSignalRClient.GetMeasuringUsers() ?? [];
|
||||||
|
SelectedUser = Users.FirstOrDefault();
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task OnLoginClick()
|
||||||
|
{
|
||||||
|
if (SelectedUser == null || PasswordValue.IsNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
LoginModelResponse = new MgLoginModelResponse
|
||||||
|
{
|
||||||
|
ErrorMessage = "Válasszon felhsználót és adja meg a jelszavát!"
|
||||||
|
};
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginModelResponse = await FruitBankSignalRClient.LoginMeasuringUser(SelectedUser.Email, PasswordValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async Task OnPasswordKeyDown(KeyboardEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Key == "Enter") await OnLoginClick();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetImageFileName(CustomerDto employee)
|
||||||
|
{
|
||||||
|
//return StaticAssetUtils.GetEmployeeImagePath(employee.Id);
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
.combobox-item-template {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-item-template > img {
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
img + .combobox-item-template-text {
|
||||||
|
margin-left: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-item-template-text {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-item-template-employee-phone {
|
||||||
|
opacity: 0.65;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
@page "/MeasuringIn"
|
||||||
|
@using DevExpress.Blazor
|
||||||
|
@using DevExpress.Blazor.Internal
|
||||||
|
@using FruitBank.Common.Entities
|
||||||
|
@using FruitBankHybrid.Shared.Services
|
||||||
|
@using Mango.Nop.Core.Dtos
|
||||||
|
|
||||||
|
|
||||||
|
<h3>Bejövő mérés</h3>
|
||||||
|
|
||||||
|
<div class="row cw-480" style="margin-top: 50px;">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="cbNotMeasuredShippings" class="demo-text mb-1">Szállítmány</label>
|
||||||
|
<DxComboBox Data="@NotMeasuredShippings"
|
||||||
|
@bind-Value="@SelectedShipping"
|
||||||
|
Text="Select shipping"
|
||||||
|
ValueFieldName="@nameof(Shipping.Id)"
|
||||||
|
TextFieldName="@nameof(Shipping.ShippingDate)"
|
||||||
|
CssClass="cw-480"
|
||||||
|
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<Shipping> args) => OnSelectedShippingChanged(args))"
|
||||||
|
InputId="cbNotMeasuredShippings">
|
||||||
|
<ItemDisplayTemplate>
|
||||||
|
<div class="combobox-item-template">
|
||||||
|
<div class="combobox-item-template-text">
|
||||||
|
<span>@($"{context.DataItem.ShippingDate} [{context.DataItem.LicencePlate}]")</span>
|
||||||
|
@* <span class="combobox-item-template-employee-phone">@(string.Join("; ", context.DataItem?.ShippingDocuments?.Select(x => x.Partner?.Name ?? string.Empty)))</span> *@
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ItemDisplayTemplate>
|
||||||
|
</DxComboBox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="cbShippingDocument" class="demo-text mb-1">Dokumentum</label>
|
||||||
|
<DxComboBox Data="@SelectedShipping?.ShippingDocuments"
|
||||||
|
@bind-Value="@SelectedShippingDocument"
|
||||||
|
Text="Select document"
|
||||||
|
ValueFieldName="@nameof(ShippingDocument.Id)"
|
||||||
|
TextFieldName="@(nameof(ShippingDocument.Partner) + '.' + nameof(Partner.Name))"
|
||||||
|
CssClass="cw-480"
|
||||||
|
SelectedDataItemChanged="@((SelectedDataItemChangedEventArgs<ShippingDocument> args) => OnSelectedShippingDocumentChanged(args))"
|
||||||
|
InputId="cbShippingDocument" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="cbShippingItem" class="demo-text mb-1">Termék</label>
|
||||||
|
<DxComboBox Data="@SelectedShippingDocument?.ShippingItems"
|
||||||
|
@bind-Value="@SelectedShippingItem"
|
||||||
|
Text="Select item"
|
||||||
|
ValueFieldName="@nameof(ShippingItem.Id)"
|
||||||
|
TextFieldName="@(nameof(ShippingItem.Name))"
|
||||||
|
CssClass="cw-480"
|
||||||
|
InputId="cbShippingItem" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cw-480" style="margin-top: 100px;">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<input @bind="_userName" placeholder="Your name" />
|
||||||
|
<input @bind="_message" placeholder="Partner ID..." />
|
||||||
|
<button @onclick="GetPartner">Get partner</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row cw-480">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<ul>
|
||||||
|
@foreach (var m in _messages)
|
||||||
|
{
|
||||||
|
<li><b>@m.User:</b> @m.Text</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
using AyCode.Core.Helpers;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Models.Users;
|
||||||
|
using DevExpress.Blazor;
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
using FruitBank.Common.Models;
|
||||||
|
using FruitBankHybrid.Shared.Services.Loggers;
|
||||||
|
using FruitBankHybrid.Shared.Services.SignalRs;
|
||||||
|
using Mango.Nop.Core.Dtos;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.JSInterop;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static System.Net.Mime.MediaTypeNames;
|
||||||
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||||
|
using ILogger = FruitBank.Common.Loggers.ILogger;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Pages
|
||||||
|
{
|
||||||
|
public partial class MeasuringIn : ComponentBase
|
||||||
|
{
|
||||||
|
[Inject] public required IEnumerable<IAcLogWriterClientBase> LogWriters { get; set; }
|
||||||
|
[Inject] public required FruitBankSignalRClient FruitBankSignalRClient { get; set; }
|
||||||
|
|
||||||
|
private ILogger _logger = null!;
|
||||||
|
|
||||||
|
private List<Shipping> NotMeasuredShippings { get; set; } = null!;
|
||||||
|
private Shipping? SelectedShipping { get; set; }
|
||||||
|
private ShippingDocument? SelectedShippingDocument { get; set; }
|
||||||
|
private ShippingItem? SelectedShippingItem { get; set; }
|
||||||
|
|
||||||
|
private string _userName = "Partner name";
|
||||||
|
private string _message = string.Empty;
|
||||||
|
private readonly List<(string User, string Text)> _messages = [];
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
_logger = new LoggerClient<MeasuringIn>(LogWriters.ToArray());
|
||||||
|
_logger.Info("OnInitializedAsync");
|
||||||
|
|
||||||
|
NotMeasuredShippings = await FruitBankSignalRClient.GetNotMeasuredShippings() ?? [];
|
||||||
|
SelectedShipping = NotMeasuredShippings?.FirstOrDefault();
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnSelectedShippingChanged(SelectedDataItemChangedEventArgs<Shipping> eventArgs)
|
||||||
|
{
|
||||||
|
SelectedShippingDocument = eventArgs.DataItem.ShippingDocuments?.FirstOrDefault();
|
||||||
|
SelectedShippingItem = SelectedShippingDocument?.ShippingItems?.FirstOrDefault();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnSelectedShippingDocumentChanged(SelectedDataItemChangedEventArgs<ShippingDocument> eventArgs)
|
||||||
|
{
|
||||||
|
SelectedShippingItem = eventArgs.DataItem?.ShippingItems?.FirstOrDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task GetPartner()
|
||||||
|
{
|
||||||
|
var measuringModel = new MeasuringModel();
|
||||||
|
|
||||||
|
if (int.TryParse(_message, out var partnerId))
|
||||||
|
{
|
||||||
|
_message = string.Empty;
|
||||||
|
|
||||||
|
measuringModel.Name = (await FruitBankSignalRClient.GetPartnerById(partnerId))?.Name!;
|
||||||
|
//measuringModel.Name = (await FruitBankSignalRClient.GetMeasuringModelByShippingId(partnerId))?.Name!;
|
||||||
|
}
|
||||||
|
|
||||||
|
_messages.Add((_userName, measuringModel?.Name ?? "ERROR"));
|
||||||
|
//StateHasChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
@page "/MeasuringOut"
|
||||||
|
<h3>Kimenő mérés</h3>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Pages
|
||||||
|
{
|
||||||
|
public partial class MeasuringOut : ComponentBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<Router AppAssembly="typeof(Layout.MainLayout).Assembly">
|
||||||
|
<Found Context="routeData">
|
||||||
|
<RouteView RouteData="routeData" DefaultLayout="typeof(Layout.MainLayout)" />
|
||||||
|
<FocusOnNavigate RouteData="routeData" Selector="h1" />
|
||||||
|
</Found>
|
||||||
|
</Router>
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace FruitBankHybrid.Shared.Services
|
||||||
|
{
|
||||||
|
public interface IFormFactor
|
||||||
|
{
|
||||||
|
public string GetFormFactor();
|
||||||
|
public string GetPlatform();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
using AyCode.Core.Enums;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using FruitBank.Common;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Services.Loggers;
|
||||||
|
|
||||||
|
public class LoggerClient : Logger, ILogger
|
||||||
|
{
|
||||||
|
public LoggerClient() : this(null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoggerClient(string? categoryName) : base(AppType.Web, FruitBankConstClient.DefaultLogLevelClient, categoryName)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public LoggerClient(string? categoryName, params IAcLogWriterBase[] logWriters) : base(AppType.Web, FruitBankConstClient.DefaultLogLevelClient, categoryName, logWriters)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public LoggerClient(AppType appType, LogLevel logLevel, string? categoryName, params IAcLogWriterBase[] logWriters) : base(appType, logLevel, categoryName, logWriters)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class LoggerClient<TCategory> : LoggerClient, ILogger<TCategory>
|
||||||
|
{
|
||||||
|
public LoggerClient() : base(AppType.Web, FruitBankConstClient.DefaultLogLevelClient, typeof(TCategory).Name)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public LoggerClient(params IAcLogWriterClientBase[] logWriters) : base(AppType.Web, FruitBankConstClient.DefaultLogLevelClient, typeof(TCategory).Name, logWriters)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
public LoggerClient(AppType appType, LogLevel logLevel, params IAcLogWriterClientBase[] logWriters) : base(appType, logLevel, typeof(TCategory).Name, logWriters)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
using AyCode.Core.Helpers;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Server.SignalRs;
|
||||||
|
using AyCode.Services.SignalRs;
|
||||||
|
using FruitBank.Common;
|
||||||
|
using FruitBank.Common.Entities;
|
||||||
|
using FruitBank.Common.Interfaces;
|
||||||
|
using FruitBank.Common.Models;
|
||||||
|
using FruitBank.Common.SignalRs;
|
||||||
|
using FruitBankHybrid.Shared.Services.Loggers;
|
||||||
|
using Mango.Nop.Core.Dtos;
|
||||||
|
using Mango.Nop.Core.Models;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Shared.Services.SignalRs
|
||||||
|
{
|
||||||
|
public class FruitBankSignalRClient : AcSignalRClientBase, IFruitBankDataControllerClient
|
||||||
|
{
|
||||||
|
public FruitBankSignalRClient( /*IServiceProvider serviceProvider, */ IEnumerable<IAcLogWriterClientBase> logWriters) : base($"{FruitBankConstClient.BaseUrl}/{FruitBankConstClient.DefaultHubName}", new LoggerClient(nameof(FruitBankSignalRClient), logWriters.ToArray()))
|
||||||
|
{
|
||||||
|
ConstHelper.NameByValue<SignalRTags>(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<MeasuringModel?> GetMeasuringModelByShippingId(int shippingId)
|
||||||
|
=> GetByIdAsync<MeasuringModel>(SignalRTags.GetMeasuringModelByShippingId, shippingId);
|
||||||
|
|
||||||
|
//public Task GetWelcomeMessageAsync(string message, Action? callback = null)
|
||||||
|
//{
|
||||||
|
// Logger.Detail($"GetWelcomeMessageAsync client called; message: {message}");
|
||||||
|
|
||||||
|
// return GetAllAsync<string>(SignalRTags.GetAllTransferDestinations, callback);
|
||||||
|
//}
|
||||||
|
|
||||||
|
public Task<List<MeasuringModel>?> GetMeasuringModels()
|
||||||
|
=> GetAllAsync<List<MeasuringModel>>(SignalRTags.GetMeasuringModels);
|
||||||
|
|
||||||
|
public Task<List<Partner>?> GetPartners()
|
||||||
|
=> GetAllAsync<List<Partner>>(SignalRTags.GetPartners);
|
||||||
|
|
||||||
|
#region Partner
|
||||||
|
|
||||||
|
public Task<Partner?> GetPartnerById(int id)
|
||||||
|
=> GetByIdAsync<Partner?>(SignalRTags.GetPartnerById, id);
|
||||||
|
|
||||||
|
public Task<Partner?> UpdatePartner(Partner partner)
|
||||||
|
=> PostDataAsync(SignalRTags.UpdatePartner, partner);
|
||||||
|
|
||||||
|
#endregion Partner
|
||||||
|
|
||||||
|
#region Shipping
|
||||||
|
|
||||||
|
public Task<List<Shipping>?> GetShippings()
|
||||||
|
=> GetAllAsync<List<Shipping>>(SignalRTags.GetShippings);
|
||||||
|
|
||||||
|
public Task<List<Shipping>?> GetNotMeasuredShippings()
|
||||||
|
=> GetAllAsync<List<Shipping>>(SignalRTags.GetNotMeasuredShippings);
|
||||||
|
|
||||||
|
public Task<Shipping?> GetShippingById(int id)
|
||||||
|
=> GetByIdAsync<Shipping?>(SignalRTags.GetShippingById, id);
|
||||||
|
|
||||||
|
public Task<Shipping?> UpdateShipping(Shipping shipping)
|
||||||
|
=> PostDataAsync(SignalRTags.UpdateShipping, shipping);
|
||||||
|
|
||||||
|
#endregion Shipping
|
||||||
|
|
||||||
|
#region ShippingItem
|
||||||
|
|
||||||
|
public Task<List<ShippingItem>?> GetShippingItems()
|
||||||
|
=> GetAllAsync<List<ShippingItem>>(SignalRTags.GetShippingItems);
|
||||||
|
|
||||||
|
public Task<ShippingItem?> GetShippingItemById(int id)
|
||||||
|
=> GetByIdAsync<ShippingItem?>(SignalRTags.GetShippingItemById, id);
|
||||||
|
|
||||||
|
public Task<ShippingItem?> UpdateShippingItem(ShippingItem shippingItem)
|
||||||
|
=> PostDataAsync(SignalRTags.UpdateShippingItem, shippingItem);
|
||||||
|
#endregion ShippingItem
|
||||||
|
|
||||||
|
#region ShippingDocument
|
||||||
|
|
||||||
|
public Task<List<ShippingDocument>?> GetShippingDocuments()
|
||||||
|
=> GetAllAsync<List<ShippingDocument>>(SignalRTags.GetShippingDocuments);
|
||||||
|
|
||||||
|
public Task<ShippingDocument?> GetShippingDocumentById(int id)
|
||||||
|
=> GetByIdAsync<ShippingDocument?>(SignalRTags.GetShippingDocumentById, id);
|
||||||
|
|
||||||
|
public Task<ShippingDocument?> UpdateShippingDocument(ShippingDocument shippingDocument)
|
||||||
|
=> PostDataAsync(SignalRTags.UpdateShippingDocument, shippingDocument);
|
||||||
|
#endregion ShippingDocument
|
||||||
|
|
||||||
|
#region Customer
|
||||||
|
|
||||||
|
public Task<List<CustomerDto>?> GetMeasuringUsers()
|
||||||
|
=> GetAllAsync<List<CustomerDto>>(SignalRTags.GetMeasuringUsers);
|
||||||
|
|
||||||
|
#endregion Customer
|
||||||
|
|
||||||
|
#region Product
|
||||||
|
|
||||||
|
public Task<List<ProductDto>?> GetProductDtos()
|
||||||
|
=> GetAllAsync<List<ProductDto>>(SignalRTags.GetProductDtos);
|
||||||
|
#endregion Product
|
||||||
|
|
||||||
|
#region Authenticate
|
||||||
|
public Task<MgLoginModelResponse?> LoginMeasuringUser(string customerEmail, string customerPassword)
|
||||||
|
=> LoginMeasuringUser(new MgLoginModelRequest(customerEmail, customerPassword));
|
||||||
|
|
||||||
|
public Task<MgLoginModelResponse?> LoginMeasuringUser(MgLoginModelRequest loginModelRequest)
|
||||||
|
=> PostDataAsync<MgLoginModelRequest, MgLoginModelResponse>(SignalRTags.AuthenticateUser, loginModelRequest);
|
||||||
|
#endregion Authenticate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
@using System.Net.Http
|
||||||
|
@using System.Net.Http.Json
|
||||||
|
@using Microsoft.AspNetCore.Components.Forms
|
||||||
|
@using Microsoft.AspNetCore.Components.Routing
|
||||||
|
@using Microsoft.AspNetCore.Components.Web
|
||||||
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
|
@using Microsoft.JSInterop
|
||||||
|
|
||||||
|
@using DevExpress.Blazor
|
||||||
|
After Width: | Height: | Size: 584 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
|
@ -0,0 +1,59 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
|
||||||
|
<StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Blazor" Version="25.1.*" />
|
||||||
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Interfaces">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Interfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Models">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Models.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Utils">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.Resources.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.Resources.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.v25.1.Viewer">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.v25.1.Viewer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Data.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Data.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Utils.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Utils.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
using FruitBankHybrid.Shared.Services;
|
||||||
|
using FruitBankHybrid.Shared.Services.SignalRs;
|
||||||
|
using FruitBankHybrid.Web.Client.Services;
|
||||||
|
using FruitBankHybrid.Web.Client.Services.Loggers;
|
||||||
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||||
|
|
||||||
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
|
|
||||||
|
builder.Services.AddDevExpressBlazor();
|
||||||
|
|
||||||
|
// Add device-specific services used by the FruitBankHybrid.Shared project
|
||||||
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
||||||
|
//builder.Services.AddScoped<ISignalRService, SignalRService>();
|
||||||
|
|
||||||
|
builder.Services.AddScoped<FruitBankSignalRClient>();
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterClientBase, BrowserConsoleLogWriter>();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterClientBase, SignaRClientLogItemWriter>();
|
||||||
|
|
||||||
|
await builder.Build().RunAsync();
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using FruitBankHybrid.Shared.Services;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Web.Client.Services
|
||||||
|
{
|
||||||
|
public class FormFactor : IFormFactor
|
||||||
|
{
|
||||||
|
public string GetFormFactor()
|
||||||
|
{
|
||||||
|
return "WebAssembly";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetPlatform()
|
||||||
|
{
|
||||||
|
return Environment.OSVersion.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
using AyCode.Core.Enums;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using AyCode.Services.Loggers;
|
||||||
|
using FruitBank.Common;
|
||||||
|
using Microsoft.JSInterop;
|
||||||
|
using LogLevel = AyCode.Core.Loggers.LogLevel;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Web.Client.Services.Loggers;
|
||||||
|
|
||||||
|
public class BrowserConsoleLogWriter(IJSRuntime jsRuntime) : AcBrowserConsoleLogWriter(jsRuntime, AppType.Web, FruitBankConstClient.DefaultLogLevelClient)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
@using System.Net.Http
|
||||||
|
@using System.Net.Http.Json
|
||||||
|
@using Microsoft.AspNetCore.Components.Forms
|
||||||
|
@using Microsoft.AspNetCore.Components.Routing
|
||||||
|
@using Microsoft.AspNetCore.Components.Web
|
||||||
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
|
@using Microsoft.JSInterop
|
||||||
|
@using FruitBankHybrid.Shared
|
||||||
|
@using FruitBankHybrid.Web.Client
|
||||||
|
|
||||||
|
@using DevExpress.Blazor
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
@using Microsoft.AspNetCore.Mvc.ViewFeatures
|
||||||
|
@inject IFileVersionProvider FileVersionProvider
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<base href="/" />
|
||||||
|
@DxResourceManager.RegisterScripts()
|
||||||
|
@DxResourceManager.RegisterTheme(Themes.Fluent)
|
||||||
|
<link href=@AppendVersion("_content/FruitBankHybrid.Shared/bootstrap/bootstrap.min.css") rel="stylesheet" />
|
||||||
|
<link href=@AppendVersion("_content/FruitBankHybrid.Shared/app.css") rel="stylesheet" />
|
||||||
|
<link href=@AppendVersion("FruitBankHybrid.Web.styles.css") rel="stylesheet" />
|
||||||
|
<link href=@AppendVersion("_content/FruitBankHybrid.Shared/favicon.png") rel="icon" type="image/png" />
|
||||||
|
<HeadOutlet @rendermode="InteractiveWebAssembly" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="dxbl-theme-fluent">
|
||||||
|
<Routes @rendermode="InteractiveWebAssembly" />
|
||||||
|
<script src="_framework/blazor.web.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
private string AppendVersion(string path) => FileVersionProvider.AddFileVersionToPath("/", path);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
@page "/Error"
|
||||||
|
@using System.Diagnostics
|
||||||
|
|
||||||
|
<PageTitle>Error</PageTitle>
|
||||||
|
|
||||||
|
<h1 class="text-danger">Error.</h1>
|
||||||
|
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||||
|
|
||||||
|
@if (ShowRequestId)
|
||||||
|
{
|
||||||
|
<p>
|
||||||
|
<strong>Request ID:</strong> <code>@RequestId</code>
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
|
||||||
|
<h3>Development Mode</h3>
|
||||||
|
<p>
|
||||||
|
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||||
|
It can result in displaying sensitive information from exceptions to end users.
|
||||||
|
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||||
|
and restarting the app.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
@code{
|
||||||
|
[CascadingParameter]
|
||||||
|
private HttpContext? HttpContext { get; set; }
|
||||||
|
|
||||||
|
private string? RequestId { get; set; }
|
||||||
|
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
|
||||||
|
protected override void OnInitialized() =>
|
||||||
|
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@using System.Net.Http
|
||||||
|
@using System.Net.Http.Json
|
||||||
|
@using Microsoft.AspNetCore.Components.Forms
|
||||||
|
@using Microsoft.AspNetCore.Components.Routing
|
||||||
|
@using Microsoft.AspNetCore.Components.Web
|
||||||
|
@using static Microsoft.AspNetCore.Components.Web.RenderMode
|
||||||
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
|
@using Microsoft.JSInterop
|
||||||
|
@using FruitBankHybrid.Shared
|
||||||
|
@using FruitBankHybrid.Web
|
||||||
|
@using FruitBankHybrid.Web.Client
|
||||||
|
@using FruitBankHybrid.Web.Components
|
||||||
|
|
||||||
|
@using DevExpress.Blazor
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FruitBank.Common.Server\FruitBank.Common.Server.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Shared.Common\FruitBankHybrid.Shared.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Web.Client\FruitBankHybrid.Web.Client.csproj" />
|
||||||
|
|
||||||
|
<PackageReference Include="DevExpress.Blazor" Version="25.1.*" />
|
||||||
|
<PackageReference Include="MessagePack" Version="3.1.4" />
|
||||||
|
<PackageReference Include="MessagePack.Annotations" Version="3.1.4" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="9.0.8" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Core.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Interfaces">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Interfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Interfaces.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Interfaces.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Models">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Models.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Models.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Models.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services.Server">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Utils">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.Resources.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.Resources.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Blazor.v25.1.Viewer">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Blazor.v25.1.Viewer.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Data.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Data.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DevExpress.Utils.v25.1">
|
||||||
|
<HintPath>C:\Program Files\DevExpress 25.1\Components\Bin\NetCore\DevExpress.Utils.v25.1.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Controllers\" />
|
||||||
|
<Folder Include="Services\SignalRs\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using FruitBank.Common;
|
||||||
|
using FruitBank.Common.Server.Services.Loggers;
|
||||||
|
using FruitBank.Common.Server.Services.SignalRs;
|
||||||
|
using FruitBankHybrid.Shared.Services;
|
||||||
|
using FruitBankHybrid.Web.Components;
|
||||||
|
using FruitBankHybrid.Web.Services;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
builder.Services.AddRazorComponents().AddInteractiveServerComponents().AddInteractiveWebAssemblyComponents();
|
||||||
|
builder.Services.AddDevExpressBlazor();
|
||||||
|
builder.Services.AddMvc();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<LoggerToLoggerApiController>();
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterBase, ConsoleLogWriter>();
|
||||||
|
//builder.Services.AddSingleton<SessionService>();
|
||||||
|
|
||||||
|
//builder.Services.AddScoped<IFruitBankDataControllerServer, FruitBankDataController>();
|
||||||
|
builder.Services.AddSignalR(options => options.MaximumReceiveMessageSize = 256 * 1024);
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
// Configure the HTTP request pipeline.
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseWebAssemblyDebugging();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
app.UseExceptionHandler("/Error", createScopeForErrors: true);
|
||||||
|
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||||
|
app.UseHsts();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.MapHub<LoggerSignalRHub>($"/{FruitBankConstClient.LoggerHubName}");
|
||||||
|
app.MapHub<DevAdminSignalRHub>($"/{FruitBankConstClient.DefaultHubName}");
|
||||||
|
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
|
||||||
|
app.UseStaticFiles();
|
||||||
|
app.UseAntiforgery();
|
||||||
|
app.MapStaticAssets();
|
||||||
|
|
||||||
|
app.MapRazorComponents<App>()
|
||||||
|
//.AddInteractiveServerRenderMode()
|
||||||
|
.AddInteractiveWebAssemblyRenderMode()
|
||||||
|
.AddAdditionalAssemblies(
|
||||||
|
typeof(FruitBankHybrid.Shared._Imports).Assembly,
|
||||||
|
typeof(FruitBankHybrid.Web.Client._Imports).Assembly);
|
||||||
|
|
||||||
|
app.Run();
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
using FruitBankHybrid.Shared.Services;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.Web.Services
|
||||||
|
{
|
||||||
|
public class FormFactor : IFormFactor
|
||||||
|
{
|
||||||
|
public string GetFormFactor()
|
||||||
|
{
|
||||||
|
return "Web";
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetPlatform()
|
||||||
|
{
|
||||||
|
return Environment.OSVersion.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
|
||||||
|
"AyCode": {
|
||||||
|
"ProjectId": "aad53443-2ee2-4650-8a99-97e907265e4e",
|
||||||
|
"Urls": {
|
||||||
|
"BaseUrl": "https://localhost:7144",
|
||||||
|
"ApiBaseUrl": "https://localhost:7144"
|
||||||
|
},
|
||||||
|
"Logger": {
|
||||||
|
"AppType": "Server",
|
||||||
|
"LogLevel": "Detail",
|
||||||
|
"LogWriters": [
|
||||||
|
{
|
||||||
|
"LogLevel": "Detail",
|
||||||
|
"LogWriterType": "FruitBank.Common.Server.Services.Loggers.ConsoleLogWriter, FruitBank.Common.Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.14.36414.22
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBankHybrid", "FruitBankHybrid\FruitBankHybrid.csproj", "{85ADEDE3-C271-47DF-B273-2EDB32792CEF}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBankHybrid.Shared", "FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj", "{899988C3-8F36-4B19-A1DE-1D1D85F114D2}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBankHybrid.Web", "FruitBankHybrid.Web\FruitBankHybrid.Web.csproj", "{AB2ED973-EBCD-4098-BF7B-045382221D1B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBankHybrid.Web.Client", "FruitBankHybrid.Web.Client\FruitBankHybrid.Web.Client.csproj", "{4E4B641B-1757-4A37-8FFE-769F6E0C98EC}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBank.Common", "FruitBank.Common\FruitBank.Common.csproj", "{843805DF-6643-1364-D890-14B2E4826278}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBank.Common.Server", "FruitBank.Common.Server\FruitBank.Common.Server.csproj", "{95069D8D-BCD5-77C6-DFAB-3F4C5ADBA85B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBankHybrid.Shared.Common", "FruitBankHybrid.Shared.Common\FruitBankHybrid.Shared.Common.csproj", "{ABEDC482-1EC3-A770-227F-D69CE16F36A5}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FruitBankHybrid.Shared.Tests", "FruitBankHybrid.Shared.Tests\FruitBankHybrid.Shared.Tests.csproj", "{4E4E4917-1CA3-A7D7-40A8-A24A08673EC1}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{85ADEDE3-C271-47DF-B273-2EDB32792CEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{899988C3-8F36-4B19-A1DE-1D1D85F114D2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{AB2ED973-EBCD-4098-BF7B-045382221D1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{AB2ED973-EBCD-4098-BF7B-045382221D1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{AB2ED973-EBCD-4098-BF7B-045382221D1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{AB2ED973-EBCD-4098-BF7B-045382221D1B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4E4B641B-1757-4A37-8FFE-769F6E0C98EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4E4B641B-1757-4A37-8FFE-769F6E0C98EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4E4B641B-1757-4A37-8FFE-769F6E0C98EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4E4B641B-1757-4A37-8FFE-769F6E0C98EC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{843805DF-6643-1364-D890-14B2E4826278}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{843805DF-6643-1364-D890-14B2E4826278}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{843805DF-6643-1364-D890-14B2E4826278}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{843805DF-6643-1364-D890-14B2E4826278}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{95069D8D-BCD5-77C6-DFAB-3F4C5ADBA85B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{95069D8D-BCD5-77C6-DFAB-3F4C5ADBA85B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{95069D8D-BCD5-77C6-DFAB-3F4C5ADBA85B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{95069D8D-BCD5-77C6-DFAB-3F4C5ADBA85B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{ABEDC482-1EC3-A770-227F-D69CE16F36A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{ABEDC482-1EC3-A770-227F-D69CE16F36A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{ABEDC482-1EC3-A770-227F-D69CE16F36A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{ABEDC482-1EC3-A770-227F-D69CE16F36A5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{4E4E4917-1CA3-A7D7-40A8-A24A08673EC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{4E4E4917-1CA3-A7D7-40A8-A24A08673EC1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{4E4E4917-1CA3-A7D7-40A8-A24A08673EC1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{4E4E4917-1CA3-A7D7-40A8-A24A08673EC1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {56AB8345-FF24-4E15-AB54-5A898A5EC496}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:local="clr-namespace:FruitBankHybrid"
|
||||||
|
x:Class="FruitBankHybrid.App">
|
||||||
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
|
||||||
|
<Color x:Key="PageBackgroundColor">#512bdf</Color>
|
||||||
|
<Color x:Key="PrimaryTextColor">White</Color>
|
||||||
|
|
||||||
|
<Style TargetType="Label">
|
||||||
|
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
|
||||||
|
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="TextColor" Value="{DynamicResource PrimaryTextColor}" />
|
||||||
|
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||||
|
<Setter Property="BackgroundColor" Value="#2b0b98" />
|
||||||
|
<Setter Property="Padding" Value="14,10" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
For information about styling .NET MAUI pages
|
||||||
|
please refer to the documentation:
|
||||||
|
https://go.microsoft.com/fwlink/?linkid=2282329
|
||||||
|
-->
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Window CreateWindow(IActivationState? activationState)
|
||||||
|
{
|
||||||
|
return new Window(new MainPage()) { Title = "FruitBankHybrid" };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
@using System.Net.Http
|
||||||
|
@using System.Net.Http.Json
|
||||||
|
@using Microsoft.AspNetCore.Components.Forms
|
||||||
|
@using Microsoft.AspNetCore.Components.Routing
|
||||||
|
@using Microsoft.AspNetCore.Components.Web
|
||||||
|
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||||
|
@using Microsoft.JSInterop
|
||||||
|
@using FruitBankHybrid
|
||||||
|
@using FruitBankHybrid.Components
|
||||||
|
@using FruitBankHybrid.Shared
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
|
||||||
|
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
|
||||||
|
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>FruitBankHybrid</RootNamespace>
|
||||||
|
<UseMaui>true</UseMaui>
|
||||||
|
<SingleProject>true</SingleProject>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<EnableDefaultCssItems>false</EnableDefaultCssItems>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
|
||||||
|
<!-- Display name -->
|
||||||
|
<ApplicationTitle>FruitBank Measuring</ApplicationTitle>
|
||||||
|
|
||||||
|
<!-- App Identifier -->
|
||||||
|
<ApplicationId>com.companyname.blazorapp.1</ApplicationId>
|
||||||
|
|
||||||
|
<!-- Versions -->
|
||||||
|
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||||
|
<ApplicationVersion>1</ApplicationVersion>
|
||||||
|
|
||||||
|
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
||||||
|
<WindowsPackageType>None</WindowsPackageType>
|
||||||
|
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
|
||||||
|
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||||
|
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
|
||||||
|
<UseInterpreter>true</UseInterpreter>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'maccatalyst-arm64' and '$(Configuration)' == 'Release'">
|
||||||
|
<UseInterpreter>true</UseInterpreter>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<!-- App Icon -->
|
||||||
|
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
|
||||||
|
|
||||||
|
<!-- Splash Screen -->
|
||||||
|
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
|
||||||
|
|
||||||
|
<!-- Images -->
|
||||||
|
<MauiImage Include="Resources\Images\*" />
|
||||||
|
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
|
||||||
|
|
||||||
|
<!-- Custom Fonts -->
|
||||||
|
<MauiFont Include="Resources\Fonts\*" />
|
||||||
|
|
||||||
|
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
|
||||||
|
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="DevExpress.Data" Version="25.1.3" />
|
||||||
|
<!--<PackageReference Include="DevExpress.Maui.Controls" Version="25.1.3" />
|
||||||
|
<PackageReference Include="DevExpress.Maui.Editors" Version="25.1.3" />
|
||||||
|
<PackageReference Include="DevExpress.Maui.CollectionView" Version="25.1.3" />-->
|
||||||
|
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.50" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.10" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\FruitBank.Common\FruitBank.Common.csproj" />
|
||||||
|
<ProjectReference Include="..\FruitBankHybrid.Shared\FruitBankHybrid.Shared.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="AyCode.Core">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Core.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Services">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="AyCode.Entities">
|
||||||
|
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Entities.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
xmlns:dx="http://schemas.devexpress.com/maui"
|
||||||
|
xmlns:local="clr-namespace:FruitBankHybrid"
|
||||||
|
xmlns:shared="clr-namespace:FruitBankHybrid.Shared;assembly=FruitBankHybrid.Shared"
|
||||||
|
x:Class="FruitBankHybrid.MainPage"
|
||||||
|
BackgroundColor="{DynamicResource PageBackgroundColor}">
|
||||||
|
|
||||||
|
<Grid RowDefinitions="*,Auto">
|
||||||
|
<BlazorWebView x:Name="blazorWebView"
|
||||||
|
HostPage="wwwroot/index.html">
|
||||||
|
<BlazorWebView.RootComponents>
|
||||||
|
<RootComponent Selector="#app"
|
||||||
|
ComponentType="{x:Type shared:Routes}" />
|
||||||
|
</BlazorWebView.RootComponents>
|
||||||
|
</BlazorWebView>
|
||||||
|
<!--<dx:DXButton Clicked="OnActionButtonClick"
|
||||||
|
Content="Action"
|
||||||
|
CornerRadius="0"
|
||||||
|
Grid.Row="1"
|
||||||
|
Icon="dotnet_bot.png"
|
||||||
|
IconColor="White" />-->
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</ContentPage>
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
public partial class MainPage : ContentPage
|
||||||
|
{
|
||||||
|
public MainPage()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnActionButtonClick(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
//Add some code here to show how to communicate with a control in BlazorWebView
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
using FruitBankHybrid.Services;
|
||||||
|
using FruitBankHybrid.Shared.Services;
|
||||||
|
//using DevExpress.Maui;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using FruitBankHybrid.Shared.Services.SignalRs;
|
||||||
|
using FruitBank.Common.Loggers;
|
||||||
|
using AyCode.Core.Loggers;
|
||||||
|
using FruitBankHybrid.Services.Loggers;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
public static class MauiProgram
|
||||||
|
{
|
||||||
|
public static MauiApp CreateMauiApp()
|
||||||
|
{
|
||||||
|
var builder = MauiApp.CreateBuilder();
|
||||||
|
builder.UseMauiApp<App>()
|
||||||
|
//.UseDevExpress(useLocalization: false)
|
||||||
|
//.UseDevExpressCollectionView()
|
||||||
|
//.UseDevExpressControls()
|
||||||
|
//.UseDevExpressEditors()
|
||||||
|
.ConfigureFonts(fonts =>
|
||||||
|
{
|
||||||
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add device-specific services used by the FruitBankHybrid.Shared project
|
||||||
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
||||||
|
//builder.Services.AddScoped<ISignalRService, SignalRService>();
|
||||||
|
builder.Services.AddScoped<FruitBankSignalRClient>();
|
||||||
|
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterClientBase, BrowserConsoleLogWriter>();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
builder.Services.AddSingleton<IAcLogWriterClientBase, SignaRClientLogItemWriter>();
|
||||||
|
|
||||||
|
|
||||||
|
builder.Services.AddMauiBlazorWebView();
|
||||||
|
builder.Services.AddDevExpressBlazor();
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
||||||
|
builder.Logging.AddDebug();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return builder.Build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
</manifest>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
using Android.App;
|
||||||
|
using Android.Content.PM;
|
||||||
|
using Android.OS;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
||||||
|
public class MainActivity : MauiAppCompatActivity
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
using Android.App;
|
||||||
|
using Android.Runtime;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
[Application]
|
||||||
|
public class MainApplication : MauiApplication
|
||||||
|
{
|
||||||
|
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
|
||||||
|
: base(handle, ownership)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="colorPrimary">#512BD4</color>
|
||||||
|
<color name="colorPrimaryDark">#2B0B98</color>
|
||||||
|
<color name="colorAccent">#2B0B98</color>
|
||||||
|
</resources>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Foundation;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
[Register("AppDelegate")]
|
||||||
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
|
{
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
|
||||||
|
<dict>
|
||||||
|
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. -->
|
||||||
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. -->
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<!-- The Mac App Store requires you specify if the app uses encryption. -->
|
||||||
|
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
|
||||||
|
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
|
||||||
|
<!-- Please indicate <true/> or <false/> here. -->
|
||||||
|
|
||||||
|
<!-- Specify the category for your app here. -->
|
||||||
|
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
|
||||||
|
<!-- <key>LSApplicationCategoryType</key> -->
|
||||||
|
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>2</integer>
|
||||||
|
</array>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>XSAppIconAssets</key>
|
||||||
|
<string>Assets.xcassets/appicon.appiconset</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
using ObjCRuntime;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
// This is the main entry point of the application.
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||||
|
// you can specify it here.
|
||||||
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<maui:MauiWinUIApplication
|
||||||
|
x:Class="FruitBankHybrid.WinUI.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:maui="using:Microsoft.Maui"
|
||||||
|
xmlns:local="using:FruitBankHybrid.WinUI">
|
||||||
|
|
||||||
|
</maui:MauiWinUIApplication>
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace FruitBankHybrid.WinUI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides application-specific behavior to supplement the default Application class.
|
||||||
|
/// </summary>
|
||||||
|
public partial class App : MauiWinUIApplication
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the singleton application object. This is the first line of authored code
|
||||||
|
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||||
|
/// </summary>
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Package
|
||||||
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
|
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||||
|
IgnorableNamespaces="uap rescap">
|
||||||
|
|
||||||
|
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
|
||||||
|
|
||||||
|
<mp:PhoneIdentity PhoneProductId="10836226-17FE-45AD-8C96-8DB8D4D78222" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>$placeholder$</DisplayName>
|
||||||
|
<PublisherDisplayName>User Name</PublisherDisplayName>
|
||||||
|
<Logo>$placeholder$.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||||
|
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||||
|
</Dependencies>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="x-generate" />
|
||||||
|
</Resources>
|
||||||
|
|
||||||
|
<Applications>
|
||||||
|
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
|
||||||
|
<uap:VisualElements
|
||||||
|
DisplayName="$placeholder$"
|
||||||
|
Description="$placeholder$"
|
||||||
|
Square150x150Logo="$placeholder$.png"
|
||||||
|
Square44x44Logo="$placeholder$.png"
|
||||||
|
BackgroundColor="transparent">
|
||||||
|
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
|
||||||
|
<uap:SplashScreen Image="$placeholder$.png" />
|
||||||
|
</uap:VisualElements>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
|
<Capabilities>
|
||||||
|
<rescap:Capability Name="runFullTrust" />
|
||||||
|
</Capabilities>
|
||||||
|
|
||||||
|
</Package>
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="FruitBankHybrid.WinUI.app"/>
|
||||||
|
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<!-- The combination of below two tags have the following effect:
|
||||||
|
1) Per-Monitor for >= Windows 10 Anniversary Update
|
||||||
|
2) System < Windows 10 Anniversary Update
|
||||||
|
-->
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
|
||||||
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
</assembly>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
using Foundation;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
[Register("AppDelegate")]
|
||||||
|
public class AppDelegate : MauiUIApplicationDelegate
|
||||||
|
{
|
||||||
|
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>1</integer>
|
||||||
|
<integer>2</integer>
|
||||||
|
</array>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>arm64</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>XSAppIconAssets</key>
|
||||||
|
<string>Assets.xcassets/appicon.appiconset</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
using ObjCRuntime;
|
||||||
|
using UIKit;
|
||||||
|
|
||||||
|
namespace FruitBankHybrid
|
||||||
|
{
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
// This is the main entry point of the application.
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||||
|
// you can specify it here.
|
||||||
|
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect x="0" y="0" width="456" height="456" fill="#512BD4" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 228 B |
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="456" height="456" viewBox="0 0 456 456" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<path d="m 105.50037,281.60863 c -2.70293,0 -5.00091,-0.90042 -6.893127,-2.70209 -1.892214,-1.84778 -2.837901,-4.04181 -2.837901,-6.58209 0,-2.58722 0.945687,-4.80389 2.837901,-6.65167 1.892217,-1.84778 4.190197,-2.77167 6.893127,-2.77167 2.74819,0 5.06798,0.92389 6.96019,2.77167 1.93749,1.84778 2.90581,4.06445 2.90581,6.65167 0,2.54028 -0.96832,4.73431 -2.90581,6.58209 -1.89221,1.80167 -4.212,2.70209 -6.96019,2.70209 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||||
|
<path d="M 213.56111,280.08446 H 195.99044 L 149.69953,207.0544 c -1.17121,-1.84778 -2.14037,-3.76515 -2.90581,-5.75126 h -0.40578 c 0.36051,2.12528 0.54076,6.67515 0.54076,13.6496 v 65.13172 h -15.54349 v -99.36009 h 18.71925 l 44.7374,71.29798 c 1.89222,2.95695 3.1087,4.98917 3.64945,6.09751 h 0.26996 c -0.45021,-2.6325 -0.67573,-7.09015 -0.67573,-13.37293 v -64.02256 h 15.47557 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||||
|
<path d="m 289.25134,280.08446 h -54.40052 v -99.36009 h 52.23835 v 13.99669 h -36.15411 v 28.13085 h 33.31621 v 13.9271 h -33.31621 v 29.37835 h 38.31628 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||||
|
<path d="M 366.56466,194.72106 H 338.7222 v 85.3634 h -16.08423 v -85.3634 h -27.77455 v -13.99669 h 71.70124 z" style="fill:#ffffff;fill-rule:nonzero;stroke-width:0.838376" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -0,0 +1,15 @@
|
||||||
|
Any raw assets you want to be deployed with your application can be placed in
|
||||||
|
this directory (and child directories). Deployment of the asset to your application
|
||||||
|
is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
|
||||||
|
|
||||||
|
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||||
|
|
||||||
|
These files will be deployed with your package and will be accessible using Essentials:
|
||||||
|
|
||||||
|
async Task LoadMauiAsset()
|
||||||
|
{
|
||||||
|
using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
|
||||||
|
using var reader = new StreamReader(stream);
|
||||||
|
|
||||||
|
var contents = reader.ReadToEnd();
|
||||||
|
}
|
||||||