Files
magman/MagMan.Data.Tenant/DbModels/MaterialModel.cs
T
2024-01-16 09:38:16 +01:00

89 lines
2.4 KiB
C#

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