improvements, fixes, etc...

This commit is contained in:
Loretta 2025-09-11 12:51:46 +02:00
parent 07b4e5f558
commit cf234681af
29 changed files with 311 additions and 49 deletions

View File

@ -37,6 +37,16 @@
<Reference Include="Microsoft.AspNetCore.SignalR.Core"> <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> <HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.8\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>
</Reference> </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>
<ItemGroup> <ItemGroup>

View File

@ -10,6 +10,7 @@ namespace FruitBank.Common.Server
public class FruitBankConst : AcConst public class FruitBankConst : AcConst
{ {
public static string ProjectIdString = "aad53443-2ee2-4650-8a99-97e907265e4e"; public static string ProjectIdString = "aad53443-2ee2-4650-8a99-97e907265e4e";
public static string MeasuringRoleSystemName = "Measuring";
static FruitBankConst() static FruitBankConst()
{ {

View File

@ -1,6 +0,0 @@
namespace FruitBank.Common.Dtos;
public class CustomerDto
{
}

View File

@ -1,6 +0,0 @@
namespace FruitBank.Common.Dtos;
public class ProductDto
{
}

View File

@ -8,7 +8,6 @@ namespace FruitBank.Common.Entities;
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PartnerDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.PartnerDbTableName)]
public class Partner : MgEntityBase, IPartner public class Partner : MgEntityBase, IPartner
{ {
public int Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string PostalCode { get; set; } public string PostalCode { get; set; }
public string Country { get; set; } public string Country { get; set; }

View File

@ -8,10 +8,10 @@ namespace FruitBank.Common.Entities;
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDbTableName)]
public class Shipping : MgEntityBase, IShipping public class Shipping : MgEntityBase, IShipping
{ {
public int Id { get; set; }
public int PartnerId { get; set; } public int PartnerId { get; set; }
public DateTime ShippingDate { get; set; } public DateTime ShippingDate { get; set; }
public string LicencePlate { get; set; } public string LicencePlate { get; set; }
public bool IsAllMeasured { get; set; }
//[Association(ThisKey = nameof(ShippingDocumentId), OtherKey = nameof(ShippingItem.sh))] //[Association(ThisKey = nameof(ShippingDocumentId), OtherKey = nameof(ShippingItem.sh))]
//public IEnumerable<Shipping> Shippings { get; set; } //public IEnumerable<Shipping> Shippings { get; set; }

View File

@ -8,7 +8,6 @@ namespace FruitBank.Common.Entities;
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingDocumentDbTableName)]
public class ShippingDocument : MgEntityBase, IShippingDocument public class ShippingDocument : MgEntityBase, IShippingDocument
{ {
public int Id { get; set; }
public int PartnerId { get; set; } public int PartnerId { get; set; }
public int ShippingId { get; set; } public int ShippingId { get; set; }
public int ShippingItemId { get; set; } public int ShippingItemId { get; set; }

View File

@ -11,8 +11,7 @@ namespace FruitBank.Common.Entities;
[System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemDbTableName)] [System.ComponentModel.DataAnnotations.Schema.Table(FruitBankConstClient.ShippingItemDbTableName)]
public class ShippingItem : MgEntityBase, IShippingItem public class ShippingItem : MgEntityBase, IShippingItem
{ {
public int Id { get; set; } public int ProductId { get; set; }
//[Association(ThisKey = nameof(ShippingDocumentId), OtherKey = nameof(Shipping.Id))] //[Association(ThisKey = nameof(ShippingDocumentId), OtherKey = nameof(Shipping.Id))]
//public IEnumerable<Shipping> Shippings { get; set; } //public IEnumerable<Shipping> Shippings { get; set; }
@ -22,6 +21,7 @@ public class ShippingItem : MgEntityBase, IShippingItem
public double GrossWeight { get; set; } public double GrossWeight { get; set; }
public double MeasuredNetWeight { get; set; } public double MeasuredNetWeight { get; set; }
public double MeasuredGrossWeight { get; set; } public double MeasuredGrossWeight { get; set; }
public bool IsMeasured { get; set; }
[SkipValuesOnUpdate] [SkipValuesOnUpdate]
public DateTime Created { get; set; } public DateTime Created { get; set; }

View File

@ -37,6 +37,14 @@
<Reference Include="Nop.Core"> <Reference Include="Nop.Core">
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Core.dll</HintPath> <HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Nop.Core.dll</HintPath>
</Reference> </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> </ItemGroup>
</Project> </Project>

View File

@ -1,5 +1,8 @@
namespace FruitBank.Common.Interfaces; using Mango.Nop.Core.Models;
namespace FruitBank.Common.Interfaces;
public interface IFruitBankDataControllerClient : IFruitBankDataControllerCommon public interface IFruitBankDataControllerClient : IFruitBankDataControllerCommon
{ {
Task<MgLoginModelResponse?> LoginMeasuringUser(string customerEmail, string customerPassword);
} }

View File

@ -1,5 +1,7 @@
using FruitBank.Common.Entities; using FruitBank.Common.Entities;
using FruitBank.Common.Models; using FruitBank.Common.Models;
using Mango.Nop.Core.Dtos;
using Mango.Nop.Core.Models;
namespace FruitBank.Common.Interfaces; namespace FruitBank.Common.Interfaces;
@ -28,4 +30,14 @@ public interface IFruitBankDataControllerCommon
public Task<List<ShippingDocument>?> GetShippingDocuments(); public Task<List<ShippingDocument>?> GetShippingDocuments();
public Task<ShippingDocument?> GetShippingDocumentById(int id); public Task<ShippingDocument?> GetShippingDocumentById(int id);
#endregion 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);
} }

View File

@ -1,4 +1,6 @@
namespace FruitBank.Common.Interfaces; using Mango.Nop.Core.Models;
namespace FruitBank.Common.Interfaces;
public interface IFruitBankDataControllerServer : IFruitBankDataControllerCommon public interface IFruitBankDataControllerServer : IFruitBankDataControllerCommon
{ {

View File

@ -8,4 +8,5 @@ public interface IShipping : IEntityInt, ITimeStampInfo
int PartnerId { get; set; } int PartnerId { get; set; }
DateTime ShippingDate { get; set; } DateTime ShippingDate { get; set; }
string LicencePlate { get; set; } string LicencePlate { get; set; }
bool IsAllMeasured { get; set; }
} }

View File

@ -6,9 +6,13 @@ namespace FruitBank.Common.Interfaces;
public interface IShippingItem : IEntityInt, ITimeStampInfo public interface IShippingItem : IEntityInt, ITimeStampInfo
{ {
int ShippingDocumentId { get; set; } int ShippingDocumentId { get; set; }
int ProductId { get; set; }
string Name { get; set; } string Name { get; set; }
double NetWeight { get; set; } double NetWeight { get; set; }
double GrossWeight { get; set; } double GrossWeight { get; set; }
double MeasuredNetWeight { get; set; } double MeasuredNetWeight { get; set; }
double MeasuredGrossWeight { get; set; } double MeasuredGrossWeight { get; set; }
bool IsMeasured { get; set; }
} }

View File

@ -22,6 +22,11 @@ public class SignalRTags : AcSignalRTags
public const int GetShippingDocuments = 60; public const int GetShippingDocuments = 60;
public const int GetShippingDocumentById = 61; public const int GetShippingDocumentById = 61;
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 AuthenticateUser = 160;
public const int RefreshToken = 200; public const int RefreshToken = 200;

View File

@ -1,9 +1,11 @@
using AyCode.Core.Consts; using AyCode.Core.Enums;
using AyCode.Core.Enums; using AyCode.Core.Extensions;
using AyCode.Core.Loggers; using AyCode.Core.Loggers;
using AyCode.Utils.Extensions;
using FruitBank.Common.Entities; using FruitBank.Common.Entities;
using FruitBank.Common.Loggers; using FruitBank.Common.Loggers;
using FruitBankHybrid.Shared.Services.SignalRs; using FruitBankHybrid.Shared.Services.SignalRs;
using Mango.Nop.Core.Dtos;
namespace FruitBankHybrid.Shared.Tests namespace FruitBankHybrid.Shared.Tests
{ {
@ -23,6 +25,7 @@ namespace FruitBankHybrid.Shared.Tests
} }
#region Partner #region Partner
[TestMethod] [TestMethod]
public async Task GetPartnersTest() public async Task GetPartnersTest()
{ {
@ -66,6 +69,7 @@ namespace FruitBankHybrid.Shared.Tests
#endregion Partner #endregion Partner
#region Shipping #region Shipping
[TestMethod] [TestMethod]
public async Task GetShippingsTest() public async Task GetShippingsTest()
{ {
@ -83,9 +87,11 @@ namespace FruitBankHybrid.Shared.Tests
Assert.IsNotNull(shipping); Assert.IsNotNull(shipping);
Assert.IsTrue(shipping.Id == 1); Assert.IsTrue(shipping.Id == 1);
} }
#endregion Shipping #endregion Shipping
#region ShippingItem #region ShippingItem
[TestMethod] [TestMethod]
public async Task GetShippingItemsTest() public async Task GetShippingItemsTest()
{ {
@ -103,9 +109,11 @@ namespace FruitBankHybrid.Shared.Tests
Assert.IsNotNull(shippingItem); Assert.IsNotNull(shippingItem);
Assert.IsTrue(shippingItem.Id == 1); Assert.IsTrue(shippingItem.Id == 1);
} }
#endregion ShippingItem #endregion ShippingItem
#region ShippingDocument #region ShippingDocument
[TestMethod] [TestMethod]
public async Task GetShippingDocumentsTest() public async Task GetShippingDocumentsTest()
{ {
@ -123,6 +131,60 @@ namespace FruitBankHybrid.Shared.Tests
Assert.IsNotNull(shippingDocument); Assert.IsNotNull(shippingDocument);
Assert.IsTrue(shippingDocument.Id == 1); Assert.IsTrue(shippingDocument.Id == 1);
} }
#endregion ShippingDocument #endregion ShippingDocument
#region Customer
[TestMethod]
public async Task GetMeasuringUsersTest()
{
var users = await _signalRClient.GetMeasuringUsers();
Assert.IsNotNull(users);
Assert.IsTrue(users.Any());
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.Any());
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}");
}
} }
} }

