Files
2024-06-29 11:41:14 +02:00

150 lines
4.2 KiB
C#

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static MagMan.Core.Enums;
namespace MagMan.Data.Tenant.DbModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
/// <summary>
/// Tabella dei PROJ caricati da EgtBeamWall
/// </summary>
[Table("ProjList")]
[Index(nameof(MachineID))]
[Index(nameof(KeyNum))]
[Index(nameof(ProjExtDbId))]
[Index(nameof(IsActive))]
[Index(nameof(IsArchived))]
public class ProjModel
{
#region Public Properties
/// <summary>
/// Chiave univoca su DB
/// </summary>
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ProjDbId { get; set; }
/// <summary>
/// Id macchina (MagMan)
/// </summary>
public int MachineID { get; set; } = 0;
/// <summary>
/// Key di riferimento per il progetto
/// </summary>
public int KeyNum { get; set; } = 0;
/// <summary>
/// ID del DB EgtBW, univoco con KeyNum
/// </summary>
public int ProjExtDbId { get; set; } = 0;
/// <summary>
/// ID esterno (da EgtBW)
/// </summary>
public int ProjExtId { get; set; } = 0;
/// <summary>
/// Nome file BTL originale
/// </summary>
public string BTLFileName { get; set; } = "";
/// <summary>
/// Tipologia del progetto (Travi, Pareti, ...)
/// </summary>
public BWType PType { get; set; } = BWType.NULL;
/// <summary>
/// Macchina (Costruttore/Modello)
/// </summary>
public string Machine { get; set; } = "";
/// <summary>
/// Descrizione progetto (copiata da BTLFileName inizialmente)
/// </summary>
public string ProjDescription { get; set; } = "";
/// <summary>
/// Data Creazione progetto
/// </summary>
public DateTime DtCreated { get; set; } = DateTime.Now;
/// <summary>
/// Data di schedulazione (prevista)
/// </summary>
public DateTime DtSchedule { get; set; } = DateTime.Today.AddMonths(3);
/// <summary>
/// Data Inizio Produzione
/// </summary>
public DateTime DtStartProd { get; set; } = DateTime.MinValue;
/// <summary>
/// Data ora ultima operazione registrata
/// </summary>
public DateTime DtLastAction { get; set; } = DateTime.MinValue;
/// <summary>
/// ListName del BTL
/// </summary>
public string ListName { get; set; } = "";
/// <summary>
/// Tempo lavorazione previsto (stima) in minuti
/// </summary>
public double ProcTimeEst { get; set; } = 0;
/// <summary>
/// Tempo lavorazione reale in minuti (parziale o totale se chiuso/completato/archiviato)
/// </summary>
public double ProcTimeReal { get; set; } = 0;
/// <summary>
/// Avanzamento in percentuale (tipicamente barre fatte / da fare)
/// </summary>
public double ProgPerc
{
get
{
double answ = 0;
if (ValMax > 0)
{
answ = ValAct / ValMax;
}
return answ;
}
}
/// <summary>
/// Avanzamento (tipicamente barre fatte)
/// </summary>
public double ValAct { get; set; } = 0;
/// <summary>
/// Valore finale atteso (tipicamente barre da fare)
/// </summary>
public double ValMax { get; set; } = 1;
/// <summary>
/// Record attivo (se false == cancellazione logica)
/// </summary>
public bool IsActive { get; set; } = true;
/// <summary>
/// Stato Archiviato = NON visualizzabile normalmente, già prodotto/chiuso
/// </summary>
public bool IsArchived { get; set; } = false;
#endregion Public Properties
}
}