diff --git a/MP-STATS.sln b/MP-STATS.sln index c8630043..3b5b6475 100644 --- a/MP-STATS.sln +++ b/MP-STATS.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.31229.75 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP-STATS", "MP.Stats\MP.Stats.csproj", "{D9901B50-E61C-400C-B62C-FA060CF72C29}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Stats", "MP.Stats\MP.Stats.csproj", "{D9901B50-E61C-400C-B62C-FA060CF72C29}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.csproj", "{10BA8450-301D-49C7-8E1E-21B7469C225C}" EndProject diff --git a/MP.Stats/Pages/Controlli.razor b/MP.Stats/Pages/Controlli.razor index 0c0fb7b2..d05728d7 100644 --- a/MP.Stats/Pages/Controlli.razor +++ b/MP.Stats/Pages/Controlli.razor @@ -4,12 +4,56 @@ @using MP.Stats.Data
-
Controlli
+
Scarti
- elenco controlli + @if (currRecord != null) + { + @**@ + } + @if (ListRecords == null) + { +

Loading...

+ } + else + { + + + + @**@ + + + + + + + + + + + @foreach (var record in ListRecords) + { + + @**@ + + + + + + + + + } + +
MacchinaDataODL/CommessaArticoloDescrizioneQtaOperatore
 @record.IdxMacchina@record.DataOra@record.IdxOdl | @record.KeyRichiesta@record.CodArticolo@record.Descrizione@record.CodArticolo@record.MatrOpr
+ }
-
- -@code { - -} \ No newline at end of file + + \ No newline at end of file diff --git a/MP.Stats/Pages/Controlli.razor.cs b/MP.Stats/Pages/Controlli.razor.cs new file mode 100644 index 00000000..951382ea --- /dev/null +++ b/MP.Stats/Pages/Controlli.razor.cs @@ -0,0 +1,147 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP.Stats.Data; +using System; +using System.Threading.Tasks; + +namespace MP.Stats.Pages +{ + public partial class Controlli : ComponentBase, IDisposable + { + #region Private Fields + + private MP.Data.DatabaseModels.ResScarti currRecord = null; + + private MP.Data.DatabaseModels.ResScarti[] ListRecords; + + #endregion Private Fields + + #region Private Properties + + private int numRecord { get; set; } = 10; + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected MessageService MessageService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + [Inject] + protected MpStatsService StatService { get; set; } + + #endregion Protected Properties + + #region Protected Methods + + protected async Task ForceReload(int newNum) + { + numRecord = newNum; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + protected override async Task OnInitializedAsync() + { + numRecord = 10; + MessageService.ShowSearch = true; + MessageService.EA_SearchUpdated += OnSeachUpdated; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + protected void ResetData() + { + StatService.rollBackEdit(currRecord); + currRecord = null; + } + + protected async Task UpdateData() + { + currRecord = null; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(DateTime DataOra, string IdxMacchina, string Causale) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.DataOra == DataOra && currRecord.IdxMacchina == IdxMacchina && currRecord.Causale == Causale) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + MessageService.EA_SearchUpdated -= OnSeachUpdated; + } + + public void OnSeachUpdated() + { + InvokeAsync(() => + { + UpdateData(); + StateHasChanged(); + }); + } + + #endregion Public Methods + +#if false + [Inject] + protected BBM_SelectData SelectData { get; set; } + + protected void CreateNew() + { + // recupero counter + string newCode = BBMService.CounterGetNext("EGW.B", 6); + DatabaseModels.BasketsModel newRecord = new DatabaseModels.BasketsModel() + { + CodBasket = newCode, + DataIns = DateTime.Now, + CustomerId = 1, + Descript = "New Basket" + }; + currBasket = newRecord; + } + + protected async Task Delete(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il Basket '{currRecord.CodBasket}'?")) + return; + + BBMService.BasketsDelete(currRecord); + await UpdateData(); + } + + protected void Edit(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + currBasket = currRecord; + } + + protected void ShowDocs(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + // salvo + SelectData.BasketId = currRecord.BasketId; + SelectData.NegotiationId = 0; + // rimando... + NavManager.NavigateTo("docs"); + } + +#endif + } +} \ No newline at end of file diff --git a/MP.Stats/Pages/UserLog.razor b/MP.Stats/Pages/UserLog.razor new file mode 100644 index 00000000..31097de1 --- /dev/null +++ b/MP.Stats/Pages/UserLog.razor @@ -0,0 +1,59 @@ +@page "/userlog" + +@using MP.Stats.Components +@using MP.Stats.Data + +
+
Scarti
+
+ @if (currRecord != null) + { + @**@ + } + @if (ListRecords == null) + { +

Loading...

+ } + else + { + + + + @**@ + + + + + + + + + + + @foreach (var record in ListRecords) + { + + @**@ + + + + + + + + + } + +
MacchinaDataODL/CommessaArticoloDescrizioneQtaOperatore
 @record.IdxMacchina@record.DataOra@record.IdxOdl | @record.KeyRichiesta@record.CodArticolo@record.Descrizione@record.CodArticolo@record.MatrOpr
+ } +
+ +
\ No newline at end of file diff --git a/MP.Stats/Pages/UserLog.razor.cs b/MP.Stats/Pages/UserLog.razor.cs new file mode 100644 index 00000000..963b85a7 --- /dev/null +++ b/MP.Stats/Pages/UserLog.razor.cs @@ -0,0 +1,147 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP.Stats.Data; +using System; +using System.Threading.Tasks; + +namespace MP.Stats.Pages +{ + public partial class UserLog : ComponentBase, IDisposable + { + #region Private Fields + + private MP.Data.DatabaseModels.ResScarti currRecord = null; + + private MP.Data.DatabaseModels.ResScarti[] ListRecords; + + #endregion Private Fields + + #region Private Properties + + private int numRecord { get; set; } = 10; + + #endregion Private Properties + + #region Protected Properties + + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected MessageService MessageService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + [Inject] + protected MpStatsService StatService { get; set; } + + #endregion Protected Properties + + #region Protected Methods + + protected async Task ForceReload(int newNum) + { + numRecord = newNum; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + protected override async Task OnInitializedAsync() + { + numRecord = 10; + MessageService.ShowSearch = true; + MessageService.EA_SearchUpdated += OnSeachUpdated; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + protected void ResetData() + { + StatService.rollBackEdit(currRecord); + currRecord = null; + } + + protected async Task UpdateData() + { + currRecord = null; + ListRecords = await StatService.ScartiGetAll(numRecord, MessageService.SearchVal); + } + + #endregion Protected Methods + + #region Public Methods + + public string checkSelect(DateTime DataOra, string IdxMacchina, string Causale) + { + string answ = ""; + if (currRecord != null) + { + try + { + answ = (currRecord.DataOra == DataOra && currRecord.IdxMacchina == IdxMacchina && currRecord.Causale == Causale) ? "table-info" : ""; + } + catch + { } + } + return answ; + } + + public void Dispose() + { + MessageService.EA_SearchUpdated -= OnSeachUpdated; + } + + public void OnSeachUpdated() + { + InvokeAsync(() => + { + UpdateData(); + StateHasChanged(); + }); + } + + #endregion Public Methods + +#if false + [Inject] + protected BBM_SelectData SelectData { get; set; } + + protected void CreateNew() + { + // recupero counter + string newCode = BBMService.CounterGetNext("EGW.B", 6); + DatabaseModels.BasketsModel newRecord = new DatabaseModels.BasketsModel() + { + CodBasket = newCode, + DataIns = DateTime.Now, + CustomerId = 1, + Descript = "New Basket" + }; + currBasket = newRecord; + } + + protected async Task Delete(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il Basket '{currRecord.CodBasket}'?")) + return; + + BBMService.BasketsDelete(currRecord); + await UpdateData(); + } + + protected void Edit(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + currBasket = currRecord; + } + + protected void ShowDocs(SHERPA.BBM.DatabaseModels.BasketsModel currRecord) + { + // salvo + SelectData.BasketId = currRecord.BasketId; + SelectData.NegotiationId = 0; + // rimando... + NavManager.NavigateTo("docs"); + } + +#endif + } +} \ No newline at end of file