View File

@ -28,6 +28,21 @@
<Reference Include="AyCode.Services"> <Reference Include="AyCode.Services">
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath> <HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.dll</HintPath>
</Reference> </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> </ItemGroup>
</Project> </Project>

View File

@ -44,6 +44,24 @@
<Reference Include="AyCode.Utils"> <Reference Include="AyCode.Utils">
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath> <HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
</Reference> </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>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,19 +1,60 @@
@page "/chat" @page "/chat"
@using DevExpress.Blazor
@using DevExpress.Blazor.Internal
@using FruitBankHybrid.Shared.Services @using FruitBankHybrid.Shared.Services
@* @inject ISignalRService SignalR *@ @* @inject ISignalRService SignalR *@
<h3>AI Chat</h3> <h3>Measuring</h3>
<input @bind="_userName" placeholder="Your name" /> @* <DxDropDownButton></DxDropDownButton> *@
<input @bind="_message" placeholder="Partner ID..." /> @* <div>
<button @onclick="GetPartner">Send</button> <DxDropDownButton RenderStyle="ButtonRenderStyle.Secondary"
Text="Select Employee"
CssClass="me-1"
IconCssClass="menu-icon-user-profile menu-icon"
DropDownVisible="DropDownVisible">
<DropDownContentTemplate>
<div>
<DxListBox Data="@Users"
@bind-Value="@SelectedUser"
CssClass="listbox">
<ItemDisplayTemplate>
<div class="listbox-item-template">
<span class="listbox-item-template-name">@context.DataItem.Username</span>
</div>
</ItemDisplayTemplate>
</DxListBox>
</div>
</DropDownContentTemplate>
</DxDropDownButton>
<p class="demo-text cw-400 mt-2">
Selected item: <b>@SelectedUser?.Username</b>
</p>
</div>
*@
<ul> <div>
<ul>
@foreach (var user in Users)
{
<li>@user.Username - @user.Email</li>
}
</ul>
</div>
<div>
<input @bind="_userName" placeholder="Your name" />
<input @bind="_message" placeholder="Partner ID..." />
<button @onclick="GetPartner">Get partner</button>
<ul>
@foreach (var m in _messages) @foreach (var m in _messages)
{ {
<li><b>@m.User:</b> @m.Text</li> <li><b>@m.User:</b> @m.Text</li>
} }
</ul> </ul>
</div>
@code { @code {
} }

