diff --git a/MP-TAB-SERV/Components/LongStopList.razor b/MP-TAB-SERV/Components/LongStopList.razor index c4214cf9..c1566122 100644 --- a/MP-TAB-SERV/Components/LongStopList.razor +++ b/MP-TAB-SERV/Components/LongStopList.razor @@ -2,6 +2,7 @@ {
+
@@ -52,49 +53,15 @@
}
-
- @if (currNotes.Count > 0) - { - @*
-
-

- -

-
-
- @foreach (var note in currNotes) - { -
- - @note.Value - -
- } -
-
-
-
*@ - } - else - { - @*
-
- @($"{currNotes.Count} commenti") -
-
*@ - } -
-
+
@if (showComments) {
@foreach (var note in currNotes) {
- + @note.Value
diff --git a/MP-TAB-SERV/Components/LongStopList.razor.cs b/MP-TAB-SERV/Components/LongStopList.razor.cs index b26b7eaa..589f6d9b 100644 --- a/MP-TAB-SERV/Components/LongStopList.razor.cs +++ b/MP-TAB-SERV/Components/LongStopList.razor.cs @@ -17,6 +17,8 @@ namespace MP_TAB_SERV.Components public List currNotes { get; set; } = new List(); [Parameter] public EventCallback E_relData { get; set; } + [Parameter] + public EventCallback E_setComm { get; set; } #endregion Public Properties @@ -120,6 +122,10 @@ namespace MP_TAB_SERV.Components } } + protected async Task doSet2Edit(CommentiModel currNote) + { + await E_setComm.InvokeAsync(currNote); + } #endregion Private Methods } diff --git a/MP-TAB-SERV/Components/NotesEditor.razor.cs b/MP-TAB-SERV/Components/NotesEditor.razor.cs index 30135b33..1b6771e1 100644 --- a/MP-TAB-SERV/Components/NotesEditor.razor.cs +++ b/MP-TAB-SERV/Components/NotesEditor.razor.cs @@ -29,6 +29,19 @@ namespace MP_TAB_SERV.Components [Parameter] public bool CanSave { get; set; } = false; + [Parameter] + public CommentiModel? CurrComm + { + set + { + if (value != null) + { + DateSel = value.InizioStato; + UserComment = value.Value; + ShowBtn = false; + } + } + } [Parameter] public EventCallback E_CommRec { get; set; } diff --git a/MP-TAB-SERV/Components/NotesMan.razor b/MP-TAB-SERV/Components/NotesMan.razor index fd43198b..8d43a10c 100644 --- a/MP-TAB-SERV/Components/NotesMan.razor +++ b/MP-TAB-SERV/Components/NotesMan.razor @@ -1,5 +1,5 @@  - +
@@ -45,7 +45,7 @@
@foreach (var item in RecordListFull) { - + }
diff --git a/MP-TAB-SERV/Components/NotesMan.razor.cs b/MP-TAB-SERV/Components/NotesMan.razor.cs index 891ee70c..da0df09a 100644 --- a/MP-TAB-SERV/Components/NotesMan.razor.cs +++ b/MP-TAB-SERV/Components/NotesMan.razor.cs @@ -3,6 +3,7 @@ using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.Data.DTO; using MP.Data.Services; +using NLog.LayoutRenderers.Wrappers; namespace MP_TAB_SERV.Components { @@ -94,6 +95,17 @@ namespace MP_TAB_SERV.Components } } + protected CommentiModel? currComm { get; set; } = null; + + protected async Task setCurrComm(CommentiModel _CurrComm) + { + await Task.Delay(1); + if(_CurrComm != null) + { + currComm = _CurrComm; + } + } + protected async Task EditRec(CommentiModel currRec) { await Task.Delay(1);