Completati test edit/create user task
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.12206.1910</Version>
|
||||
<Version>1.12206.1912</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.12206.1910</h4>
|
||||
<h4>Version: 1.12206.1912</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.12206.1910
|
||||
1.12206.1912
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.12206.1910</version>
|
||||
<version>1.12206.1912</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.12206.1910</Version>
|
||||
<Version>1.12206.1912</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.12206.1910</h4>
|
||||
<h4>Version: 1.12206.1912</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.12206.1910
|
||||
1.12206.1912
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.12206.1910</version>
|
||||
<version>1.12206.1912</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -519,6 +519,8 @@ namespace MP.MONO.Data.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
// se nuovo (user edit) --> NON protetto!
|
||||
editRec.Protected = false;
|
||||
localDbCtx
|
||||
.DbSetPMTask
|
||||
.Add(editRec);
|
||||
@@ -584,9 +586,10 @@ namespace MP.MONO.Data.Controllers
|
||||
{
|
||||
List<PrevMaintTaskModel> missTask = new List<PrevMaintTaskModel>();
|
||||
|
||||
// elenco dei task NON disattivati
|
||||
List<PrevMaintTaskModel>? allTask = localDbCtx
|
||||
.DbSetPMTask
|
||||
.Where(x => x.MachineId == MachineId)
|
||||
.Where(x => x.MachineId == MachineId && !x.IsDisabled)
|
||||
.Include(i => i.CounterNav)
|
||||
.ToList();
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ namespace MP.MONO.Data.DbModels
|
||||
public string CCode { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Indica che il task è protetto, impostato dal costruttore (originale)
|
||||
/// Indica che il task è protetto
|
||||
/// true = impostato dal costruttore (originale)
|
||||
/// </summary>
|
||||
public bool Protected { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
@@ -77,7 +79,7 @@ namespace MP.MONO.Data.DbModels
|
||||
[NotMapped]
|
||||
public bool IsValid
|
||||
{
|
||||
get => MachineId > 0 && ExpiryVal >= 1 && ExtIdx != 0 && !string.IsNullOrEmpty(CCode) && !string.IsNullOrEmpty(PMTCode) && !string.IsNullOrEmpty(PMMGCode) && !string.IsNullOrEmpty(JobDescription) && !string.IsNullOrEmpty(PMUTCode);
|
||||
get => MachineId > 0 && ExpiryVal >= 1 && ExtIdx >= 0 && !string.IsNullOrEmpty(CCode) && !string.IsNullOrEmpty(PMTCode) && !string.IsNullOrEmpty(PMMGCode) && !string.IsNullOrEmpty(JobDescription) && !string.IsNullOrEmpty(PMUTCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.12206.1910</Version>
|
||||
<Version>1.12206.1912</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.12206.1910</h4>
|
||||
<h4>Version: 1.12206.1912</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.12206.1910
|
||||
1.12206.1912
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.12206.1910</version>
|
||||
<version>1.12206.1912</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -114,13 +114,17 @@ namespace MP.MONO.UI.Components
|
||||
|
||||
if (_currItem != null)
|
||||
{
|
||||
// aggiorno
|
||||
await DataService.PrevMaintTaskUpdate(_currItem);
|
||||
await DataUpdated.InvokeAsync(0);
|
||||
// update pending...
|
||||
await DataService.SchedMaintTaskCreateMissing(_currItem.MachineId);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Record null!");
|
||||
}
|
||||
// delay x display
|
||||
await DataUpdated.InvokeAsync(0);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
@@ -20,12 +20,28 @@ namespace MP.MONO.UI.Components
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task ResetData()
|
||||
{
|
||||
showAddNew = false;
|
||||
currRec = null;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateActivData()
|
||||
{
|
||||
//int currTaskId = currRec.PMTaskId;
|
||||
await ReloadData();
|
||||
//currRec = ListRecords.Where(x => x.PMTaskId == currTaskId).FirstOrDefault();
|
||||
showAddNew = false;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private int _MaxRecord = 200;
|
||||
|
||||
private PrevMaintTaskModel? currRec = new PrevMaintTaskModel();
|
||||
private bool doSetup = false;
|
||||
|
||||
private List<PrevMaintTaskModel>? ListRecords = null;
|
||||
@@ -43,6 +59,11 @@ namespace MP.MONO.UI.Components
|
||||
|
||||
private int _numRecord { get; set; } = 10;
|
||||
|
||||
private string addNewMessage
|
||||
{
|
||||
get => showAddNew ? "Hide Add New Task" : "Show Add new Task";
|
||||
}
|
||||
|
||||
private int currPage
|
||||
{
|
||||
get => _currPage;
|
||||
@@ -99,6 +120,10 @@ namespace MP.MONO.UI.Components
|
||||
}
|
||||
}
|
||||
|
||||
private PrevMaintTaskModel? selRecord { get; set; } = null;
|
||||
|
||||
private bool showAddNew { get; set; } = false;
|
||||
|
||||
private int totalCount
|
||||
{
|
||||
get
|
||||
@@ -124,121 +149,14 @@ namespace MP.MONO.UI.Components
|
||||
reqChangeMode.InvokeAsync(true);
|
||||
}
|
||||
|
||||
private bool showAddNew { get; set; } = false;
|
||||
|
||||
private PrevMaintTaskModel? currRec = new PrevMaintTaskModel();
|
||||
|
||||
/// <summary>
|
||||
/// Gestione aggiunta nuovo record intervento
|
||||
/// </summary>
|
||||
private void toggleAddNew()
|
||||
{
|
||||
showAddNew = !showAddNew;
|
||||
// se mostro --> creo nuovo record...
|
||||
if (showAddNew)
|
||||
{
|
||||
currRec = new PrevMaintTaskModel();
|
||||
}
|
||||
}
|
||||
|
||||
private string addNewMessage
|
||||
{
|
||||
get => showAddNew ? "Hide Add New Task" : "Show Add new Task";
|
||||
}
|
||||
|
||||
private string cssCheckSel(int PMTaskId)
|
||||
{
|
||||
return PMTaskId == currPMTaskId ? "table-primary" : "";
|
||||
}
|
||||
|
||||
private string cssCheckDisabled(bool isDisabled)
|
||||
{
|
||||
return isDisabled ? "text-decoration-line-through" : "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void ForceReload(int newNum)
|
||||
private string cssCheckSel(int PMTaskId)
|
||||
{
|
||||
numRecord = newNum;
|
||||
}
|
||||
|
||||
private void ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
|
||||
protected async Task ResetData()
|
||||
{
|
||||
showAddNew = false;
|
||||
currRec = null;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected async Task UpdateActivData()
|
||||
{
|
||||
//int currTaskId = currRec.PMTaskId;
|
||||
await ReloadData();
|
||||
//currRec = ListRecords.Where(x => x.PMTaskId == currTaskId).FirstOrDefault();
|
||||
showAddNew = false;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
ListRecords = null;
|
||||
await Task.Delay(1);
|
||||
SearchRecords = await MMDataService.PrevMaintTaskGetFilt(MachineId, 0, MaxRecord);
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
|
||||
private PrevMaintTaskModel? selRecord { get; set; } = null;
|
||||
|
||||
private async Task EditRecord(PrevMaintTaskModel cRec)
|
||||
{
|
||||
currRec = cRec;
|
||||
showAddNew = true;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async Task ShowDetail(PrevMaintTaskModel currRec)
|
||||
{
|
||||
selRecord = currRec;
|
||||
if (currRec != null)
|
||||
{
|
||||
currPMTaskId = currRec.PMTaskId;
|
||||
}
|
||||
else
|
||||
{
|
||||
currPMTaskId = 0;
|
||||
}
|
||||
//await ReloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Riabilita un record disabilitato
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task EnableRecord(PrevMaintTaskModel currRec)
|
||||
{
|
||||
|
||||
string confirmMessage = "Are you sure to re-enable this Task?";
|
||||
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", confirmMessage))
|
||||
return;
|
||||
|
||||
// altrimenti riabilito
|
||||
await MMDataService.PMTaskEnableRecord(currRec);
|
||||
|
||||
await ReloadData();
|
||||
await Task.Delay(1);
|
||||
return PMTaskId == currPMTaskId ? "table-primary" : "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -275,13 +193,89 @@ namespace MP.MONO.UI.Components
|
||||
|
||||
// altrimenti elimino
|
||||
await MMDataService.PMTaskDeleteRecord(currRec, forceDelete);
|
||||
// update pending...
|
||||
await MMDataService.SchedMaintTaskCreateMissing(currRec.MachineId);
|
||||
|
||||
await ReloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async Task EditRecord(PrevMaintTaskModel cRec)
|
||||
{
|
||||
currRec = cRec;
|
||||
showAddNew = true;
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Riabilita un record disabilitato
|
||||
/// </summary>
|
||||
/// <param name="currRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task EnableRecord(PrevMaintTaskModel currRec)
|
||||
{
|
||||
string confirmMessage = "Are you sure to re-enable this Task?";
|
||||
|
||||
if (!await JSRuntime.InvokeAsync<bool>("confirm", confirmMessage))
|
||||
return;
|
||||
|
||||
// altrimenti riabilito
|
||||
await MMDataService.PMTaskEnableRecord(currRec);
|
||||
// update pending...
|
||||
await MMDataService.SchedMaintTaskCreateMissing(currRec.MachineId);
|
||||
|
||||
await ReloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private void ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
}
|
||||
|
||||
private void ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
}
|
||||
|
||||
private async Task ReloadData()
|
||||
{
|
||||
isLoading = true;
|
||||
ListRecords = null;
|
||||
await Task.Delay(1);
|
||||
SearchRecords = await MMDataService.PrevMaintTaskGetFilt(MachineId, 0, MaxRecord);
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
|
||||
await Task.Delay(1);
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task ShowDetail(PrevMaintTaskModel currRec)
|
||||
{
|
||||
selRecord = currRec;
|
||||
if (currRec != null)
|
||||
{
|
||||
currPMTaskId = currRec.PMTaskId;
|
||||
}
|
||||
else
|
||||
{
|
||||
currPMTaskId = 0;
|
||||
}
|
||||
//await ReloadData();
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gestione aggiunta nuovo record intervento
|
||||
/// </summary>
|
||||
private void toggleAddNew()
|
||||
{
|
||||
showAddNew = !showAddNew;
|
||||
// se mostro --> creo nuovo record...
|
||||
if (showAddNew)
|
||||
{
|
||||
currRec = new PrevMaintTaskModel();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Platforms>AnyCPU;x86;x64</Platforms>
|
||||
<Version>1.12206.1911</Version>
|
||||
<Version>1.12206.1912</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>MAPO-MONO</i>
|
||||
<h4>Version: 1.12206.1911</h4>
|
||||
<h4>Version: 1.12206.1912</h4>
|
||||
<br /> Release Note:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.12206.1911
|
||||
1.12206.1912
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.12206.1911</version>
|
||||
<version>1.12206.1912</version>
|
||||
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
|
||||
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
Reference in New Issue
Block a user