View File

@ -1,6 +1,7 @@
using AyCode.Core.Helpers; using AyCode.Core.Helpers;
using AyCode.Core.Loggers; using AyCode.Core.Loggers;
using AyCode.Models.Users; using AyCode.Models.Users;
using FruitBank.Common.Entities;
using FruitBank.Common.Loggers; using FruitBank.Common.Loggers;
using FruitBank.Common.Models; using FruitBank.Common.Models;
using FruitBankHybrid.Shared.Services.Loggers; using FruitBankHybrid.Shared.Services.Loggers;
@ -14,6 +15,7 @@ using System.Linq;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Mango.Nop.Core.Dtos;
using static System.Net.Mime.MediaTypeNames; using static System.Net.Mime.MediaTypeNames;
using static System.Runtime.InteropServices.JavaScript.JSType; using static System.Runtime.InteropServices.JavaScript.JSType;
using ILogger = FruitBank.Common.Loggers.ILogger; using ILogger = FruitBank.Common.Loggers.ILogger;
@ -27,14 +29,25 @@ namespace FruitBankHybrid.Shared.Pages
private ILogger _logger; private ILogger _logger;
private string _userName = "BlazorClient"; private string _userName = "Partner name";
private string _message; private string _message;
private readonly List<(string User, string Text)> _messages = []; private readonly List<(string User, string Text)> _messages = [];
private List<CustomerDto> Users { get; set; } = [];
private bool DropDownVisible { get; set; }
private CustomerDto? SelectedUser { get; set; }
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
_logger = new LoggerClient<Chat>(LogWriters.ToArray()); _logger = new LoggerClient<Chat>(LogWriters.ToArray());
_logger.Info("OnInitializedAsync"); _logger.Info("OnInitializedAsync");
Users.AddRange(await FruitBankSignalRClient.GetMeasuringUsers() ?? []);
//SelectedUser = Users.FirstOrDefault();
//DropDownVisible = false;
await base.OnInitializedAsync();
} }
private async Task GetPartner() private async Task GetPartner()
@ -50,6 +63,7 @@ namespace FruitBankHybrid.Shared.Pages
} }
_messages.Add((_userName, measuringModel?.Name ?? "ERROR")); _messages.Add((_userName, measuringModel?.Name ?? "ERROR"));
//StateHasChanged();
} }
} }
} }

