using Lux.Report.Data.DTO;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Lux.Report.Data.DbModel
{
///
/// Classe dei report gestiti
///
[Table("report_list")]
public class ReportModel
{
///
/// ID del record
///
[Key]
public int ReportID { get; set; }
///
/// Denominazione
///
public string Name { get; set; } = "";
///
/// Descrizione
///
public string Description { get; set; } = "";
///
/// Valore completo Json per recupero dati, con segnaposto con [[param_01]]
///
public string JsonDSN { get; set; } = "";
///
/// Nome del report Active tra quelli nella folder
///
public string ActRepFileName { get; set; } = "";
///
/// Conf dei parametri per il report
///
public string ParamConfigRaw { get; set; } = "";
///
/// Conf relative ai file report
///
public string FileConfDataRaw { get; set; } = "";
///
/// Elenco dei parametri da gestire x il ReportTemplate
///
[NotMapped]
public List ParamConfig
{
get
{
List answ = new();
if (!string.IsNullOrEmpty(ParamConfigRaw) && ParamConfigRaw.Length > 2)
{
answ = JsonConvert.DeserializeObject>(ParamConfigRaw) ?? new();
}
return answ;
}
set
{
string rawVal = JsonConvert.SerializeObject(value);
ParamConfigRaw = rawVal;
}
}
}
}