using EgwProxy.MagMan;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwProxy.DataLayer.DbModel
{
//
// This is here so CodeMaid doesn't reorganize this document
//
///
/// Tabella deiu raggruppamenti PROJ in forma di PROD
///
[Table("ProdList")]
public class ProdModel
{
#region Public Properties
public ProdModel()
{
ProjListNav = new HashSet();
}
///
/// Chiave univoca DB
///
[Key, Column("ProdDbId"), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ProdDbId { get; set; }
[Column("Description")]
public string Description { get; set; } = "";
///
/// Data Creazione
///
[Index]
[Column("DtCreated")]
public DateTime DtCreated { get; set; }
///
/// Stato NEW = creato ma NON salvato
///
[Column("IsNew")]
public bool IsNew { get; set; } = true;
///
/// Stato locked, quando aperto da un dispositivo in rete
///
[Column("Lock")]
public bool Locked { get; set; } = false;
///
/// Chiave univoca per EgtBM
///
[Column("Id")]
[Index]
public int ProdId { get; set; }
///
/// Codice Proj per sync info (Identificativo DB esterno del magazzino in sync)
///
public int ProjCloudId { get; set; } = 0;
///
/// 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("IsDeleted")]
public bool IsActive { get; set; } = true;
///
/// Stato Prodotto = inviato ALMENO UNA VOLTA al supervisore --> NON eliminabile se non in modo logico
///
[Index]
[Column("IsProduced")]
public bool IsProduced { get; set; } = false;
///
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto
///
[Index]
[Column("IsArchived")]
public bool IsArchived { get; set; } = false;
///
/// Collezione oggetti Proj associati (almeno 1 by design)
///
public virtual ICollection ProjListNav { get; set; }
#endregion Public Properties
}
}