Fix lettura dati da DB x licenza

This commit is contained in:
Samuele Locatelli
2021-12-23 15:07:15 +01:00
parent 985e429d34
commit 2cc8da110d
7 changed files with 26 additions and 10 deletions
+10 -1
View File
@@ -2,18 +2,20 @@
using NLog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MP.AppAuth.Controllers
{
public class MPController
public class MPController : IDisposable
{
#region Private Fields
private static IConfiguration _configuration;
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
public static AppAuth.Controllers.MPController dbController;
#endregion Private Fields
@@ -29,6 +31,12 @@ namespace MP.AppAuth.Controllers
#region Public Methods
public void Dispose()
{
// Clear database controller
dbController.Dispose();
}
/// <summary>
/// Elenco Record x AnagKeyValue
@@ -46,6 +54,7 @@ namespace MP.AppAuth.Controllers
return dbResult;
}
#endregion Public Methods
}
}
+2
View File
@@ -69,6 +69,7 @@ namespace MP.Land.Data
else
{
dbController = new AppAuth.Controllers.AppAuthController(configuration);
MpDbController = new AppAuth.Controllers.MPController(configuration);
_logger.LogInformation("DbController OK");
}
}
@@ -144,6 +145,7 @@ namespace MP.Land.Data
{
// Clear database controller
dbController.Dispose();
MpDbController.Dispose();
}
public string Traduci(string lemma, string lingua = "IT")
+1 -1
View File
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>MP.Land</RootNamespace>
<Version>6.14.2112.2314</Version>
<Version>6.14.2112.2315</Version>
</PropertyGroup>
<ItemGroup>
+10 -5
View File
@@ -128,7 +128,7 @@
</div>
</div>
<div class="card-footer py-1">
<span>Chiave licenza: <b>@masterLic()</b></span>
<span>Chiave licenza: <b>@masterLic</b></span>
</div>
</div>
</div>
@@ -140,18 +140,23 @@
protected string Messaggio = "HW & SW details";
protected HwSwInfo currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
protected async Task<string> masterLic()
protected string masterLic = "";
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task ReloadData()
{
string answ = "-";
var akvList = await DataService.AnagKeyValList();
var licRecord = akvList
.Where(x => x.NomeVar == "MAPO")
.FirstOrDefault();
if (licRecord != null)
{
answ = licRecord.ValString;
masterLic = licRecord.ValString;
}
return answ;
}
protected string DbNameExample
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo gestione Programmi MAPO</i>
<h4>Versione: 6.14.2112.2314</h4>
<h4>Versione: 6.14.2112.2315</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
6.14.2112.2314
6.14.2112.2315
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.14.2112.2314</version>
<version>6.14.2112.2315</version>
<url>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>