improvements

This commit is contained in:
Loretta 2025-11-01 19:43:44 +01:00
parent fcfe879395
commit 1acd6a5833
8 changed files with 1239 additions and 19 deletions

View File

@ -10,7 +10,7 @@ public static class FruitBankConstClient
public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop
#if RELEASE #if RELEASE
// public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop //public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop
#endif #endif
//public static string BaseUrl = "http://10.0.2.2:59579"; //FrutiBank (android) nop //public static string BaseUrl = "http://10.0.2.2:59579"; //FrutiBank (android) nop

View File

@ -38,7 +38,10 @@
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn> <DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns> </Columns>
<DetailRowTemplate> <DetailRowTemplate>
@* <GridDetailOrderItemPallets OrderItemPallets="((OrderItemDto)context.DataItem).OrderItemPallets" /> *@ @{
var shippingItemPallets = ((ShippingItem)context.DataItem).ShippingItemPallets;
<GridShippingItemPallets ShippingItemPallets="shippingItemPallets" IsMasterGrid="false"></GridShippingItemPallets>
}
</DetailRowTemplate> </DetailRowTemplate>
<GroupSummary> <GroupSummary>
<DxGridSummaryItem SummaryType="GridSummaryItemType.Sum" <DxGridSummaryItem SummaryType="GridSummaryItemType.Sum"

View File

@ -0,0 +1,111 @@
@using FruitBank.Common.Dtos
@using FruitBank.Common.Entities
@using FruitBankHybrid.Shared.Services.SignalRs
@inject FruitBankSignalRClient FruitBankSignalRClient
<MgGridBase @ref="gridOrderItemPallet" Data="ShippingItemPallets" IsMasterGrid="IsMasterGrid"
PageSize="@(IsMasterGrid ? 15 : 50)" ShowFilterRow="IsMasterGrid" ShowGroupPanel="IsMasterGrid"
AutoExpandAllGroupRows="false"
ColumnResizeMode="GridColumnResizeMode.NextColumn"
FilterMenuButtonDisplayMode="@(IsMasterGrid ? GridFilterMenuButtonDisplayMode.Never : GridFilterMenuButtonDisplayMode.Always)">
<Columns>
<DxGridDataColumn FieldName="Id" Width="125" />
<DxGridDataColumn FieldName="ShippingItemId" Caption="siId" Width="125" />
<DxGridDataColumn FieldName="ShippingItem.ShippingId" Caption="aId" Width="125" />
<DxGridDataColumn Name="ProductId" FieldName="ShippingItem.ProductId" Caption="pId" Width="125" Visible="false" />
<DxGridDataColumn Name="ProductName" FieldName="ShippingItem.ProductDto.Name" Caption="ProductName" Visible="false" />
<DxGridDataColumn FieldName="PalletWeight" />
<DxGridDataColumn FieldName="TareWeight" />
<DxGridDataColumn FieldName="TrayQuantity" />
<DxGridDataColumn FieldName="GrossWeight" />
<DxGridDataColumn FieldName="NetWeight" />
<DxGridDataColumn FieldName="IsMeasured" />
<DxGridCommandColumn Visible="!IsMasterGrid" Width="120"></DxGridCommandColumn>
</Columns>
<GroupSummary>
<DxGridSummaryItem SummaryType="GridSummaryItemType.Sum"
FieldName="TrayQuantity"
FooterColumnName="TrayQuantity" />
<DxGridSummaryItem SummaryType="GridSummaryItemType.Sum"
FieldName="NetWeight"
FooterColumnName="NetWeight" />
</GroupSummary>
</MgGridBase>
@code {
IGrid gridOrderItemPallet;
[Parameter] public bool IsMasterGrid { get; set; } = false;
[Parameter] public List<ShippingItemPallet>? ShippingItemPallets { get; set; }
protected override async Task OnInitializedAsync()
{
if (ShippingItemPallets == null)
{
//TODO: A ShippingItemPallet-eknek SignalR Endpoint! - J.
ShippingItemPallets = (await FruitBankSignalRClient.GetShippingItems())!.SelectMany(si => si.ShippingItemPallets!).ToList();
if (ShippingItemPallets != null && ShippingItemPallets.Any(sip => sip.ShippingItem?.ProductDto != null))
{
gridOrderItemPallet.BeginUpdate();
gridOrderItemPallet.GetColumns().FirstOrDefault(x => x.Name == "ProductId")!.Visible = true;
gridOrderItemPallet.GetColumns().FirstOrDefault(x => x.Name == "ProductName")!.Visible = true;
gridOrderItemPallet.EndUpdate();
}
}
}
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
// if (OrderItemPallets != null && OrderItemPallets.Any(oip => oip.OrderItemDto?.ProductDto != null))
// {
// gridOrderItemPallet.BeginUpdate();
// gridOrderItemPallet.GetColumns().FirstOrDefault(x => x.Name == "ProductId")!.Visible = true;
// gridOrderItemPallet.GetColumns().FirstOrDefault(x => x.Name == "ProductName")!.Visible = true;
// gridOrderItemPallet.EndUpdate();
// }
}
return base.OnAfterRenderAsync(firstRender);
}
}
@* List<GenericAttribute> GenericAttributes { get; set; }
List<OrderItemPallet> OrderItemPallets { get; set; }
OrderDto OrderDto { get; set; }
bool IsMeasured
bool IsMeasurable
int TrayQuantity
double NetWeight
double GrossWeight
public Guid OrderItemGuid { get; set; }
public int OrderId { get; set; }
public int ProductId { get; set; }
public int Quantity { get; set; }
public decimal UnitPriceInclTax { get; set; }
public decimal UnitPriceExclTax { get; set; }
public decimal PriceInclTax { get; set; }
public decimal PriceExclTax { get; set; }
public string AttributesXml { get; set; }
public decimal? ItemWeight { get; set; }
public string ProductName => ProductDto?.Name ?? "ProductDto is null!!!";
public TProductDto? ProductDto { get; set; }
*@

