73 lines
2.3 KiB
C#
73 lines
2.3 KiB
C#
using EgwCoreLib.Lux.Data.DbModel.Production;
|
|
using EgwCoreLib.Lux.Data.DbModel.Sales;
|
|
using EgwCoreLib.Lux.Data.Services;
|
|
using Microsoft.AspNetCore.Components;
|
|
using static EgwCoreLib.Lux.Core.Enums;
|
|
|
|
namespace Lux.UI.Components.Pages
|
|
{
|
|
public partial class WorkLoadBalance
|
|
{
|
|
#region Private Fields
|
|
|
|
/// <summary>
|
|
/// Periodo selezionato attuale
|
|
/// </summary>
|
|
private EgwCoreLib.Utils.DtUtils.Periodo PeriodoSel = new EgwCoreLib.Utils.DtUtils.Periodo(EgwCoreLib.Utils.DtUtils.PeriodSet.ThisYear);
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Methods
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
PeriodoSel= new EgwCoreLib.Utils.DtUtils.Periodo(EgwCoreLib.Utils.DtUtils.PeriodSet.ThisYear);
|
|
PeriodoSel.Inizio = PeriodoSel.Inizio.AddYears(-1);
|
|
}
|
|
|
|
private List<OrderRowModel>? ListEstimRecords = null;
|
|
private List<ProductionGroupModel>? ListBalancedRecords = null;
|
|
|
|
[Inject]
|
|
protected CalcRequestService CService { get; set; } = null!;
|
|
|
|
[Inject]
|
|
protected DataLayerServices DLService { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Imposta periodo da filtro
|
|
/// </summary>
|
|
/// <param name="newPeriod"></param>
|
|
/// <returns></returns>
|
|
private async Task SetPeriodo(EgwCoreLib.Utils.DtUtils.Periodo newPeriod)
|
|
{
|
|
PeriodoSel = newPeriod;
|
|
await ReloadData();
|
|
UpdateTable();
|
|
}
|
|
/// <summary>
|
|
/// Legge i dati dei record completi
|
|
/// </summary>
|
|
private async Task ReloadData()
|
|
{
|
|
// prendo solo ordini stimati (NON ancora bilanciati o pianificati)
|
|
ListEstimRecords = await DLService.OrderRowGetByState(OrderStates.Estimated);
|
|
ListBalancedRecords = await DLService.ProdGroupByOrderState(OrderStates.Estimated);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Filtro e paginazione
|
|
/// </summary>
|
|
private void UpdateTable()
|
|
{
|
|
#if false
|
|
// fix paginazione
|
|
ListRecords = ListFilt
|
|
.Skip(numRecord * (currPage - 1))
|
|
.Take(numRecord)
|
|
.ToList();
|
|
#endif
|
|
}
|
|
#endregion Private Methods
|
|
}
|
|
} |