Implemetato databese locale con EntityFramework
This commit is contained in:
17
SteUp.Shared/Core/Entities/Ispezione.cs
Normal file
17
SteUp.Shared/Core/Entities/Ispezione.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using SteUp.Shared.Core.Enum;
|
||||
|
||||
namespace SteUp.Shared.Core.Entities;
|
||||
|
||||
public class Ispezione
|
||||
{
|
||||
[Required]
|
||||
public string CodMdep { get; set; } = string.Empty;
|
||||
public DateOnly Data { get; set; }
|
||||
[Required]
|
||||
public string Rilevatore { get; set; } = string.Empty;
|
||||
|
||||
public StatusEnum Stato { get; set; } = StatusEnum.InCorso;
|
||||
|
||||
public List<Scheda> Schede { get; set; } = [];
|
||||
}
|
||||
51
SteUp.Shared/Core/Entities/Scheda.cs
Normal file
51
SteUp.Shared/Core/Entities/Scheda.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using SteUp.Shared.Core.Dto;
|
||||
|
||||
namespace SteUp.Shared.Core.Entities;
|
||||
|
||||
public class Scheda
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string? CodJfas { get; set; }
|
||||
|
||||
[Required]
|
||||
public string CodMdep { get; set; } = string.Empty;
|
||||
public DateOnly Data { get; set; }
|
||||
[Required]
|
||||
public string Rilevatore { get; set; } = string.Empty;
|
||||
public Ispezione? Ispezione { get; set; }
|
||||
|
||||
public string? DescrizioneReparto { get; set; }
|
||||
public string? ActivityTypeId { get; set; }
|
||||
public string? Note { get; set; }
|
||||
public string? Responsabile { get; set; }
|
||||
public int Scadenza { get; set; } = 24;
|
||||
|
||||
[NotMapped]
|
||||
public JtbFasiDto? Reparto
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_reparto == null && CodJfas != null)
|
||||
{
|
||||
_reparto = new JtbFasiDto
|
||||
{
|
||||
CodJfas = CodJfas,
|
||||
Descrizione = DescrizioneReparto
|
||||
};
|
||||
}
|
||||
return _reparto;
|
||||
}
|
||||
set
|
||||
{
|
||||
_reparto = value;
|
||||
if (value == null) return;
|
||||
|
||||
CodJfas = value.CodJfas;
|
||||
DescrizioneReparto = value.Descrizione;
|
||||
}
|
||||
}
|
||||
private JtbFasiDto? _reparto;
|
||||
}
|
||||
Reference in New Issue
Block a user