View File

@ -20,12 +20,12 @@
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.PalletWeight)))" <DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.PalletWeight)))"
Field="@nameof(ShippingItemPallet.PalletWeight)" Field="@nameof(ShippingItemPallet.PalletWeight)"
Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Caption="Rakl.súly(kg)" ColSpanMd="2" /> Caption="Rakl.súly(kg)" ColSpanMd="2" />
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.TareWeight)))" <DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.TareWeight)))"
Field="@nameof(ShippingItemPallet.TareWeight)" Field="@nameof(ShippingItemPallet.TareWeight)"
Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Caption="Tára(kg)" ColSpanMd="2" /> Caption="Tára(kg)" ColSpanMd="2" />
@* <DxFormLayoutItem Context="ctxFromLayoutItemPallet" ColSpanMd="1" /> *@ @* <DxFormLayoutItem Context="ctxFromLayoutItemPallet" ColSpanMd="1" /> *@
@ -37,11 +37,12 @@
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.GrossWeight)))" <DxFormLayoutItem Context="ctxFromLayoutItemPallet" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.GrossWeight)))"
Field="@nameof(ShippingItemPallet.GrossWeight)" Field="@nameof(ShippingItemPallet.GrossWeight)"
Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Enabled="@(IsEditable && IsMeasurable && ProductId > 0)" Visible="@(IsMeasurable)"
Caption="Br.súly(kg)" ColSpanMd="2"> Caption="Br.súly(kg)" ColSpanMd="2">
</DxFormLayoutItem> </DxFormLayoutItem>
<DxFormLayoutItem Context="ctxFromLayoutItemPallet" Caption="Net(kg)" ColSpanMd="1" CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.NetWeight)))"> <DxFormLayoutItem Context="ctxFromLayoutItemPallet" Caption="Net(kg)" ColSpanMd="1" Visible="@(IsMeasurable)"
CaptionCssClass="@(GetOrderItemPalletsCssClassNames(nameof(IMeasuringItemPalletBase.NetWeight)))">
<text>@(PalletItem.NetWeight) kg.</text> <text>@(PalletItem.NetWeight) kg.</text>
</DxFormLayoutItem> </DxFormLayoutItem>

View File

