fixes, improvements, etc...

This commit is contained in:
Loretta 2025-10-21 08:13:13 +02:00
parent 2d03a6d60b
commit 95933933b8
7 changed files with 199 additions and 160 deletions

View File

@ -35,7 +35,8 @@
<HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath> <HintPath>..\..\..\..\Aycode\Source\AyCode.Core\AyCode.Services.Server\bin\FruitBank\Debug\net9.0\AyCode.Services.Server.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.AspNetCore.SignalR.Core"> <Reference Include="Microsoft.AspNetCore.SignalR.Core">
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.9\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath> <!--<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.9\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>-->
<HintPath>C:\Program Files\dotnet\packs\Microsoft.AspNetCore.App.Ref\9.0.10\ref\net9.0\Microsoft.AspNetCore.SignalR.Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mango.Nop.Core"> <Reference Include="Mango.Nop.Core">
<HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath> <HintPath>..\..\NopCommerce.Common\4.70\Libraries\Mango.Nop.Core\bin\FruitBank\Debug\net9.0\Mango.Nop.Core.dll</HintPath>

View File

@ -5,16 +5,29 @@ namespace FruitBankHybrid.Shared.Extensions;
public static class DevextremeComponentExtension public static class DevextremeComponentExtension
{ {
public static async Task ShowMessageBoxAsync(this IDialogService messageBox, string title, string text, MessageBoxRenderStyle messageBoxRenderStyle, MessageBoxType messageBoxType = MessageBoxType.Alert) public static async Task ShowMessageBoxAsync(this IDialogService messageBox, string title, string text, MessageBoxRenderStyle messageBoxRenderStyle)
{
var messageBoxOptions = CreateMessageBoxOptions(title, text, messageBoxRenderStyle);
await messageBox.AlertAsync(messageBoxOptions);
}
public static async Task<bool> ShowConfirmBoxAsync(this IDialogService messageBox, string title, string text, MessageBoxRenderStyle messageBoxRenderStyle)
{
var messageBoxOptions = CreateMessageBoxOptions(title, text, messageBoxRenderStyle);
return await messageBox.ConfirmAsync(messageBoxOptions);
}
private static MessageBoxOptions CreateMessageBoxOptions(string title, string text, MessageBoxRenderStyle messageBoxRenderStyle)
{ {
var messageBoxOptions = new MessageBoxOptions var messageBoxOptions = new MessageBoxOptions
{ {
Title = title, Title = title,
Text = text, Text = text,
RenderStyle = messageBoxRenderStyle, RenderStyle = messageBoxRenderStyle,
ShowIcon = false
}; };
return messageBoxOptions;
if (messageBoxType == MessageBoxType.Alert) await messageBox.AlertAsync(messageBoxOptions);
else await messageBox.ConfirmAsync(messageBoxOptions);
} }
} }

View File

@ -11,6 +11,14 @@
<h3>Bejövő mérés</h3> <h3>Bejövő mérés</h3>
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
<DxLoadingPanel @bind-Visible="LoadingPanelVisible"
IsContentBlocked="true"
ApplyBackgroundShading="true"
IndicatorAreaVisible="true"
IsContentVisible="true"
IndicatorAnimationType="WaitIndicatorAnimationType.Spin"
Text="Adatok szinkronizálása folyamatban...">
<DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100"> <DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayoutItem Caption="Érkezés dátuma" ColSpanMd="2" CaptionCssClass="@(SelectedShipping != null && _measuringDates.Where(x => MeasuringService.DaysEqual(x.DateTime, SelectedShipping.ShippingDate)).All(x => x.IsMeasured) ? "text-success" : "")"> <DxFormLayoutItem Caption="Érkezés dátuma" ColSpanMd="2" CaptionCssClass="@(SelectedShipping != null && _measuringDates.Where(x => MeasuringService.DaysEqual(x.DateTime, SelectedShipping.ShippingDate)).All(x => x.IsMeasured) ? "text-success" : "")">
<DxDateEdit CssClass="cw-320" <DxDateEdit CssClass="cw-320"
@ -119,7 +127,6 @@
</DxFormLayoutItem> </DxFormLayoutItem>
</DxFormLayout> </DxFormLayout>
</div>
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
@if (SelectedShippingItem is { ProductId: > 0 }) @if (SelectedShippingItem is { ProductId: > 0 })
@ -173,3 +180,5 @@
</DxFormLayout> </DxFormLayout>
} }
</div> </div>
</DxLoadingPanel>
</div>

View File