View File

@ -8,6 +8,8 @@ using FruitBank.Common.Interfaces;
using FruitBank.Common.Models; using FruitBank.Common.Models;
using FruitBank.Common.SignalRs; using FruitBank.Common.SignalRs;
using FruitBankHybrid.Shared.Services.Loggers; using FruitBankHybrid.Shared.Services.Loggers;
using Mango.Nop.Core.Dtos;
using Mango.Nop.Core.Models;
namespace FruitBankHybrid.Shared.Services.SignalRs namespace FruitBankHybrid.Shared.Services.SignalRs
{ {
@ -35,36 +37,64 @@ namespace FruitBankHybrid.Shared.Services.SignalRs
=> GetAllAsync<List<Partner>>(SignalRTags.GetPartners); => GetAllAsync<List<Partner>>(SignalRTags.GetPartners);
#region Partner #region Partner
public Task<Partner?> GetPartnerById(int id) public Task<Partner?> GetPartnerById(int id)
=> GetByIdAsync<Partner?>(SignalRTags.GetPartnerById, id); => GetByIdAsync<Partner?>(SignalRTags.GetPartnerById, id);
public Task<Partner?> UpdatePartner(Partner partner) public Task<Partner?> UpdatePartner(Partner partner)
=>PostDataAsync<Partner>(SignalRTags.UpdatePartner, partner); => PostDataAsync<Partner>(SignalRTags.UpdatePartner, partner);
#endregion Partner #endregion Partner
#region Shipping #region Shipping
public Task<List<Shipping>?> GetShippings() public Task<List<Shipping>?> GetShippings()
=> GetAllAsync<List<Shipping>>(SignalRTags.GetShippings); => GetAllAsync<List<Shipping>>(SignalRTags.GetShippings);
public Task<Shipping?> GetShippingById(int id) public Task<Shipping?> GetShippingById(int id)
=> GetByIdAsync<Shipping?>(SignalRTags.GetShippingById, id); => GetByIdAsync<Shipping?>(SignalRTags.GetShippingById, id);
#endregion Shipping #endregion Shipping
#region ShippingItem #region ShippingItem
public Task<List<ShippingItem>?> GetShippingItems() public Task<List<ShippingItem>?> GetShippingItems()
=> GetAllAsync<List<ShippingItem>>(SignalRTags.GetShippingItems); => GetAllAsync<List<ShippingItem>>(SignalRTags.GetShippingItems);
public Task<ShippingItem?> GetShippingItemById(int id) public Task<ShippingItem?> GetShippingItemById(int id)
=> GetByIdAsync<ShippingItem?>(SignalRTags.GetShippingItemById, id); => GetByIdAsync<ShippingItem?>(SignalRTags.GetShippingItemById, id);
#endregion ShippingItem #endregion ShippingItem
#region ShippingDocument #region ShippingDocument
public Task<List<ShippingDocument>?> GetShippingDocuments() public Task<List<ShippingDocument>?> GetShippingDocuments()
=> GetAllAsync<List<ShippingDocument>>(SignalRTags.GetShippingDocuments); => GetAllAsync<List<ShippingDocument>>(SignalRTags.GetShippingDocuments);
public Task<ShippingDocument?> GetShippingDocumentById(int id) public Task<ShippingDocument?> GetShippingDocumentById(int id)
=> GetByIdAsync<ShippingDocument?>(SignalRTags.GetShippingDocumentById, id); => GetByIdAsync<ShippingDocument?>(SignalRTags.GetShippingDocumentById, id);
#endregion 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
} }
} }

