Merge branch 'release/InstallRelTrack_01'

This commit is contained in:
Samuele Locatelli
2025-01-11 10:35:10 +01:00
16 changed files with 1051 additions and 97 deletions
@@ -130,6 +130,19 @@ namespace LiMan.APi.Controllers
if (CheckReqKeys(CurrRequest))
{
result = await dataService.ReleaseGetByAppVers(CurrRequest.CodApp, CurrRequest.VersMin);
// registro stato applicativi (da richiesta...)
InstalledReleasesModel checkRec = new InstalledReleasesModel()
{
AppKey = CurrRequest.AppKey,
CodApp = CurrRequest.CodApp,
CodImp = CurrRequest.CodImp,
DtCheck = DateTime.Now,
MastKey = CurrRequest.MastKey,
NumImp = 1,// cablato x ora
VersNum = CurrRequest.VersMin
};
dataService.InstallRelUpsert(checkRec);
// registro infine chiamata
await dataService.recordCall(CurrRequest.CodApp, CurrRequest.CodApp, $"POST:api/release/getfilt/ | {CurrRequest.MastKey} | {CurrRequest.CodImp} | {CurrRequest.CodApp}");
}
return result;
+103 -89
View File
@@ -82,6 +82,15 @@ namespace LiMan.APi.Data
#endregion Public Constructors
#region Public Properties
/// <summary>
/// Wrapper x invio/ricezione messaggi sul canale dedicato agli eventi enroll
/// </summary>
public MessagePipe EnrollMessPipe { get; set; } = null!;
#endregion Public Properties
#region Public Methods
/// <summary> Elenco Applicativi (all) <returns></returns>
@@ -364,7 +373,7 @@ namespace LiMan.APi.Data
TimeSpan ts = sw.Elapsed;
Log.Trace($"Effettuata EnrollReqCreate: {ts.TotalMilliseconds} ms");
// invio string in messagepipe x forzare refresh...
// invio string in messagepipe x forzare refresh...
EnrollMessPipe.sendMessage("NewEnrollReq");
// restituisce record
@@ -390,54 +399,6 @@ namespace LiMan.APi.Data
return fatto;
}
/// <summary>
/// Recupera una richiesta dato suo ID x verificare approvazione e dati associati...
/// </summary>
/// <param name="idReq">ID record</param>
public async Task<EnrollRequestModel> EnrollReqGetById(int idReq)
{
string source = "DB";
EnrollRequestModel dbResult = new EnrollRequestModel() { IdReq = idReq };
try
{
string currKey = $"{Const.rKeyConfig}:Enroll:ById:{idReq}";
Stopwatch sw = new Stopwatch();
sw.Start();
string? rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty(rawData))
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<EnrollRequestModel>(rawData);
if (tempResult == null)
{
dbResult = new EnrollRequestModel() { IdReq = idReq };
}
else
{
dbResult = tempResult;
}
}
else
{
dbResult = dbController.EnrollReqGetById(idReq);
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, FastCache);
}
if (dbResult == null)
{
dbResult = new EnrollRequestModel() { IdReq = idReq };
}
sw.Stop();
TimeSpan ts = sw.Elapsed;
Log.Debug($"EnrollReqGetById | {source} in: {ts.TotalMilliseconds} ms");
}
catch (Exception exc)
{
Log.Error($"Error during EnrollReqGetById:{Environment.NewLine}{exc}");
}
return dbResult;
}
/// <summary>
/// Elenco richeiste enroll attive al momento
/// </summary>
@@ -486,13 +447,61 @@ namespace LiMan.APi.Data
return dbResult;
}
/// <summary>
/// Recupera una richiesta dato suo ID x verificare approvazione e dati associati...
/// </summary>
/// <param name="idReq">ID record</param>
public async Task<EnrollRequestModel> EnrollReqGetById(int idReq)
{
string source = "DB";
EnrollRequestModel dbResult = new EnrollRequestModel() { IdReq = idReq };
try
{
string currKey = $"{Const.rKeyConfig}:Enroll:ById:{idReq}";
Stopwatch sw = new Stopwatch();
sw.Start();
string? rawData = await redisDb.StringGetAsync(currKey);
if (!string.IsNullOrEmpty(rawData))
{
source = "REDIS";
var tempResult = JsonConvert.DeserializeObject<EnrollRequestModel>(rawData);
if (tempResult == null)
{
dbResult = new EnrollRequestModel() { IdReq = idReq };
}
else
{
dbResult = tempResult;
}
}
else
{
dbResult = dbController.EnrollReqGetById(idReq);
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
await redisDb.StringSetAsync(currKey, rawData, FastCache);
}
if (dbResult == null)
{
dbResult = new EnrollRequestModel() { IdReq = idReq };
}
sw.Stop();
TimeSpan ts = sw.Elapsed;
Log.Debug($"EnrollReqGetById | {source} in: {ts.TotalMilliseconds} ms");
}
catch (Exception exc)
{
Log.Error($"Error during EnrollReqGetById:{Environment.NewLine}{exc}");
}
return dbResult;
}
/// <summary>
/// Elimino eventuali richieste non approvate e scadute
/// </summary>
public async Task<bool> EnrollReqPurgeInvalid()
{
var reqPurged = dbController.EnrollReqPurgeInvalid();
// invio string in messagepipe x forzare refresh...
// invio string in messagepipe x forzare refresh...
EnrollMessPipe.sendMessage("NewEnrollReq");
// svuota eventuale cache redis...
await FlushRedisCachePattern("Enroll");
@@ -517,7 +526,7 @@ namespace LiMan.APi.Data
sw.Stop();
TimeSpan ts = sw.Elapsed;
Log.Trace($"Effettuata EnrollReqUpsert: {ts.TotalMilliseconds} ms");
// invio string in messagepipe x forzare refresh...
// invio string in messagepipe x forzare refresh...
EnrollMessPipe.sendMessage("NewEnrollReq");
// restituisce risultato
return dbResult;
@@ -562,11 +571,6 @@ namespace LiMan.APi.Data
return await Task.FromResult(dbResult);
}
/// <summary>
/// Wrapper x invio/ricezione messaggi sul canale dedicato agli eventi enroll
/// </summary>
public MessagePipe EnrollMessPipe { get; set; } = null!;
/// <summary>
/// Refresh globale cache Redis
/// </summary>
@@ -600,6 +604,16 @@ namespace LiMan.APi.Data
return answ;
}
/// <summary>
/// Registro su DB il record della licenza attuale relativo alla richiesta di verifica licenza ricevuta
/// </summary>
/// <param name="upRec">record da inserire/aggiornare</param>
public bool InstallRelUpsert(InstalledReleasesModel upRec)
{
bool fatto = dbController.InstallRelUpsert(upRec);
return fatto;
}
/// <summary>
/// invalida tutta la cache in caso di update
/// </summary>
@@ -613,39 +627,6 @@ namespace LiMan.APi.Data
cachedDataList = new List<string>();
}
/// <summary>
/// Record licenza data masterKey
/// </summary>
/// <param name="chiave">Chiave Licenza x ricerca</param>
/// <returns></returns>
public async Task<LicenzaModel> LicenzaByMasterKey(string chiave)
{
LicenzaModel dbResult = new LicenzaModel();
string cacheKey = $"{rKeyLicByMKey}:{chiave}";
trackCache(cacheKey);
string rawData = await getRSV(cacheKey);
if (!string.IsNullOrEmpty(rawData))
{
dbResult = JsonConvert.DeserializeObject<LicenzaModel>(rawData);
}
else
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.LicenzaByKey(chiave);
if (dbResult != null)
{
rawData = JsonConvert.SerializeObject(dbResult);
await setRSV(cacheKey, rawData, hourTTL);
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per LicenzaByMasterKey: {ts.TotalMilliseconds} ms");
}
return await Task.FromResult(dbResult);
}
/// <summary>
/// Elenco licenze dato ID
/// </summary>
@@ -679,6 +660,39 @@ namespace LiMan.APi.Data
return dbResult;
}
/// <summary>
/// Record licenza data masterKey
/// </summary>
/// <param name="chiave">Chiave Licenza x ricerca</param>
/// <returns></returns>
public async Task<LicenzaModel> LicenzaByMasterKey(string chiave)
{
LicenzaModel dbResult = new LicenzaModel();
string cacheKey = $"{rKeyLicByMKey}:{chiave}";
trackCache(cacheKey);
string rawData = await getRSV(cacheKey);
if (!string.IsNullOrEmpty(rawData))
{
dbResult = JsonConvert.DeserializeObject<LicenzaModel>(rawData);
}
else
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
dbResult = dbController.LicenzaByKey(chiave);
if (dbResult != null)
{
rawData = JsonConvert.SerializeObject(dbResult);
await setRSV(cacheKey, rawData, hourTTL);
}
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
Log.Trace($"Effettuata lettura da DB per LicenzaByMasterKey: {ts.TotalMilliseconds} ms");
}
return await Task.FromResult(dbResult);
}
/// <summary>
/// Effettua refresh del payload della licenza dato info + enigma generato dal client
/// </summary>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 2.1.2501.0919</h4>
<h4>Versione: 2.1.2501.1110</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
2.1.2501.0919
2.1.2501.1110
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>2.1.2501.0919</version>
<version>2.1.2501.1110</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+66
View File
@@ -1399,6 +1399,72 @@ namespace LiMan.DB.Controllers
return dbResult;
}
/// <summary>
/// Update/insert record registrazione InstalledRelease applicativo
/// </summary>
/// <param name="upRec"></param>
/// <returns></returns>
public bool InstallRelUpsert(InstalledReleasesModel upRec)
{
bool fatto = false;
using (LMDbContext localDbCtx = new LMDbContext(_configuration))
{
// cerco record esistente...
var currRec = localDbCtx
.DbSetInstallRel
.Where(x => x.CodApp == upRec.CodApp && x.CodImp == upRec.CodImp && x.AppKey == upRec.AppKey)
.FirstOrDefault();
if (currRec != null)
{
// se idxSubLic mancante cerco...
if (currRec.IdxSubLic == 0)
{
// cerco idxSublic da info...
var recIst = localDbCtx
.DbSetSubLicenze
.FirstOrDefault(x => x.Chiave == upRec.AppKey && x.CodImpiego == upRec.CodImp);
if (recIst != null)
{
upRec.IdxSubLic = recIst.IdxSubLic;
}
}
// se trovo aggiorno...
currRec.DtCheck = upRec.DtCheck;
currRec.IdxSubLic = upRec.IdxSubLic;
currRec.MastKey = upRec.MastKey;
currRec.NumImp = upRec.NumImp;
currRec.VersNum = upRec.VersNum;
}
else
{
// cerco idxSublic da info...
var recIst = localDbCtx
.DbSetSubLicenze
.FirstOrDefault(x => x.Chiave == upRec.AppKey && x.CodImpiego == upRec.CodImp);
if (recIst != null)
{
upRec.IdxSubLic = recIst.IdxSubLic;
}
// altrimenti aggiungo...
localDbCtx
.DbSetInstallRel
.Add(upRec);
}
// salvataggio!
try
{
// salvo
var res = localDbCtx.SaveChanges();
fatto = res != 0;
}
catch (Exception ex)
{
Log.Error($"Eccezoine in InstallRelUpsert{Environment.NewLine}{ex}");
}
}
return fatto;
}
/// <summary>
/// Effettua refresh del payload della licenza dato info + enigma generato dal client
/// </summary>
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LiMan.DB.DBModels
{
[Table("InstalledReleases")]
public partial class InstalledReleasesModel
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxInstall { get; set; }
/// <summary>
/// CodApp Richiesta
/// </summary>
[MaxLength(50)]
public string CodApp { get; set; } = "";
/// <summary>
/// Master Key
/// </summary>
[MaxLength(500)]
public string MastKey { get; set; } = "";
/// <summary>
/// Codice Impiego Istanza (SubLic)
/// </summary>
[MaxLength(500)]
public string CodImp { get; set; } = "";
/// <summary>
/// Chiave SubLic
/// </summary>
[MaxLength(500)]
public string AppKey { get; set; } = "";
/// <summary>
/// Versione applicativo formato semver numerico 4 blocchi
/// </summary>
[MaxLength(50)]
public string VersNum { get; set; } = "0.0.0.0";
/// <summary>
/// Numero impieghi dell'applicativo (es per MAPO IOB-WIN il num di iOB usati con uno specifico SW)
/// </summary>
public int NumImp { get; set; } = 1;
/// <summary>
/// Data di ultima verifica versione
/// </summary>
public DateTime DtCheck { get; set; } = DateTime.Today.AddYears(-1);
/// <summary>
/// Istanza (SubLic) associata
/// </summary>
public int IdxSubLic { get; set; } = 0;
/// <summary>
/// Versione (calcolata) a partire dal valore Num
/// </summary>
[NotMapped]
public Version VersVal
{
get
{
Version answ = new Version();
try
{
// solo se è una versione valida: SemVer = 2/3 punti
int numPunti = VersNum.Length - VersNum.Replace(".", "").Length;
if (numPunti >= 2 && numPunti <= 3)
{
answ = !string.IsNullOrEmpty(VersNum) ? new Version(VersNum) : new Version();
}
}
catch { }
return answ;
}
}
[ForeignKey("CodApp")]
public virtual ApplicativoModel ApplicativoNav { get; set; }
[ForeignKey("IdxSubLic")]
public virtual LicenzaModel IstanzaNav { get; set; }
}
}
+1
View File
@@ -62,6 +62,7 @@ namespace LiMan.DB
public virtual DbSet<AuthClaimModel> DbSetClaims { get; set; }
public virtual DbSet<ReleaseModel> DbSetReleases { get; set; }
public virtual DbSet<EnrollRequestModel> DbSetEnrollReq { get; set; }
public virtual DbSet<InstalledReleasesModel> DbSetInstallRel { get; set; }
#endregion Public Properties
@@ -0,0 +1,646 @@
// <auto-generated />
using System;
using LiMan.DB;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace LiMan.DB.Migrations
{
[DbContext(typeof(LMDbContext))]
[Migration("20250111091225_AddInstalledRelTrack_01")]
partial class AddInstalledRelTrack_01
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.UseCollation("SQL_Latin1_General_CP1_CI_AS")
.HasAnnotation("ProductVersion", "6.0.28")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("LiMan.DB.DBModels.ApplicativoModel", b =>
{
b.Property<string>("CodApp")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Descrizione")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Tipo")
.HasColumnType("nvarchar(max)");
b.Property<string>("TplConnString")
.HasMaxLength(2500)
.HasColumnType("nvarchar(2500)");
b.HasKey("CodApp");
b.ToTable("Applicativi");
});
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
{
b.Property<int>("ClaimID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ClaimID"), 1L, 1);
b.Property<DateTime>("DtIns")
.HasColumnType("datetime2");
b.Property<DateTime>("DtMod")
.HasColumnType("datetime2");
b.Property<int>("RoleID")
.HasColumnType("int");
b.Property<int>("UserID")
.HasColumnType("int");
b.HasKey("ClaimID");
b.HasIndex("RoleID");
b.HasIndex("UserID");
b.ToTable("AuthClaims");
});
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
{
b.Property<int>("RoleID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("RoleID"), 1L, 1);
b.Property<string>("Descrizione")
.HasColumnType("nvarchar(max)");
b.Property<string>("Ruolo")
.HasColumnType("nvarchar(max)");
b.HasKey("RoleID");
b.ToTable("AuthRoles");
});
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
{
b.Property<int>("UserID")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("UserID"), 1L, 1);
b.Property<string>("AD_Domain")
.HasColumnType("nvarchar(max)");
b.Property<string>("AD_User")
.HasColumnType("nvarchar(max)");
b.Property<string>("Cognome")
.HasColumnType("nvarchar(max)");
b.Property<string>("Nome")
.HasColumnType("nvarchar(max)");
b.Property<string>("Username")
.HasColumnType("nvarchar(max)");
b.HasKey("UserID");
b.ToTable("AuthUsers");
});
modelBuilder.Entity("LiMan.DB.DBModels.EnrollRequestModel", b =>
{
b.Property<int>("IdReq")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdReq"), 1L, 1);
b.Property<DateTime?>("DtAppr")
.HasColumnType("datetime2");
b.Property<DateTime>("DtReq")
.HasColumnType("datetime2");
b.Property<int>("IdxLic")
.HasColumnType("int");
b.Property<int>("Passcode")
.HasColumnType("int");
b.Property<string>("ReqPayload")
.HasColumnType("nvarchar(max)");
b.Property<string>("UserAppr")
.HasColumnType("nvarchar(max)");
b.HasKey("IdReq");
b.ToTable("EnrollRequest");
});
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
{
b.Property<int>("IdxFileAttach")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxFileAttach"), 1L, 1);
b.Property<DateTime>("DtEvent")
.HasColumnType("datetime2");
b.Property<string>("FullStoragePath")
.HasColumnType("nvarchar(max)");
b.Property<int>("IdxTicket")
.HasColumnType("int");
b.Property<string>("OriginalName")
.HasColumnType("nvarchar(max)");
b.Property<string>("StorageName")
.HasColumnType("nvarchar(max)");
b.HasKey("IdxFileAttach");
b.HasIndex("IdxTicket");
b.ToTable("FileAttach");
});
modelBuilder.Entity("LiMan.DB.DBModels.InstallazioneModel", b =>
{
b.Property<string>("CodInst")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Cliente")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Contatto")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Descrizione")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.Property<string>("Email")
.HasMaxLength(250)
.HasColumnType("nvarchar(250)");
b.HasKey("CodInst");
b.ToTable("Installazioni");
});
modelBuilder.Entity("LiMan.DB.DBModels.InstalledReleasesModel", b =>
{
b.Property<int>("IdxInstall")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxInstall"), 1L, 1);
b.Property<string>("AppKey")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("CodApp")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("CodImp")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<DateTime>("DtCheck")
.HasColumnType("datetime2");
b.Property<int>("IdxSubLic")
.HasColumnType("int");
b.Property<string>("MastKey")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<int>("NumImp")
.HasColumnType("int");
b.Property<string>("VersNum")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("IdxInstall");
b.HasIndex("CodApp");
b.HasIndex("IdxSubLic");
b.ToTable("InstalledReleases");
});
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
{
b.Property<int>("IdxLic")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLic"), 1L, 1);
b.Property<string>("Chiave")
.HasColumnType("nvarchar(max)");
b.Property<string>("CodApp")
.HasColumnType("nvarchar(50)");
b.Property<string>("CodInst")
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("DataEnigma")
.HasColumnType("datetime2");
b.Property<string>("Descrizione")
.HasColumnType("nvarchar(max)");
b.Property<string>("Enigma")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Locked")
.HasColumnType("bit");
b.Property<int>("NumLicenze")
.HasColumnType("int");
b.Property<string>("Payload")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime2");
b.Property<int>("Tipo")
.HasColumnType("int");
b.HasKey("IdxLic");
b.HasIndex("CodApp");
b.HasIndex("CodInst");
b.ToTable("Licenze");
});
modelBuilder.Entity("LiMan.DB.DBModels.LogCallModel", b =>
{
b.Property<DateTime>("DataRif")
.HasColumnType("datetime2");
b.Property<string>("CodInst")
.HasColumnType("nvarchar(450)");
b.Property<string>("CodApp")
.HasColumnType("nvarchar(450)");
b.Property<string>("TargetUrl")
.HasColumnType("nvarchar(450)");
b.Property<int>("NumCall")
.HasColumnType("int");
b.HasKey("DataRif", "CodInst", "CodApp", "TargetUrl");
b.ToTable("LogCall");
});
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
{
b.Property<int>("IdxLogLic")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxLogLic"), 1L, 1);
b.Property<string>("Chiave")
.HasColumnType("nvarchar(max)");
b.Property<string>("CodApp")
.HasColumnType("nvarchar(50)");
b.Property<string>("CodInst")
.HasColumnType("nvarchar(50)");
b.Property<string>("Descrizione")
.HasColumnType("nvarchar(max)");
b.Property<int>("IdxLic")
.HasColumnType("int");
b.Property<int>("NumLicenze")
.HasColumnType("int");
b.Property<DateTime>("Scadenza")
.HasColumnType("datetime2");
b.Property<int>("Tipo")
.HasColumnType("int");
b.HasKey("IdxLogLic");
b.HasIndex("CodApp");
b.HasIndex("CodInst");
b.HasIndex("IdxLic");
b.ToTable("LogLicenze");
});
modelBuilder.Entity("LiMan.DB.DBModels.ReleaseModel", b =>
{
b.Property<int>("IdxRel")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxRel"), 1L, 1);
b.Property<string>("CodApp")
.HasColumnType("nvarchar(50)");
b.Property<string>("RelTags")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("ReleaseDate")
.HasColumnType("datetime2");
b.Property<string>("VersNum")
.HasColumnType("nvarchar(max)");
b.Property<string>("VersText")
.HasColumnType("nvarchar(max)");
b.HasKey("IdxRel");
b.HasIndex("CodApp");
b.ToTable("Releases");
});
modelBuilder.Entity("LiMan.DB.DBModels.StatsCallModel", b =>
{
b.Property<int>("YearRef")
.HasColumnType("int");
b.Property<string>("CodInst")
.HasColumnType("nvarchar(450)");
b.Property<string>("CodApp")
.HasColumnType("nvarchar(450)");
b.Property<int>("TotCall")
.HasColumnType("int");
b.HasKey("YearRef", "CodInst", "CodApp");
b.ToView("v_StatsCall");
});
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
{
b.Property<int>("IdxSubLic")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxSubLic"), 1L, 1);
b.Property<string>("Chiave")
.HasColumnType("nvarchar(max)");
b.Property<string>("CodImpiego")
.HasColumnType("nvarchar(max)");
b.Property<int>("IdxLic")
.HasColumnType("int");
b.Property<int>("Tipo")
.HasColumnType("int");
b.Property<DateTime>("VetoUnlock")
.HasColumnType("datetime2");
b.HasKey("IdxSubLic");
b.HasIndex("IdxLic");
b.ToTable("SubLicenze");
});
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
{
b.Property<int>("IdxTicket")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxTicket"), 1L, 1);
b.Property<string>("CodImpiego")
.HasColumnType("nvarchar(max)");
b.Property<string>("ContactEmail")
.HasColumnType("nvarchar(max)");
b.Property<string>("ContactName")
.HasColumnType("nvarchar(max)");
b.Property<string>("ContactPhone")
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DtReq")
.HasColumnType("datetime2");
b.Property<int>("IdxLic")
.HasColumnType("int");
b.Property<int>("IdxSubLic")
.HasColumnType("int");
b.Property<string>("ReqBody")
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("SupplAnsw")
.HasColumnType("nvarchar(max)");
b.Property<string>("SupplEmail")
.HasColumnType("nvarchar(max)");
b.Property<string>("SupplUserCode")
.HasColumnType("nvarchar(max)");
b.Property<int>("TType")
.HasColumnType("int");
b.Property<int>("Tipo")
.HasColumnType("int");
b.HasKey("IdxTicket");
b.HasIndex("IdxLic");
b.ToTable("TicketLog");
});
modelBuilder.Entity("LiMan.DB.DBModels.AuthClaimModel", b =>
{
b.HasOne("LiMan.DB.DBModels.AuthRoleModel", "RoleNav")
.WithMany("Claims")
.HasForeignKey("RoleID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LiMan.DB.DBModels.AuthUserModel", "UserNav")
.WithMany("Claims")
.HasForeignKey("UserID")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("RoleNav");
b.Navigation("UserNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.FileAttachModel", b =>
{
b.HasOne("LiMan.DB.DBModels.TicketModel", "TicketNav")
.WithMany()
.HasForeignKey("IdxTicket")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TicketNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.InstalledReleasesModel", b =>
{
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
.WithMany()
.HasForeignKey("CodApp");
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "IstanzaNav")
.WithMany()
.HasForeignKey("IdxSubLic")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ApplicativoNav");
b.Navigation("IstanzaNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
{
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
.WithMany()
.HasForeignKey("CodApp");
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
.WithMany()
.HasForeignKey("CodInst");
b.Navigation("ApplicativoNav");
b.Navigation("InstallazioneNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.LogLicenzaModel", b =>
{
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
.WithMany()
.HasForeignKey("CodApp");
b.HasOne("LiMan.DB.DBModels.InstallazioneModel", "InstallazioneNav")
.WithMany()
.HasForeignKey("CodInst");
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
.WithMany()
.HasForeignKey("IdxLic")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ApplicativoNav");
b.Navigation("InstallazioneNav");
b.Navigation("LicenzaNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.ReleaseModel", b =>
{
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
.WithMany()
.HasForeignKey("CodApp");
b.Navigation("ApplicativoNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.SubLicenzaModel", b =>
{
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
.WithMany("Attivazioni")
.HasForeignKey("IdxLic")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("LicenzaNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.TicketModel", b =>
{
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "LicenzaNav")
.WithMany("Tickets")
.HasForeignKey("IdxLic")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("LicenzaNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.AuthRoleModel", b =>
{
b.Navigation("Claims");
});
modelBuilder.Entity("LiMan.DB.DBModels.AuthUserModel", b =>
{
b.Navigation("Claims");
});
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
{
b.Navigation("Attivazioni");
b.Navigation("Tickets");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,60 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LiMan.DB.Migrations
{
public partial class AddInstalledRelTrack_01 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "InstalledReleases",
columns: table => new
{
IdxInstall = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CodApp = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
MastKey = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
CodImp = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
AppKey = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
VersNum = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
NumImp = table.Column<int>(type: "int", nullable: false),
DtCheck = table.Column<DateTime>(type: "datetime2", nullable: false),
IdxSubLic = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InstalledReleases", x => x.IdxInstall);
table.ForeignKey(
name: "FK_InstalledReleases_Applicativi_CodApp",
column: x => x.CodApp,
principalTable: "Applicativi",
principalColumn: "CodApp");
table.ForeignKey(
name: "FK_InstalledReleases_Licenze_IdxSubLic",
column: x => x.IdxSubLic,
principalTable: "Licenze",
principalColumn: "IdxLic",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_InstalledReleases_CodApp",
table: "InstalledReleases",
column: "CodApp");
migrationBuilder.CreateIndex(
name: "IX_InstalledReleases_IdxSubLic",
table: "InstalledReleases",
column: "IdxSubLic");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InstalledReleases");
}
}
}
@@ -209,6 +209,52 @@ namespace LiMan.DB.Migrations
b.ToTable("Installazioni");
});
modelBuilder.Entity("LiMan.DB.DBModels.InstalledReleasesModel", b =>
{
b.Property<int>("IdxInstall")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("IdxInstall"), 1L, 1);
b.Property<string>("AppKey")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<string>("CodApp")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("CodImp")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<DateTime>("DtCheck")
.HasColumnType("datetime2");
b.Property<int>("IdxSubLic")
.HasColumnType("int");
b.Property<string>("MastKey")
.HasMaxLength(500)
.HasColumnType("nvarchar(500)");
b.Property<int>("NumImp")
.HasColumnType("int");
b.Property<string>("VersNum")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("IdxInstall");
b.HasIndex("CodApp");
b.HasIndex("IdxSubLic");
b.ToTable("InstalledReleases");
});
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
{
b.Property<int>("IdxLic")
@@ -490,6 +536,23 @@ namespace LiMan.DB.Migrations
b.Navigation("TicketNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.InstalledReleasesModel", b =>
{
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
.WithMany()
.HasForeignKey("CodApp");
b.HasOne("LiMan.DB.DBModels.LicenzaModel", "IstanzaNav")
.WithMany()
.HasForeignKey("IdxSubLic")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ApplicativoNav");
b.Navigation("IstanzaNav");
});
modelBuilder.Entity("LiMan.DB.DBModels.LicenzaModel", b =>
{
b.HasOne("LiMan.DB.DBModels.ApplicativoModel", "ApplicativoNav")
+1 -1
View File
@@ -25,7 +25,7 @@
<div class="card-header bg-info py-1 text-light">
<div class="d-flex justify-content-between">
<div class="px-2">
<h3>Attivazioni</h3>
<h3>Istanze/Attivazioni</h3>
</div>
<div class="px-2">
@if (CanEdit)
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.1.2501.0919</Version>
<Version>2.1.2501.1110</Version>
<RootNamespace>LiMan.UI</RootNamespace>
<AssemblyName>LiMan.UI</AssemblyName>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 2.1.2501.0919</h4>
<h4>Versione: 2.1.2501.1110</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
2.1.2501.0919
2.1.2501.1110
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>2.1.2501.0919</version>
<version>2.1.2501.1110</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>