@ -29,6 +29,7 @@ namespace FruitBankHybrid.Shared.Pages
//private ShippingDocument? SelectedShippingDocument { get; set; } //private ShippingDocument? SelectedShippingDocument { get; set; }
private ShippingItem? SelectedShippingItem { get; set; } private ShippingItem? SelectedShippingItem { get; set; }
public bool LoadingPanelVisible { get; set; } = true;
protected bool BtnSaveEnabled { get; set; } protected bool BtnSaveEnabled { get; set; }
private List<ShippingItem>? _shippingItemsDataSource; private List<ShippingItem>? _shippingItemsDataSource;
@ -36,6 +37,8 @@ namespace FruitBankHybrid.Shared.Pages
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
LoadingPanelVisible = true;
_logger = new LoggerClient<MeasuringIn>(LogWriters.ToArray()); _logger = new LoggerClient<MeasuringIn>(LogWriters.ToArray());
_logger.Info("OnInitializedAsync"); _logger.Info("OnInitializedAsync");
@ -51,6 +54,8 @@ namespace FruitBankHybrid.Shared.Pages
NotMeasuredShippings = shippings.Where(shipping => MeasuringService.DaysEqual(shipping.ShippingDate.Date, dateTime)).ToList(); NotMeasuredShippings = shippings.Where(shipping => MeasuringService.DaysEqual(shipping.ShippingDate.Date, dateTime)).ToList();
SelectedShipping = NotMeasuredShippings.FirstOrDefault(); SelectedShipping = NotMeasuredShippings.FirstOrDefault();
LoadingPanelVisible = false;
} }
private static List<ShippingItem>? GetShippingItemsDataSource(Shipping? shipping) private static List<ShippingItem>? GetShippingItemsDataSource(Shipping? shipping)

View File

@ -12,13 +12,14 @@
<DxDialogProvider /> <DxDialogProvider />
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
<DxLoadingPanel @bind-Visible="LoadingPanelVisible" <DxLoadingPanel @bind-Visible="LoadingPanelVisible"
IsContentBlocked="true" IsContentBlocked="true"
ApplyBackgroundShading="true" ApplyBackgroundShading="true"
IndicatorAreaVisible="true" IndicatorAreaVisible="true"
IsContentVisible="true" IsContentVisible="true"
IndicatorAnimationType="WaitIndicatorAnimationType.Spin" IndicatorAnimationType="WaitIndicatorAnimationType.Spin"
Text="Adatok betöltése..."> Text="Adatok szinkronizálása folyamatban...">
<DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100"> <DxFormLayout CaptionPosition="CaptionPosition.Vertical" CssClass="w-100">
<DxFormLayoutItem Caption="Átvétel dátuma" ColSpanMd="2" <DxFormLayoutItem Caption="Átvétel dátuma" ColSpanMd="2"
@ -69,19 +70,25 @@
</DxComboBox> </DxComboBox>
</DxFormLayoutItem> </DxFormLayoutItem>
@if (HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0) @switch (SelectedOrder)
{ {
case null:
<DxFormLayoutItem ColSpanMd="2" />
break;
case { MeasurementOwnerId: 0, IsComplete: false } when HasMeasuringAccess:
<DxFormLayoutItem ColSpanMd="2"> <DxFormLayoutItem ColSpanMd="2">
<DxButton Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0)" Visible="@(SelectedOrder != null)" CssClass="w-100" <DxButton Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0)" Visible="@(SelectedOrder != null)" CssClass="w-100"
Text="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0 ? "Mérés indítása" : "Mérés folyamatban...")" Text="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId == 0 ? "Mérés indítása" : "Mérés folyamatban...")"
Click="() => OnStartMeasuringClick()" /> Click="() => OnStartMeasuringClick()" />
</DxFormLayoutItem> </DxFormLayoutItem>
} break;
else
{ default:
<DxFormLayoutItem ColSpanMd="2" Caption="Mérést indította" CaptionCssClass="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")"> <DxFormLayoutItem ColSpanMd="2" Caption="Mérést indította" CaptionCssClass="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")">
<DxTextBox Enabled="false" Text="@(LoggedInModel.MeasuringUsers.FirstOrDefault(x => x.Id == SelectedOrder?.MeasurementOwnerId)?.Email)" /> <DxTextBox Enabled="false" Text="@(LoggedInModel.MeasuringUsers.FirstOrDefault(x => x.Id == SelectedOrder?.MeasurementOwnerId)?.FullName)" />
</DxFormLayoutItem> </DxFormLayoutItem>
break;
} }
<DxFormLayoutItem ColSpanMd="1"></DxFormLayoutItem> <DxFormLayoutItem ColSpanMd="1"></DxFormLayoutItem>
@ -96,7 +103,7 @@
} }
</DxFormLayout> </DxFormLayout>
@if (SelectedOrder == null) @if (SelectedOrder == null || LoadingPanelVisible)
{ {
} }
else if (!HasMeasuringAccess) else if (!HasMeasuringAccess)
@ -110,9 +117,9 @@
//Átvétel dátuma október 23. [AUDITED] 15:51 - Vegetable Kft. Rendelés azonosító: #8 //Átvétel dátuma október 23. [AUDITED] 15:51 - Vegetable Kft. Rendelés azonosító: #8
<div style="margin-top: 50px;"> <div style="margin-top: 50px;">
<h3 style="margin-bottom: 30px;" class="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")"> <h4 style="margin-bottom: 30px;" class="@(SelectedOrder?.IsMeasured == true ? "text-success" : "")">
Rendelés azonosító: #@(SelectedOrder?.CustomOrderNumber) Rendelés azonosító: #@(SelectedOrder?.CustomOrderNumber)
</h3> </h4>
<DxAccordion Data="@SelectedOrder?.OrderItemDtos" Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId > 0 && !(SelectedOrder?.IsComplete ?? false))" <DxAccordion Data="@SelectedOrder?.OrderItemDtos" Enabled="@(HasMeasuringAccess && SelectedOrder?.MeasurementOwnerId > 0 && !(SelectedOrder?.IsComplete ?? false))"
ExpandMode="AccordionExpandMode.SingleOrNone" ExpandMode="AccordionExpandMode.SingleOrNone"

