110 lines
3.8 KiB
Plaintext
110 lines
3.8 KiB
Plaintext
@using FruitBank.Common.Dtos
|
|
@using FruitBank.Common.Entities
|
|
@using FruitBankHybrid.Shared.Services.SignalRs
|
|
|
|
@inject FruitBankSignalRClient FruitBankSignalRClient
|
|
|
|
<MgGridBase @ref="gridOrderItemPallet" Data="OrderItemPallets" 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="OrderItemId" Caption="oiId" Width="125" />
|
|
<DxGridDataColumn FieldName="OrderItemDto.OrderId" Caption="oId" Width="125" />
|
|
<DxGridDataColumn Name="ProductId" FieldName="OrderItemDto.ProductId" Caption="pId" Width="125" Visible="false" />
|
|
<DxGridDataColumn Name="ProductName" FieldName="OrderItemDto.ProductDto.Name" Caption="ProductName" Visible="false" />
|
|
|
|
<DxGridDataColumn FieldName="PalletWeight" />
|
|
<DxGridDataColumn FieldName="TareWeight" />
|
|
|
|
<DxGridDataColumn FieldName="TrayQuantity" />
|
|
<DxGridDataColumn FieldName="GrossWeight" />
|
|
<DxGridDataColumn FieldName="NetWeight" />
|
|
|
|
<DxGridDataColumn FieldName="IsMeasured" />
|
|
<DxGridDataColumn FieldName="IsAudited" />
|
|
</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<OrderItemPallet>? OrderItemPallets { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
if (OrderItemPallets == null)
|
|
{
|
|
OrderItemPallets = await FruitBankSignalRClient.GetAllOrderItemPallets();
|
|
|
|
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();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
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; }
|
|
*@ |