Files
limanapp/LiMan.DB/DBModels/InstalledReleasesHistoryModel.cs
2025-01-15 12:21:46 +01:00

96 lines
2.9 KiB
C#

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("InstalledReleasesHistory")]
public partial class InstalledReleasesHistoryModel
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int IdxInstRelHist { get; set; }
/// <summary>
/// Data di riferimento campionamento
/// </summary>
public DateTime DtRif { get; set; } = DateTime.Today;
/// <summary>
/// CodApp Richiesta
/// </summary>
[MaxLength(50)]
public string CodApp { get; set; } = "";
/// <summary>
/// Versione applicativo formato semver numerico 4 blocchi
/// </summary>
[MaxLength(50)]
public string VersNum { get; set; } = "0.0.0.0";
/// <summary>
/// Numero Copie Installate dell'applicativo
/// </summary>
public int NumInst { get; set; } = 1;
/// <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>
/// Numero Installazioni con score 4 (tutti valori rel correnti M.m.r.b)
/// </summary>
public int NumIS4 { get; set; } = 0;
/// <summary>
/// Numero Installazioni con score 3 (3 valori rel correnti M.m.r.x)
/// </summary>
public int NumIS3 { get; set; } = 0;
/// <summary>
/// Numero Installazioni con score 2 (2 valori rel correnti M.m.x.x)
/// </summary>
public int NumIS2 { get; set; } = 0;
/// <summary>
/// Numero Installazioni con score 1 (3 valori rel correnti M.x.x.x)
/// </summary>
public int NumIS1 { get; set; } = 0;
/// <summary>
/// Numero Installazioni con score 0 (0 valori rel correnti x.x.x.x)
/// </summary>
public int NumIS0 { 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; }
}
}