diff --git a/MP.Data/Controllers/MpSpecController.cs b/MP.Data/Controllers/MpSpecController.cs index ead7a188..83e4b7f4 100644 --- a/MP.Data/Controllers/MpSpecController.cs +++ b/MP.Data/Controllers/MpSpecController.cs @@ -932,6 +932,7 @@ namespace MP.Data.Controllers currRec.KeyRichiesta = editRec.KeyRichiesta; currRec.NumPezzi = editRec.NumPezzi; currRec.Tcassegnato = editRec.Tcassegnato; + currRec.Attivabile = editRec.Attivabile; currRec.Note = editRec.Note; dbCtx.Entry(currRec).State = EntityState.Modified; } diff --git a/MP.SPEC/Components/ListODL.razor b/MP.SPEC/Components/ListODL.razor index 0f4c5086..3729a110 100644 --- a/MP.SPEC/Components/ListODL.razor +++ b/MP.SPEC/Components/ListODL.razor @@ -99,8 +99,9 @@ else else {
-
@($"{DateTime.Now:yyyy/MM/dd}")
-
@($"{DateTime.Now:ddd HH:mm:ss}")
+ @*
@($"{DateTime.Now:yyyy/MM/dd}")
+
@($"{DateTime.Now:ddd HH:mm:ss}")
*@ +
NOW
} @@ -172,8 +173,9 @@ else else {
-
@($"{DateTime.Now:yyyy/MM/dd}")
-
@($"{DateTime.Now:ddd HH:mm:ss}")
+ @*
@($"{DateTime.Now:yyyy/MM/dd}")
+
@($"{DateTime.Now:ddd HH:mm:ss}")
*@ +
NOW
} diff --git a/MP.SPEC/Components/ListODL.razor.cs b/MP.SPEC/Components/ListODL.razor.cs index 2a062862..78fa855e 100644 --- a/MP.SPEC/Components/ListODL.razor.cs +++ b/MP.SPEC/Components/ListODL.razor.cs @@ -53,8 +53,10 @@ namespace MP.SPEC.Components [Inject] protected MpDataService MDService { get; set; } = null!; +#if false [Inject] - protected MessageService MessageService { get; set; } = null!; + protected MessageService MessageService { get; set; } = null!; +#endif [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; @@ -235,8 +237,8 @@ namespace MP.SPEC.Components private int currPage { - get => MessageService.currPage; - set => MessageService.currPage = value; + get => currFilter.CurrPage; + set => currFilter.CurrPage = value; } /// @@ -251,8 +253,8 @@ namespace MP.SPEC.Components private int numRecord { - get => MessageService.numRecord; - set => MessageService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private DateTime selDtFine { get; set; } = DateTime.Now; @@ -324,10 +326,12 @@ namespace MP.SPEC.Components private List? ListOdlStatsLabels = new List(); #endif +#if false private async void MessageService_EA_PageUpdated() { await reloadData(); - } + } +#endif private string pbStyle(string css) { diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index ad5575e3..ce222f9f 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -51,8 +51,10 @@ namespace MP.SPEC.Components [Inject] protected IOApiService MpIoApiCall { get; set; } = null!; +#if true [Inject] - protected MessageService MsgService { get; set; } = null!; + protected MessageService MsgService { get; set; } = null!; +#endif #endregion Protected Properties @@ -103,9 +105,11 @@ namespace MP.SPEC.Components protected override async Task OnInitializedAsync() { +#if true MsgService.EA_PageUpdated += MessageService_EA_PageUpdated; MsgService.EA_SearchUpdated += OnSeachUpdated; - MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; + MsgService.EA_StatoSearch += MsgService_EA_StatoSearch; +#endif ListStati = await MDService.AnagStatiComm(); } @@ -254,7 +258,7 @@ namespace MP.SPEC.Components { var response = await MpIoApiCall.callMpIoUrlGet(restUrl); } - catch(Exception exc) + catch (Exception exc) { } } @@ -305,7 +309,7 @@ namespace MP.SPEC.Components private bool canStartOdl(string idxMacchina) { var currOdl = MDService.OdlGetCurrentByMacc(idxMacchina); - bool answ = currOdl == null; + bool answ = (currOdl == null || currOdl.IdxOdl == 0); return answ; } diff --git a/MP.SPEC/Data/MpDataService.cs b/MP.SPEC/Data/MpDataService.cs index 73f64ab4..4ddf2dee 100644 --- a/MP.SPEC/Data/MpDataService.cs +++ b/MP.SPEC/Data/MpDataService.cs @@ -686,13 +686,16 @@ namespace MP.SPEC.Data else { dbResult = dbController.OdlGetCurrentByMacc(idxMacchina); - // serializzp e salvo... - rawData = JsonConvert.SerializeObject(dbResult); - redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); + //if (dbResult != null) + //{ + // serializzp e salvo... + rawData = JsonConvert.SerializeObject(dbResult); + redisDb.StringSet(currKey, rawData, TimeSpan.FromSeconds(3)); + //} } if (dbResult == null) { - dbResult = new ODLModel(); + dbResult = new ODLModel(); } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; diff --git a/MP.SPEC/Data/SelectOdlParams.cs b/MP.SPEC/Data/SelectOdlParams.cs index 47a23ad0..f9c089dd 100644 --- a/MP.SPEC/Data/SelectOdlParams.cs +++ b/MP.SPEC/Data/SelectOdlParams.cs @@ -17,6 +17,7 @@ namespace MP.SPEC.Data public string IdxMacchina { get; set; } = "*"; public int CurrPage { get; set; } = 1; public int NumRec { get; set; } = 10; + public int TotCount { get; set; } = 0; public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5); public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7); public int MaxRecord { get; set; } = 100; diff --git a/MP.SPEC/Data/SelectPOdlParams.cs b/MP.SPEC/Data/SelectPOdlParams.cs new file mode 100644 index 00000000..b2e9b616 --- /dev/null +++ b/MP.SPEC/Data/SelectPOdlParams.cs @@ -0,0 +1,72 @@ +using MP.Data; + +namespace MP.SPEC.Data +{ + public class SelectPOdlParams + { + #region Public Constructors + + public SelectPOdlParams() + { } + + #endregion Public Constructors + + #region Public Properties + + public string CodStato { get; set; } = "*"; + public string IdxMacchina { get; set; } = "*"; + public int CurrPage { get; set; } = 1; + public int NumRec { get; set; } = 10; + public DateTime DtEnd { get; set; } = Utils.InitDatetime(DateTime.Now, 5); + public DateTime DtStart { get; set; } = Utils.InitDatetime(DateTime.Now, 5).AddDays(-7); + public int MaxRecord { get; set; } = 100; + public bool IsActive { get; set; } = true; + public string SearchVal { get; set; } = "*"; + + #endregion Public Properties + + #region Public Methods + + public override bool Equals(object obj) + { + if (!(obj is SelectOdlParams item)) + return false; + + if (IsActive != item.IsActive) + return false; + + if (CodStato != item.CodStato) + return false; + + if (IdxMacchina != item.IdxMacchina) + return false; + + if (MaxRecord != item.MaxRecord) + return false; + + if (NumRec != item.NumRec) + return false; + + if (DtStart != item.DtStart) + return false; + + if (DtEnd != item.DtEnd) + return false; + + if (CurrPage != item.CurrPage) + return false; + + if (SearchVal != item.SearchVal) + return false; + + return true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/MP.SPEC/Pages/ODL.razor.cs b/MP.SPEC/Pages/ODL.razor.cs index a9b5aba2..7ddd5330 100644 --- a/MP.SPEC/Pages/ODL.razor.cs +++ b/MP.SPEC/Pages/ODL.razor.cs @@ -116,7 +116,9 @@ namespace MP.SPEC.Pages protected void UpdateTotCount(int newTotCount) { - totalCount = newTotCount; +#if false + totalCount = newTotCount; +#endif } #endregion Protected Methods @@ -147,8 +149,8 @@ namespace MP.SPEC.Pages private int numRecord { - get => MsgService.numRecord; - set => MsgService.numRecord = value; + get => currFilter.NumRec; + set => currFilter.NumRec = value; } private string rightStringCSS @@ -169,8 +171,8 @@ namespace MP.SPEC.Pages private int totalCount { - get => MsgService.totalCount; - set => MsgService.totalCount = value; + get => currFilter.TotCount; + set => currFilter.TotCount = value; } #endregion Private Properties