diff --git a/FruitBank.Common/Dtos/GenericAttributeDto.cs b/FruitBank.Common/Dtos/GenericAttributeDto.cs new file mode 100644 index 0000000..252cf1b --- /dev/null +++ b/FruitBank.Common/Dtos/GenericAttributeDto.cs @@ -0,0 +1,8 @@ +using Mango.Nop.Core.Dtos; + +namespace FruitBank.Common.Dtos; + +public class GenericAttributeDto : MgGenericAttributeDto +{ + +} \ No newline at end of file diff --git a/FruitBank.Common/Dtos/OrderDto.cs b/FruitBank.Common/Dtos/OrderDto.cs index bad5f03..8993f86 100644 --- a/FruitBank.Common/Dtos/OrderDto.cs +++ b/FruitBank.Common/Dtos/OrderDto.cs @@ -22,12 +22,12 @@ namespace FruitBank.Common.Dtos; public class OrderDto : MgOrderDto, IOrderDto { [NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore] - private static Expression> RelationWithGenericAttribute => (orderDto, genericAttribute) => - orderDto.Id == genericAttribute.EntityId && genericAttribute.KeyGroup == nameof(Order); + private static Expression> RelationWithGenericAttribute => (orderDto, genericAttributeDto) => + orderDto.Id == genericAttributeDto.EntityId && genericAttributeDto.KeyGroup == nameof(Order); [Association(ThisKey = nameof(Id), OtherKey = nameof(GenericAttribute.EntityId), ExpressionPredicate = nameof(RelationWithGenericAttribute), CanBeNull = true)] - public List GenericAttributes { get; set; } + public List GenericAttributes { get; set; } [NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore] public bool IsMeasured diff --git a/FruitBank.Common/Dtos/OrderItemDto.cs b/FruitBank.Common/Dtos/OrderItemDto.cs index 60f9a7c..db09af7 100644 --- a/FruitBank.Common/Dtos/OrderItemDto.cs +++ b/FruitBank.Common/Dtos/OrderItemDto.cs @@ -16,12 +16,12 @@ namespace FruitBank.Common.Dtos; public class OrderItemDto : MgOrderItemDto, IOrderItemDto { [NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore] - private static Expression> RelationWithGenericAttribute => (orderItemDto, genericAttribute) => - orderItemDto.Id == genericAttribute.EntityId && genericAttribute.KeyGroup == nameof(OrderItem); + private static Expression> RelationWithGenericAttribute => (orderItemDto, genericAttributeDto) => + orderItemDto.Id == genericAttributeDto.EntityId && genericAttributeDto.KeyGroup == nameof(OrderItem); [Association(ThisKey = nameof(Id), OtherKey = nameof(GenericAttribute.EntityId), ExpressionPredicate = nameof(RelationWithGenericAttribute), CanBeNull = true)] - public List GenericAttributes { get; set; } + public List GenericAttributes { get; set; } [Association(ThisKey = nameof(Id), OtherKey = nameof(OrderItemPallet.OrderItemId), CanBeNull = true)] public List OrderItemPallets { get; set; } diff --git a/FruitBank.Common/Dtos/ProductDto.cs b/FruitBank.Common/Dtos/ProductDto.cs index c42991b..c9d26dd 100644 --- a/FruitBank.Common/Dtos/ProductDto.cs +++ b/FruitBank.Common/Dtos/ProductDto.cs @@ -6,18 +6,19 @@ using Newtonsoft.Json; //using Nop.Core.Domain.Catalog; using Nop.Core.Domain.Common; using System.Linq.Expressions; +using Mango.Nop.Core.Interfaces.ForeignKeys; namespace FruitBank.Common.Dtos; public class ProductDto : MgProductDto, IProductDto { [NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore] - private static Expression> RelationWithGenericAttribute => (orderItemDto, genericAttribute) => - orderItemDto.Id == genericAttribute.EntityId && genericAttribute.KeyGroup == "Product";// nameof(Product); + private static Expression> RelationWithGenericAttribute => (orderItemDto, genericAttributeDto) => + orderItemDto.Id == genericAttributeDto.EntityId && genericAttributeDto.KeyGroup == "Product";// nameof(Product); - [Association(ThisKey = nameof(Id), OtherKey = nameof(GenericAttribute.EntityId), ExpressionPredicate = nameof(RelationWithGenericAttribute), CanBeNull = false)] - public List GenericAttributes { get; set; } + [Association(ThisKey = nameof(Id), OtherKey = nameof(GenericAttributeDto.EntityId), ExpressionPredicate = nameof(RelationWithGenericAttribute), CanBeNull = false)] + public List GenericAttributes { get; set; } public ProductDto() :base() { } @@ -52,7 +53,6 @@ public class ProductDto : MgProductDto, IProductDto public double NetWeight { get => GenericAttributes.GetValueOrDefault(nameof(IMeasuringNetWeight.NetWeight)); - //get => CommonHelper.To(GenericAttributes.SingleOrDefault(x => x.Key == nameof(IMeasuringNetWeight.NetWeight))?.Value ?? "0"); set => throw new Exception($"ProductDto.NetWeight not set"); } @@ -60,8 +60,14 @@ public class ProductDto : MgProductDto, IProductDto public int IncomingQuantity { get => GenericAttributes.GetValueOrDefault(nameof(IIncomingQuantity.IncomingQuantity)); - //get => CommonHelper.To(GenericAttributes.SingleOrDefault(x => x.Key == nameof(IIncomingQuantity.IncomingQuantity))?.Value ?? "0"); set => throw new Exception($"ProductDto.IncomingQuantity not set"); + //set + //{ + // var ga = GenericAttributes.FirstOrDefault(ga => ga.Key == nameof(IIncomingQuantity.IncomingQuantity)) ?? + // GenericAttributes.AddNewGenericAttribute("Product", nameof(IIncomingQuantity.IncomingQuantity), value.ToString(), Id); + + // ga.Value = value.ToString(); + //} } [NotColumn, JsonIgnore, System.Text.Json.Serialization.JsonIgnore] diff --git a/FruitBank.Common/FruitBankConstClient.cs b/FruitBank.Common/FruitBankConstClient.cs index ac5971b..0f5d7fd 100644 --- a/FruitBank.Common/FruitBankConstClient.cs +++ b/FruitBank.Common/FruitBankConstClient.cs @@ -7,23 +7,22 @@ public static class FruitBankConstClient { public static string DefaultLocale = "en-US"; - //public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop - public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop - -#if RELEASE + public static string BaseUrl = "https://localhost:59579"; //FrutiBank nop //public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop -#endif + #if RELEASE + // public static string BaseUrl = "https://shop.fruitbank.hu"; //FrutiBank nop + #endif //public static string BaseUrl = "http://localhost:5000"; //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 static long SignalRKeepAliveIntervalSecond = 60; - public static long SignarlRTimeoutIntervalSecond = 120; + public static long SignarlRTimeoutIntervalSecond = 180; public const string PalletDbTableName = "fbPallet"; public const string FilesDbTableName = "fbFiles"; diff --git a/FruitBank.Common/Interfaces/IOrderDto.cs b/FruitBank.Common/Interfaces/IOrderDto.cs index 6d30b47..c3a608d 100644 --- a/FruitBank.Common/Interfaces/IOrderDto.cs +++ b/FruitBank.Common/Interfaces/IOrderDto.cs @@ -2,10 +2,11 @@ using FruitBank.Common.Enums; using Mango.Nop.Core.Dtos; using Mango.Nop.Core.Interfaces; +using Mango.Nop.Core.Interfaces.ForeignKeys; namespace FruitBank.Common.Interfaces; -public interface IOrderDto : IMgOrderDto, IMeasured, IMeasurable, IMeasurableStatus +public interface IOrderDto : IMgOrderDto, IMeasured, IMeasurable, IMeasurableStatus, IGenericAttributeForeignCollection> { DateTime? DateOfReceipt { get; } DateTime DateOfReceiptOrCreated { get; } diff --git a/FruitBank.Common/Interfaces/IOrderItemDto.cs b/FruitBank.Common/Interfaces/IOrderItemDto.cs index a1b2a51..44821f0 100644 --- a/FruitBank.Common/Interfaces/IOrderItemDto.cs +++ b/FruitBank.Common/Interfaces/IOrderItemDto.cs @@ -3,11 +3,12 @@ using FruitBank.Common.Entities; using FruitBank.Common.Enums; using Mango.Nop.Core.Dtos; using Mango.Nop.Core.Interfaces; +using Mango.Nop.Core.Interfaces.ForeignKeys; //using Nop.Core.Domain.Catalog; namespace FruitBank.Common.Interfaces; -public interface IOrderItemDto : IMgOrderItemDto, IMeasuringValues, IMeasured, IMeasurable, IMeasurableStatus +public interface IOrderItemDto : IMgOrderItemDto, IMeasuringValues, IMeasured, IMeasurable, IMeasurableStatus, IGenericAttributeForeignCollection> { OrderDto OrderDto { get; set; } List OrderItemPallets { get; set; } diff --git a/FruitBank.Common/Interfaces/IProductDto.cs b/FruitBank.Common/Interfaces/IProductDto.cs index 9aaf8ad..e4a1245 100644 --- a/FruitBank.Common/Interfaces/IProductDto.cs +++ b/FruitBank.Common/Interfaces/IProductDto.cs @@ -1,8 +1,10 @@ -using Mango.Nop.Core.Interfaces; +using FruitBank.Common.Dtos; +using Mango.Nop.Core.Interfaces; +using Mango.Nop.Core.Interfaces.ForeignKeys; namespace FruitBank.Common.Interfaces; -public interface IProductDto : IMgProductDto, ITare, IIncomingQuantity, IAvailableQuantity, IMeasuringAttributeValues +public interface IProductDto : IMgProductDto, ITare, IIncomingQuantity, IAvailableQuantity, IMeasuringAttributeValues, IGenericAttributeForeignCollection> { public double AverageWeight { get; } diff --git a/FruitBank.Common/SignalRs/SignalRTags.cs b/FruitBank.Common/SignalRs/SignalRTags.cs index 4f16cce..87e4d38 100644 --- a/FruitBank.Common/SignalRs/SignalRTags.cs +++ b/FruitBank.Common/SignalRs/SignalRTags.cs @@ -81,7 +81,15 @@ public class SignalRTags : AcSignalRTags public const int GetStockQuantityHistoryDtos = 150; public const int GetStockQuantityHistoryDtosByProductId = 151; - + + public const int GetGenericAttributeDtos = 160; + /// + /// Params: int EntityId, string KeyGroup, int StoreId + /// + public const int GetGenericAttributeDtosByEntityIdAndKeyGroup = 161; + public const int AddGenericAttributeDto = 168; + public const int UpdateGenericAttributeDto = 169; + public const int AuthenticateUser = 195; public const int RefreshToken = 200; diff --git a/FruitBankHybrid.Shared/Components/GridDetailOrderDto.razor b/FruitBankHybrid.Shared/Components/GridDetailOrderDto.razor index e3ebd53..804dda9 100644 --- a/FruitBankHybrid.Shared/Components/GridDetailOrderDto.razor +++ b/FruitBankHybrid.Shared/Components/GridDetailOrderDto.razor @@ -1,6 +1,8 @@ -@using AyCode.Utils.Extensions +@using AyCode.Core.Helpers +@using AyCode.Utils.Extensions @using FruitBank.Common.Dtos @using FruitBank.Common.Models +@using FruitBankHybrid.Shared.Components.Grids.GenericAttributes @using FruitBankHybrid.Shared.Components.Toolbars @using FruitBankHybrid.Shared.Databases @using FruitBankHybrid.Shared.Services.SignalRs @@ -54,6 +56,13 @@ // } + + @{ + var genericAttributeDtos = new AcObservableCollection(orderDto.GenericAttributes); + + } + + } diff --git a/FruitBankHybrid.Shared/Components/GridDetailOrderItemDto.razor b/FruitBankHybrid.Shared/Components/GridDetailOrderItemDto.razor index 311923e..7fbcc63 100644 --- a/FruitBankHybrid.Shared/Components/GridDetailOrderItemDto.razor +++ b/FruitBankHybrid.Shared/Components/GridDetailOrderItemDto.razor @@ -2,6 +2,7 @@ @using AyCode.Utils.Extensions @using FruitBank.Common.Dtos @using FruitBank.Common.Models +@using FruitBankHybrid.Shared.Components.Grids.GenericAttributes @using FruitBankHybrid.Shared.Components.Toolbars @using FruitBankHybrid.Shared.Databases @using FruitBankHybrid.Shared.Services.SignalRs @@ -36,11 +37,11 @@ - + @* *@ - + @@ -54,13 +55,26 @@ @if (IsMasterGrid && LoggedInModel.IsDeveloper) { - + var orderItemDto = ((OrderItemDto)context.DataItem); + + + @{ + + } + + + @{ + var genericAttributeDtos = new AcObservableCollection(orderItemDto.GenericAttributes); + + } + + } @if (IsMasterGrid) { - + } @@ -96,7 +110,7 @@ private async Task ReloadDataFromDb(bool forceReload = false) { LoadingPanelVisibility.Visible = true; - + using (await ObjectLock.GetSemaphore().UseWaitAsync()) { if (ProductDtos == null || !ProductDtos.Any() || forceReload) ProductDtos = await Database.ProductDtoTable.LoadDataAsync(!forceReload); diff --git a/FruitBankHybrid.Shared/Components/GridProductDtoTemplate.razor b/FruitBankHybrid.Shared/Components/GridProductDtoTemplate.razor index 339756c..6d30316 100644 --- a/FruitBankHybrid.Shared/Components/GridProductDtoTemplate.razor +++ b/FruitBankHybrid.Shared/Components/GridProductDtoTemplate.razor @@ -4,6 +4,7 @@ @using DevExpress.Internal.About @using FruitBank.Common.Dtos @using FruitBank.Common.Models +@using FruitBankHybrid.Shared.Components.Grids.GenericAttributes @using FruitBankHybrid.Shared.Components.Grids.Products @using FruitBankHybrid.Shared.Components.Toolbars @using FruitBankHybrid.Shared.Databases @@ -31,7 +32,9 @@ @if (IsMasterGrid) { - var productId = ((ProductDto)context.DataItem).Id; + var productDto = ((ProductDto)(context.DataItem)); + var productId = productDto.Id; + @@ -53,8 +56,14 @@ //GetOrderItemDtosFromDbAsync(productId).Forget(); //var orderItemDtos = _orderItemDtos?.Where(oi => oi.ProductId == productId).ToList() ?? []; - var contextIds = new[] { (object)((ProductDto)(context.DataItem)).Id }; - + var contextIds = new[] { (object)productDto.Id }; + + } + + + @{ + var genericAttributeDtos = new AcObservableCollection(productDto.GenericAttributes); + } diff --git a/FruitBankHybrid.Shared/Components/GridShippingItemTemplate.razor b/FruitBankHybrid.Shared/Components/GridShippingItemTemplate.razor index a1209e5..a074749 100644 --- a/FruitBankHybrid.Shared/Components/GridShippingItemTemplate.razor +++ b/FruitBankHybrid.Shared/Components/GridShippingItemTemplate.razor @@ -15,8 +15,8 @@ @inject IEnumerable LogWriters @inject FruitBankSignalRClient FruitBankSignalRClient - diff --git a/FruitBankHybrid.Shared/Components/Grids/GenericAttributes/GridGenericAttribute.razor b/FruitBankHybrid.Shared/Components/Grids/GenericAttributes/GridGenericAttribute.razor new file mode 100644 index 0000000..86f9c9d --- /dev/null +++ b/FruitBankHybrid.Shared/Components/Grids/GenericAttributes/GridGenericAttribute.razor @@ -0,0 +1,83 @@ +@using System.Collections.ObjectModel +@using AyCode.Core.Helpers +@using AyCode.Core.Interfaces +@using AyCode.Core.Loggers +@using AyCode.Utils.Extensions +@using FruitBank.Common.Dtos +@using FruitBank.Common.Entities +@using FruitBankHybrid.Shared.Components.Grids.Shippings +@using FruitBankHybrid.Shared.Components.Toolbars +@using FruitBankHybrid.Shared.Databases +@using FruitBankHybrid.Shared.Services.Loggers +@using FruitBankHybrid.Shared.Services.SignalRs +@using Nop.Core.Domain.Common + +@inject IEnumerable LogWriters +@inject FruitBankSignalRClient FruitBankSignalRClient + + + + + + + + + + + + + + + + @if (IsMasterGrid) + { + + } + + + +@code { + [Inject] public required DatabaseClient Database { get; set; } + + [Parameter] public AcObservableCollection? GenericAttributes{ get; set; } + + //[Parameter] public object[]? ContextIds { get; set; } + [Parameter] public IId? ParentDataItem { get; set; } + public bool IsMasterGrid => ParentDataItem == null; + + const string ExportFileName = "ExportResult"; + string GridSearchText = ""; + bool EditItemsEnabled { get; set; } + int FocusedRowVisibleIndex { get; set; } + + public GridGenericAttributeBase Grid { get; set; } + string GridCss => !IsMasterGrid ? "hide-toolbar" : string.Empty; + + private LoggerClient _logger; + + protected override async Task OnInitializedAsync() + { + _logger = new LoggerClient(LogWriters.ToArray()); + await ReloadDataFromDb(false); + } + + private async Task ReloadDataFromDb(bool forceReload = false) + { + if (!IsMasterGrid) return; + + if (forceReload) Grid?.Reload(); + } + + async Task Grid_FocusedRowChanged(GridFocusedRowChangedEventArgs args) + { + if (Grid == null) return; + + if (Grid.IsEditing() && !Grid.IsEditingNewRow()) + await Grid.SaveChangesAsync(); + + FocusedRowVisibleIndex = args.VisibleIndex; + EditItemsEnabled = true; + } +} + diff --git a/FruitBankHybrid.Shared/Components/Grids/GenericAttributes/GridGenericAttributeBase.cs b/FruitBankHybrid.Shared/Components/Grids/GenericAttributes/GridGenericAttributeBase.cs new file mode 100644 index 0000000..9e3c481 --- /dev/null +++ b/FruitBankHybrid.Shared/Components/Grids/GenericAttributes/GridGenericAttributeBase.cs @@ -0,0 +1,124 @@ +using AyCode.Core.Interfaces; +using AyCode.Utils.Extensions; +using DevExpress.Blazor; +using FruitBank.Common.Dtos; +using FruitBank.Common.Entities; +using FruitBank.Common.Interfaces; +using FruitBank.Common.SignalRs; +using FruitBankHybrid.Shared.Pages; +using Microsoft.AspNetCore.Components; +using Nop.Core.Domain.Common; +using Nop.Core.Domain.Orders; + +namespace FruitBankHybrid.Shared.Components.Grids.GenericAttributes; + +public class GridGenericAttributeBase: FruitBankGridBase, IGrid +{ + protected const int ContextEntityIdIndex = 0; + protected const int ContextKeyGroupIndex = 1; + protected const int ContextStoreIdIndex = 2; + + private bool _isFirstInitializeParameterCore; + private bool _isFirstInitializeParameters; + + public GridGenericAttributeBase() : base() + { + AddMessageTag = SignalRTags.AddGenericAttributeDto; + UpdateMessageTag = SignalRTags.UpdateGenericAttributeDto; + + //RemoveMessageTag = SignalRTags.; + } + + protected override async Task OnInitializedAsync() + { + if (GetAllMessageTag > 0) return; + + if (IsMasterGrid) GetAllMessageTag = SignalRTags.GetGenericAttributeDtos; + else + { + var hasContextIdParameter = ContextIds is { Length: > 0 }; + + if (!hasContextIdParameter) + { + ContextIds = new object[3]; + ContextIds[ContextEntityIdIndex] = ParentDataItem!.Id; + ContextIds[ContextStoreIdIndex] = LoggedInModel.CustomerDto!.RegisteredInStoreId; + } + + GetAllMessageTag = SignalRTags.GetGenericAttributeDtosByEntityIdAndKeyGroup; + if (KeyFieldNameToParentId.IsNullOrWhiteSpace()) KeyFieldNameToParentId = nameof(GenericAttribute.EntityId); + + switch (ParentDataItem) + { + case IProductDto: + if (!hasContextIdParameter) ContextIds![ContextKeyGroupIndex] = "Product"; + + break; + case IOrderDto: + if (!hasContextIdParameter) ContextIds![ContextKeyGroupIndex] = nameof(Order); + + break; + case IOrderItemDto: + if (!hasContextIdParameter) ContextIds![ContextKeyGroupIndex] = nameof(OrderItem); + + break; + } + } + + await base.OnInitializedAsync(); + } + + protected override async Task OnCustomizeEditModel(GridCustomizeEditModelEventArgs e) + { + if (e.IsNew && ParentDataItem != null && ContextIds != null) + { + var editModel = (e.EditModel as GenericAttributeDto)!; + + editModel.KeyGroup = (string)ContextIds![ContextKeyGroupIndex]; + editModel.StoreId = (int)ContextIds![ContextStoreIdIndex]; + editModel.CreatedOrUpdatedDateUTC = DateTime.UtcNow; + + e.EditModel = editModel; + } + + await base.OnCustomizeEditModel(e); + } + + protected override void OnParametersSet() + { + base.OnParametersSet(); + + if (!_isFirstInitializeParameters) + { + //if (!IsMasterGrid && (ContextIds == null || ContextIds.Length == 0)) + //{ + // ContextIds = [ParentDataItem!.Id]; + // GetAllMessageTag = SignalRTags.GetShippingItemsByDocumentId; + //} + + _isFirstInitializeParameters = false; + } + } + + protected override async Task SetParametersAsyncCore(ParameterView parameters) + { + await base.SetParametersAsyncCore(parameters); + + if (!_isFirstInitializeParameterCore) + { + //if (!IsMasterGrid && (ContextIds == null || ContextIds.Length == 0)) + //{ + // ContextIds = [ParentDataItem!.Id]; + // GetAllMessageTag = SignalRTags.GetShippingItemsByDocumentId; + //} + + //ShowFilterRow = true; + //ShowGroupPanel = true; + //AllowSort = false; + + //etc... + + _isFirstInitializeParameterCore = false; + } + } +} \ No newline at end of file diff --git a/FruitBankHybrid.Shared/Components/Grids/OrderItems/GridOrderItem.cs b/FruitBankHybrid.Shared/Components/Grids/OrderItems/GridOrderItem.cs index 122fd94..c7941a2 100644 --- a/FruitBankHybrid.Shared/Components/Grids/OrderItems/GridOrderItem.cs +++ b/FruitBankHybrid.Shared/Components/Grids/OrderItems/GridOrderItem.cs @@ -4,7 +4,7 @@ using FruitBank.Common.SignalRs; using FruitBankHybrid.Shared.Pages; using Microsoft.AspNetCore.Components; -namespace FruitBankHybrid.Shared.Components.Grids.OrderItem; +namespace FruitBankHybrid.Shared.Components.Grids.OrderItems; //public class GridOrderItem : FruitBankGrid //{ diff --git a/FruitBankHybrid.Shared/Components/Grids/Partners/GridPartner.razor b/FruitBankHybrid.Shared/Components/Grids/Partners/GridPartner.razor index ef4bdab..08b60e7 100644 --- a/FruitBankHybrid.Shared/Components/Grids/Partners/GridPartner.razor +++ b/FruitBankHybrid.Shared/Components/Grids/Partners/GridPartner.razor @@ -79,11 +79,11 @@ string GridCss => !IsMasterGrid ? "hide-toolbar" : string.Empty; private int _activeTabIndex; - private LoggerClient _logger; + private LoggerClient _logger; protected override async Task OnInitializedAsync() { - _logger = new LoggerClient(LogWriters.ToArray()); + _logger = new LoggerClient(LogWriters.ToArray()); await ReloadDataFromDb(false); } diff --git a/FruitBankHybrid.Shared/Components/Grids/ShippingItems/GridShippingItemBase.cs b/FruitBankHybrid.Shared/Components/Grids/ShippingItems/GridShippingItemBase.cs index 08761cf..df08744 100644 --- a/FruitBankHybrid.Shared/Components/Grids/ShippingItems/GridShippingItemBase.cs +++ b/FruitBankHybrid.Shared/Components/Grids/ShippingItems/GridShippingItemBase.cs @@ -35,19 +35,19 @@ public class GridShippingItemBase : FruitBankGridBase, IGrid { case IShippingDocument: GetAllMessageTag = SignalRTags.GetShippingItemsByDocumentId; + if (KeyFieldNameToParentId.IsNullOrWhiteSpace()) KeyFieldNameToParentId = nameof(ShippingItem.ShippingDocumentId); break; case IShipping: AddMessageTag = 0;//SignalRTags.None; GetAllMessageTag = SignalRTags.GetShippingItemsByShippingId; - + break; case IPartner: AddMessageTag = 0;//SignalRTags.None; GetAllMessageTag = SignalRTags.GetShippingItemsByPartnerId; break; - } } diff --git a/FruitBankHybrid.Web.Client/Program.cs b/FruitBankHybrid.Web.Client/Program.cs index 3c8c491..44f010f 100644 --- a/FruitBankHybrid.Web.Client/Program.cs +++ b/FruitBankHybrid.Web.Client/Program.cs @@ -7,6 +7,7 @@ using FruitBankHybrid.Shared.Services.SignalRs; using FruitBankHybrid.Web.Client.Services; using FruitBankHybrid.Web.Client.Services.Loggers; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; +using Microsoft.AspNetCore.SignalR.Client; var builder = WebAssemblyHostBuilder.CreateDefault(args);