using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using static EgtBEAMWALL.Core.ConstBeam;
namespace EgtBEAMWALL.DataLayer.DatabaseModels
{
//
// This is here so CodeMaid doesn't reorganize this document
//
///
/// Tabella dei PROJ caricati dal BTL
///
[Table("ProjList")]
public class ProjModel
{
#region Public Properties
[Key, Column("ProjDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ProjDbId { get; set; }
[Column("BTLFileName")]
public string BTLFileName { get; set; } = "";
///
/// Data Creazione
///
[Column("DtCreated")]
[Index]
public DateTime DtCreated { get; set; }
///
/// Data Esportazione
///
[Column("DtExported")]
[Index]
public DateTime DtExported { get; set; }
///
/// Stato NEW = creato ma NON salvato
///
[Index]
[Column("IsNew")]
public bool IsNew { get; set; } = true;
///
/// ListName del BTL
///
[Column("ListName")]
public string ListName { get; set; } = "";
///
/// Stato locked (quando aperto da un dispositivo in rete)
///
[Column("Lock")]
public bool Locked { get; set; } = false;
[Column("ProdDbId")]
public int? ProdDbId { get; set; }
///
/// ID da modello ext
///
[Column("Id")]
[Index]
public int ProjId { get; set; }
///
/// Tipologia del progetto (Travi, Pareti, ...)
///
public BWType PType { get; set; } = BWType.NULL;
///
/// Macchina
///
[Column("Machine")]
public string Machine { get; set; } = "";
///
/// ID utente che ha bloccato (NumKey), quando aperto da un dispositivo in rete
///
[Column("LockedBy")]
public string LockedBy { get; set; } = "";
///
/// DataOra ultima operazione di Lock (o di rimozione di lock), quando aperto da un
/// dispositivo in rete
///
[Column("LockDate")]
public DateTime LockDate { get; set; } = DateTime.MinValue;
///
/// Record attivo (se false == cancellazione logica)
///
[Index]
[Column("IsActive")]
public bool IsActive { get; set; } = true;
///
/// Descrizione progetto (copiata da BTLFileName inizialmente)
///
[Column("ProjDescription")]
public string ProjDescription { get; set; } = "";
///
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto
///
[Index]
[Column("IsArchived")]
public bool IsArchived { get; set; } = false;
[ForeignKey("ProdDbId")]
public virtual ProdModel Prod { get; set; }
#endregion Public Properties
}
}