Files
mapo-iob-man/IOB-MAN.Core/DTO/ReleaseDTO.cs
T
2025-06-17 09:06:10 +02:00

100 lines
3.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IOB_MAN8.Core.DTO
{
public class ReleaseDTO
{
/// <summary>
/// Codice/Nome applicativo
/// </summary>
public string CodApp { get; set; } = "";
/// <summary>
/// Path applicazione locale
/// </summary>
public string LocalPath { get; set; } = "";
/// <summary>
/// Versione applicativo formato semver numerico 4 blocchi
/// </summary>
public string VersNum { get; set; } = "0.0.0.0";
/// <summary>
/// Versione applicativo, formato testuale libero, può essere uguale a VersNum
/// </summary>
public string VersText { get; set; } = "a.b";
/// <summary>
/// Oggetto versione calcolato da VersNum
/// </summary>
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;
}
}
/// <summary>
/// Verifica se sia permessa la versione quando viene valutata la versione massima consentita
/// </summary>
public bool IsPermitted { get; set; } = false;
/// <summary>
/// Data di release
/// </summary>
public DateTime ReleaseDate { get; set; } = DateTime.Today.AddYears(100);
/// <summary>
/// Tag associati a versione, comma separated
/// </summary>
public string RelTags { get; set; } = "";
/// <summary>
/// Url pagina web di changelog (traduzione gestita sul sito target) - calcolato da CodApp + vers
/// </summary>
public string UrlChangelog { get; set; } = "http://releases.egalware.com";
/// <summary>
/// Url pagina web di changelog estesa (traduzione gestita sul sito target) - calcolato da CodApp + vers
/// </summary>
public string UrlChangelogExt { get; set; } = "http://releases.egalware.com";
/// <summary>
/// URL remoto x download
/// </summary>
public string UrlDownload { get; set; } = "";
/// <summary>
/// Attivo/Pubblico (qui calcolato, attivo se la data di release è passata, poi potrebbe essere gestito a parte da DB)
/// </summary>
public bool IsActive { get; set; } = false;
/// <summary>
/// Indica se install sia permesso (da setup tipo sw)
/// </summary>
public bool CanInstall { get; set; } = false;
/// <summary>
/// num impieghi configurati (es IOB-WIN-*)
/// </summary>
public int NumImp { get; set; } = 1;
}
}