View File

@ -6,3 +6,4 @@
@using static Microsoft.AspNetCore.Components.Web.RenderMode @using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using DevExpress.Blazor

View File

@ -38,6 +38,21 @@
<Reference Include="AyCode.Utils"> <Reference Include="AyCode.Utils">
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath> <HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
</Reference> </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>
</Project> </Project>

View File

@ -8,6 +8,8 @@ using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
var builder = WebAssemblyHostBuilder.CreateDefault(args); var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddDevExpressBlazor();
// Add device-specific services used by the FruitBankHybrid.Shared project // Add device-specific services used by the FruitBankHybrid.Shared project
builder.Services.AddSingleton<IFormFactor, FormFactor>(); builder.Services.AddSingleton<IFormFactor, FormFactor>();
//builder.Services.AddScoped<ISignalRService, SignalRService>(); //builder.Services.AddScoped<ISignalRService, SignalRService>();

View File

@ -8,3 +8,4 @@
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using FruitBankHybrid.Shared @using FruitBankHybrid.Shared
@using FruitBankHybrid.Web.Client @using FruitBankHybrid.Web.Client
@using DevExpress.Blazor

View File

@ -1,4 +1,6 @@
<!DOCTYPE html> @using DevExpress.Blazor
<!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -9,12 +11,23 @@
<link rel="stylesheet" href="_content/FruitBankHybrid.Shared/app.css" /> <link rel="stylesheet" href="_content/FruitBankHybrid.Shared/app.css" />
<link rel="stylesheet" href="FruitBankHybrid.Web.styles.css" /> <link rel="stylesheet" href="FruitBankHybrid.Web.styles.css" />
<link rel="icon" type="image/png" href="_content/FruitBankHybrid.Shared/favicon.png" /> <link rel="icon" type="image/png" href="_content/FruitBankHybrid.Shared/favicon.png" />
@DxResourceManager.RegisterTheme(Themes.Fluent)
@DxResourceManager.RegisterScripts()
<link href=@AppendVersion("css/site.css") rel="stylesheet" />
<link href=@AppendVersion("FruitBankHybrid.Shared.styles.css") rel="stylesheet" />
<HeadOutlet @rendermode="InteractiveWebAssembly" /> <HeadOutlet @rendermode="InteractiveWebAssembly" />
</head> </head>
<body> <body>
<Routes @rendermode="InteractiveWebAssembly" /> <Routes @rendermode="InteractiveWebAssembly" />
<script src="_framework/blazor.web.js"></script> <script src="_framework/blazor.web.js"></script>
</body> </body>
</html> </html>
@code {
private string AppendVersion(string path) => $"{path}?v={typeof(DevExpress.Blazor.ResourcesConfigurator).Assembly.GetName().Version}";
}

View File

@ -10,3 +10,4 @@
@using FruitBankHybrid.Web @using FruitBankHybrid.Web
@using FruitBankHybrid.Web.Client @using FruitBankHybrid.Web.Client
@using FruitBankHybrid.Web.Components @using FruitBankHybrid.Web.Components
@using DevExpress.Blazor

View File

@ -53,6 +53,21 @@
<Reference Include="AyCode.Utils"> <Reference Include="AyCode.Utils">
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath> <HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Utils.dll</HintPath>
</Reference> </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>
<ItemGroup> <ItemGroup>

View File

@ -1,3 +1,4 @@
using DevExpress.Blazor;
using AyCode.Core.Loggers; using AyCode.Core.Loggers;
using AyCode.Services.Server.SignalRs; using AyCode.Services.Server.SignalRs;
using FruitBank.Common; using FruitBank.Common;
@ -14,6 +15,7 @@ var builder = WebApplication.CreateBuilder(args);
// Add services to the container. // Add services to the container.
builder.Services.AddRazorComponents().AddInteractiveWebAssemblyComponents(); builder.Services.AddRazorComponents().AddInteractiveWebAssemblyComponents();
builder.Services.AddDevExpressBlazor();
// Add device-specific services used by the FruitBankHybrid.Shared project // Add device-specific services used by the FruitBankHybrid.Shared project
builder.Services.AddSingleton<IFormFactor, FormFactor>(); builder.Services.AddSingleton<IFormFactor, FormFactor>();