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 MagMan.Data.Tenant.DbModels { // // This is here so CodeMaid doesn't reorganize this document // [Table("Materials")] public partial class MaterialModel { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int MatID { get; set; } /// /// Codice materiale (esterno) /// public int MatExtCode { get; set; } = 0; /// /// Descrizione materiale /// public string MatDesc { get; set; } = ""; /// /// Data approvazione (se non approvato è nel futuro) /// public DateTime ApprovDate { get; set; } = DateTime.Now.AddYears(100); /// /// Utente approvazione amteriale /// public string ApprovUser { get; set; } = ""; /// /// Lenght/Lunghezza in mm /// public decimal LMm { get; set; } = 0; /// /// Width/Larghezza in mm /// public decimal WMm { get; set; } = 0; /// /// Thikness/Spessore in mm /// public decimal TMm { get; set; } = 0; /// /// Lenght/Lunghezza in inch /// [NotMapped] public decimal LIn { get => Math.Round(LMm / (decimal)25.4, 3); } /// /// Width/Larghezza in inch /// [NotMapped] public decimal WIn { get => Math.Round(WMm / (decimal)25.4, 3); } /// /// Thikness/Spessore in inch /// [NotMapped] public decimal TIn { get => Math.Round(TMm / (decimal)25.4, 3); } /// /// Codice materiale x QR/Datamatrix /// [NotMapped] public string MatDtmx { get => $"MT{MatExtCode:00000000}"; } public virtual ICollection? ItemNav { get; set; } } }