Files
magman/MagMan.Core/DTO/MaterialDTO.cs
T
2024-01-30 10:52:18 +01:00

88 lines
2.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MagMan.Core.DTO
{
public class MaterialDTO
{
/// <summary>
/// Primary Key Materiale (DB) / CLOUD
/// </summary>
public int MatCloudId { get; set; } = 0;
/// <summary>
/// Primary Key Materiale (DB) / istanza locale
/// </summary>
public int MatLocalId { get; set; } = 0;
/// <summary>
/// Codice Materiale
/// </summary>
public string MatCode { get; set; } = "";
/// <summary>
/// Descrizione materiale
/// </summary>
public string MatDesc { 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 HMm { get; set; } = 0;
/// <summary>
/// Varianti dimensionali disponibili
/// </summary>
public int SizeNum { get; set; } = 0;
/// <summary>
/// Quantità totale in giacenza
/// </summary>
public int QtyTot { get; set; } = 0;
/// <summary>
/// Codice materiale x QR/Datamatrix
/// </summary>
[NotMapped]
public string MatDtmx
{
get => $"MT{MatCloudId:00000000}";
}
/// <summary>
/// Verifica che sia Beam, quando L == 0
/// </summary>
[NotMapped]
public bool IsBeam
{
get => (LMm == 0 && (HMm > 0 && WMm > 0));
}
/// <summary>
/// Verifica che sia Wall, quando W/L == 0
/// </summary>
[NotMapped]
public bool IsWall
{
get => (HMm > 0 && (LMm == 0 && WMm == 0));
}
/// <summary>
/// Elenco item e giancenze
/// </summary>
public List<ItemDTO>? ItemList { get; set; } = new List<ItemDTO>();
}
}