View File

@ -56,7 +56,7 @@ namespace FruitBankHybrid.Shared.Pages
private async Task RefreshOrdersFromDb(DateTime dateTime) private async Task RefreshOrdersFromDb(DateTime dateTime)
{ {
LoadingPanelVisible = true; LoadingPanelVisible = true;
var orders = (await FruitBankSignalRClient.GetPendingOrderDtos() ?? []);//.Where(o => o.HasMeasuringAccess(LoggedInModel.CustomerDto?.Id, LoggedInModel.IsRevisor)).ToList(); var orders = (await FruitBankSignalRClient.GetPendingOrderDtos() ?? []).Where(o => o.HasMeasuringAccess(LoggedInModel.CustomerDto?.Id, LoggedInModel.IsRevisor)).ToList();
_measuringDates = orders.Select(order => new MeasuringDateSelectorModel(order.Id, order.DateOfReceiptOrCreated, order.IsMeasured)).ToList(); _measuringDates = orders.Select(order => new MeasuringDateSelectorModel(order.Id, order.DateOfReceiptOrCreated, order.IsMeasured)).ToList();
@ -140,7 +140,7 @@ namespace FruitBankHybrid.Shared.Pages
selectedOrderItemDto.OrderItemPallets.UpdateCollection(orderItemPallet, false); selectedOrderItemDto.OrderItemPallets.UpdateCollection(orderItemPallet, false);
//MeasuringValuesHelper.SetShippingItemTotalMeasuringValues(SelectedShippingItem); //MeasuringValuesHelper.SetShippingItemTotalMeasuringValues(SelectedShippingItem);
} }
else await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt!", MessageBoxRenderStyle.Danger); else await DialogService.ShowMessageBoxAsync("Hiba", "Adatok mentése sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
StateHasChanged(); StateHasChanged();
} }
@ -194,6 +194,8 @@ namespace FruitBankHybrid.Shared.Pages
private async Task OnMeasuringAuditorClick() private async Task OnMeasuringAuditorClick()
{ {
if (SelectedOrder != null && LoggedInModel.IsRevisor && SelectedOrder.IsMeasured && SelectedOrder.OrderStatus != OrderStatus.Complete) if (SelectedOrder != null && LoggedInModel.IsRevisor && SelectedOrder.IsMeasured && SelectedOrder.OrderStatus != OrderStatus.Complete)
{
if (await DialogService.ShowConfirmBoxAsync("Megerősítés", "Biztoan jóváhagyja a rendelést? Jóváhagyás után a mérések nem módosíthatóak!", MessageBoxRenderStyle.Danger))
{ {
var responseOrderDto = await FruitBankSignalRClient.SetOrderStatusToComplete(SelectedOrder.Id, LoggedInModel.CustomerDto!.Id); var responseOrderDto = await FruitBankSignalRClient.SetOrderStatusToComplete(SelectedOrder.Id, LoggedInModel.CustomerDto!.Id);
if (responseOrderDto != null) if (responseOrderDto != null)
@ -205,11 +207,12 @@ namespace FruitBankHybrid.Shared.Pages
//await DialogService.ShowMessageBoxAsync("Információ", "Adatok mentése sikeres volt!", MessageBoxRenderStyle.Info); //await DialogService.ShowMessageBoxAsync("Információ", "Adatok mentése sikeres volt!", MessageBoxRenderStyle.Info);
} }
else await DialogService.ShowMessageBoxAsync("Hiba", "Rendelés jóváhagyása sikertelen volt!", MessageBoxRenderStyle.Danger); else await DialogService.ShowMessageBoxAsync("Hiba", "Rendelés jóváhagyása sikertelen volt, ellenőrizze a mérés adatait!", MessageBoxRenderStyle.Danger);
StateHasChanged(); StateHasChanged();
} }
} }
}
private void PrepareOrderDto(OrderDto orderDto) private void PrepareOrderDto(OrderDto orderDto)
{ {

View File

@ -1,5 +1,6 @@
html, body { html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
min-height: 100vh;
} }
a, .btn-link { a, .btn-link {