Fix warnings (rimossi in blocco) + fix live parametri

This commit is contained in:
Samuele Locatelli
2022-11-03 12:16:29 +01:00
parent 1bf5cfc0be
commit 788bd6d730
23 changed files with 113 additions and 92 deletions
+4
View File
@@ -0,0 +1,4 @@
[*.cs]
# CS8765: Nullability of type of parameter doesn't match overridden member (possibly because of nullability attributes).
dotnet_diagnostic.CS8765.severity = none
+5
View File
@@ -7,6 +7,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.Data", "MP.Data\MP.Data.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MP.SPEC", "MP.SPEC\MP.SPEC.csproj", "{C777A098-6F91-45AF-A85E-0AD08CBCAC52}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1B6A7550-F6C9-468E-B3B4-C30FF6FE8933}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+4
View File
@@ -11,6 +11,10 @@
<Compile Remove="DatabaseModels\TurniParetoOdl.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
+1 -1
View File
@@ -69,7 +69,7 @@ namespace MP.Data
private bool enableLog = false;
private IConnectionMultiplexer redis;
private IDatabase? redisDb;
private IDatabase redisDb;
#endregion Private Fields
+4 -5
View File
@@ -26,13 +26,12 @@ namespace MP.SPEC.Components.Chart
public ChartType Type { get; set; }
[Parameter]
public double[] Data { get; set; }
public double[] Data { get; set; } = null!;
[Parameter]
public List<DoughnutStyling> BackgroundColor { get; set; } = null!;
[Parameter]
public List<DoughnutStyling> BackgroundColor { get; set; }
[Parameter]
public string[] Labels { get; set; }
public string[] Labels { get; set; } = null!;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
+2 -1
View File
@@ -39,7 +39,8 @@ namespace MP.SPEC.Components
protected override void OnInitialized()
{
version = typeof(Program).Assembly.GetName().Version;
var rawVers = typeof(Program).Assembly.GetName().Version; ;
version = rawVers != null ? rawVers : new Version("0.0.0.0");
}
#endregion Protected Methods
+1 -1
View File
@@ -11,7 +11,7 @@
<i class="fas fa-user-alt"></i> <b>@userName</b>
</div>
<div class="pe-2">
<button class="btn btn-primary" @onclick="() => flushCache()"> Flush Cache </button>
<button class="btn btn-primary" @onclick="() => flushCache()" title="Forza Refresh Dati correnti"> Force Reload </button>
</div>
@* <div class="px-2 flex-grow-1 text-end">
<span class="text-secondary">@TipoSearch</span>
+2 -2
View File
@@ -78,9 +78,9 @@ namespace MP.SPEC.Components
#region Public Methods
public async Task resetCurrPage()
public void resetCurrPage()
{
await Task.Delay(1);
//await Task.Delay(1);
currPage = 1;
}
+4 -2
View File
@@ -127,7 +127,10 @@ namespace MP.SPEC.Components
currFluxLogDto = null;
isEditing = false;
await Task.Delay(1);
listaFlux = MDService.getFluxLog(currRecord.Valore);
if (currRecord != null)
{
listaFlux = MDService.getFluxLog(currRecord.Valore);
}
StateHasChanged();
}
}
@@ -215,7 +218,6 @@ namespace MP.SPEC.Components
private Dossiers? currRecord = null;
private FluxLogDTO? currRecordFlux;
private List<Dossiers>? ListRecords;
private List<ListValues>? ListStati;
+1 -1
View File
@@ -274,7 +274,7 @@ namespace MP.SPEC.Components
{
get
{
List<StatODLModel> answ = new List<StatODLModel>();
List<StatODLModel>? answ = new List<StatODLModel>();
if (hideSpenta)
{
answ = ListOdlStatsNetto;
+1 -1
View File
@@ -136,7 +136,7 @@ namespace MP.SPEC.Components
#region Protected Methods
protected override async Task OnInitializedAsync()
protected override void OnInitialized()
{
StartTimer();
}
+4 -4
View File
@@ -4,13 +4,13 @@
{
#region Public Events
public event Action EA_PageUpdated;
public event Action EA_PageUpdated = null!;
public event Action EA_SearchUpdated;
public event Action EA_SearchUpdated = null!;
public event Action EA_ShowSearch;
public event Action EA_ShowSearch = null!;
public event Action EA_StatoSearch;
public event Action EA_StatoSearch = null!;
#endregion Public Events
+3 -3
View File
@@ -171,7 +171,7 @@ namespace MP.SPEC.Data
/// <returns></returns>
public async Task<List<AnagArticoli>> ArticoliGetSearch(int numRecord, string azienda, string searchVal)
{
List<AnagArticoli> result = new List<AnagArticoli>();
List<AnagArticoli>? result = new List<AnagArticoli>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
@@ -238,7 +238,7 @@ namespace MP.SPEC.Data
{
// cerco in cache se ci sia la tabella con gli articoli impiegati...
string rawTable = redisDb.StringGet(redKeyTabCheckArt);
List<string> artList = new List<string>();
List<string>? artList = new List<string>();
if (!string.IsNullOrEmpty(rawTable))
{
artList = JsonConvert.DeserializeObject<List<string>>(rawTable);
@@ -763,7 +763,7 @@ namespace MP.SPEC.Data
/// <returns></returns>
public List<string> OdlGetCurrent()
{
List<string> dbResult = new List<string>();
List<string>? dbResult = new List<string>();
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
string readType = "DB";
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2211.311</Version>
<Version>6.16.2211.312</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -58,7 +58,7 @@ namespace MP.SPEC.Pages
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager { get; set; }
protected NavigationManager NavManager { get; set; } = null!;
protected int totalCount
{
+51 -56
View File
@@ -1,7 +1,6 @@
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.Data.DTO;
using MP.SPEC.Components;
using MP.SPEC.Data;
@@ -11,7 +10,7 @@ namespace MP.SPEC.Pages
{
#region Protected Fields
protected DataPager pagerODL = null!;
protected DataPager? pagerODL = null!;
#endregion Protected Fields
@@ -23,7 +22,6 @@ namespace MP.SPEC.Pages
[Inject]
protected MpDataService MDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
@@ -58,6 +56,56 @@ namespace MP.SPEC.Pages
await Task.Delay(1);
}
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Protected Methods
#region Private Properties
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage
{
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private Dossiers? currRecordDoss { get; set; } = null;
private bool isEditing
{
get => currFilter.isEditing;
set => currFilter.isEditing = value;
}
private bool isFiltering { get; set; } = false;
private bool isLoading { get; set; } = true;
private int numRecord
{
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private int totalCount
{
get => currFilter.TotCount;
set => currFilter.TotCount = value;
}
#endregion Private Properties
#region Private Methods
private string css()
{
string answ = "";
@@ -77,55 +125,6 @@ namespace MP.SPEC.Pages
isEditing = true;
}
protected void updateTotal(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Protected Methods
#region Private Fields
private FluxLogDTO? _currDetFluxLogRecord = null;
#endregion Private Fields
#region Private Properties
private SelectDossierParams currFilter { get; set; } = new SelectDossierParams();
private int currPage
{
get => currFilter.CurrPage;
set => currFilter.CurrPage = value;
}
private Dossiers? currRecordDoss { get; set; } = null;
private bool isFiltering { get; set; } = false;
private bool isLoading { get; set; } = true;
private int numRecord
{
get => currFilter.NumRec;
set => currFilter.NumRec = value;
}
private bool isEditing
{
get => currFilter.isEditing;
set => currFilter.isEditing = value;
}
private int totalCount
{
get => currFilter.TotCount;
set => currFilter.TotCount = value;
}
#endregion Private Properties
#region Private Methods
private async Task updateFilter(SelectDossierParams newParams)
{
isFiltering = false;
@@ -137,10 +136,6 @@ namespace MP.SPEC.Pages
currFilter = newParams;
isLoading = false;
}
protected void UpdateTotCount(int newTotCount)
{
totalCount = newTotCount;
}
#endregion Private Methods
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace MP.SPEC.Pages
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; }
protected MessageService MessageService { get; set; } = null!;
#endregion Protected Properties
+6 -2
View File
@@ -26,7 +26,7 @@ namespace MP.SPEC.Pages
#region Protected Fields
protected DataPager pagerODL = null!;
protected DataPager? pagerODL = null!;
#endregion Protected Fields
@@ -104,7 +104,11 @@ namespace MP.SPEC.Pages
{
if (doReset)
{
await pagerODL.resetCurrPage();
await Task.Delay(1);
if (pagerODL != null)
{
pagerODL.resetCurrPage();
}
}
}
+7 -2
View File
@@ -9,7 +9,7 @@ namespace MP.SPEC.Pages
{
#region Protected Fields
protected DataPager pagerODL = null!;
protected DataPager? pagerODL = null!;
#endregion Protected Fields
@@ -31,6 +31,7 @@ namespace MP.SPEC.Pages
DateTime adesso = DateTime.Now.AddSeconds(1);
var updFilter = currFilter;
//updFilter.LiveUpdate = (currPage == 1);
updFilter.LiveUpdate = (currFilter.CurrPage == 1);
updFilter.lastUpdate = updFilter.LiveUpdate ? "-" : $"{adesso:yyyy/MM/dd HH:mm:ss}";
// salvo filtro
currFilter = updFilter;
@@ -55,7 +56,11 @@ namespace MP.SPEC.Pages
{
if (doReset)
{
await pagerODL.resetCurrPage();
await Task.Delay(1);
if (pagerODL != null)
{
pagerODL.resetCurrPage();
}
}
}
+7 -5
View File
@@ -87,7 +87,8 @@ namespace MP.SPEC.Pages
{
if (doReset)
{
await pagerODL.resetCurrPage();
await Task.Delay(1);
pagerODL.resetCurrPage();
}
}
@@ -206,16 +207,17 @@ namespace MP.SPEC.Pages
private bool selectFirst(string idxMacchina)
{
string firstMacchina="";
bool ans = false;
bool answ = false;
if (ListMacchine != null)
{
firstMacchina = ListMacchine.Select(x => x.IdxMacchina).FirstOrDefault();
var rawData = ListMacchine.Select(x => x.IdxMacchina).FirstOrDefault();
firstMacchina = rawData != null ? rawData : "";
}
if (firstMacchina == idxMacchina)
{
ans = true;
answ = true;
}
return ans;
return answ;
}
private string btnNewText
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2211.311</h4>
<h4>Versione: 6.16.2211.312</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2211.311
6.16.2211.312
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2211.311</version>
<version>6.16.2211.312</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>