@ -48,15 +48,15 @@ public partial class MainLayout : LayoutComponentBase
} }
} }
private Task SignalRClientOnMessageReceived(int messageTag, string? jsonMessage) private async Task SignalRClientOnMessageReceived(int messageTag, string? jsonMessage)
{ {
if (messageTag != SignalRTags.NotificationReceived || !LoggedInModel.IsLoggedIn) return Task.CompletedTask; if (messageTag != SignalRTags.NotificationReceived || !LoggedInModel.IsLoggedIn) return;
var notificationMessage = jsonMessage?.JsonTo<SignalRMessageToClientWithText<OrderDto>>(); var notificationMessage = jsonMessage?.JsonTo<SignalRMessageToClientWithText<OrderDto>>();
if (notificationMessage == null) if (notificationMessage == null)
{ {
_logger.Error($"notificationMessage == null"); _logger.Error($"notificationMessage == null");
return Task.CompletedTask; return;
} }
var orderDto = notificationMessage.Content; var orderDto = notificationMessage.Content;
@ -68,15 +68,12 @@ public partial class MainLayout : LayoutComponentBase
_logger.Debug($"NotificationMessage received. {toastMessage}"); _logger.Debug($"NotificationMessage received. {toastMessage}");
InvokeAsync(() => await InvokeAsync(() =>
{ {
orderNotificationToast?.Show(); orderNotificationToast?.Show();
StateHasChanged(); StateHasChanged();
}); });
return Task.CompletedTask;
} }
return Task.CompletedTask;
} }
private void OnLogoutClick() private void OnLogoutClick()

View File

@ -162,12 +162,11 @@
<DxFormLayoutItem Context="vfdfgfd" ColSpanMd="12" BeginRow="true"> <DxFormLayoutItem Context="vfdfgfd" ColSpanMd="12" BeginRow="true">
<DxFormLayout CssClass="w-100"> <DxFormLayout CssClass="w-100">
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>TOTAL:</strong></DxFormLayoutItem> <DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>TOTAL:</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="2" BeginRow="false" /> <DxFormLayoutItem ColSpanMd="2" BeginRow="false" Visible="@(SelectedShippingItem.IsMeasurable)" />
<DxFormLayoutItem ColSpanMd="2" BeginRow="false" /> <DxFormLayoutItem ColSpanMd="2" BeginRow="false" Visible="@(SelectedShippingItem.IsMeasurable)" />
<DxFormLayoutItem ColSpanMd="1" BeginRow="false" />
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>Rekesz: @(SelectedShippingItem.MeasuredQuantity) db</strong></DxFormLayoutItem> <DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>Rekesz: @(SelectedShippingItem.MeasuredQuantity) db</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="2" BeginRow="false"><strong>Br: @(SelectedShippingItem.MeasuredGrossWeight) kg</strong></DxFormLayoutItem> <DxFormLayoutItem ColSpanMd="2" BeginRow="false" Visible="@(SelectedShippingItem.IsMeasurable)"><strong>Br: @(SelectedShippingItem.MeasuredGrossWeight) kg</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1" BeginRow="false"><strong>Net: @(SelectedShippingItem.MeasuredNetWeight) kg</strong></DxFormLayoutItem> <DxFormLayoutItem ColSpanMd="1" BeginRow="false" Visible="@(SelectedShippingItem.IsMeasurable)"><strong>Net: @(SelectedShippingItem.MeasuredNetWeight) kg</strong></DxFormLayoutItem>
<DxFormLayoutItem ColSpanMd="1" BeginRow="false" /> <DxFormLayoutItem ColSpanMd="1" BeginRow="false" />
</DxFormLayout> </DxFormLayout>
</DxFormLayoutItem> </DxFormLayoutItem>

View File

@ -30,7 +30,7 @@
<GridShippingItem IsMasterGrid="true"></GridShippingItem> <GridShippingItem IsMasterGrid="true"></GridShippingItem>
</DxTabPage> </DxTabPage>
<DxTabPage Text="Mérések"> <DxTabPage Text="Mérések">
@* <GridDetailOrderItemPallets IsMasterGrid="true"></GridDetailOrderItemPallets> *@ <GridShippingItemPallets IsMasterGrid="true"></GridShippingItemPallets>
</DxTabPage> </DxTabPage>
</DxTabs> </DxTabs>
</DxLoadingPanel> </DxLoadingPanel>

File diff suppressed because it is too large Load Diff