ec1854844a
- Fix Item - Fix Material
89 lines
2.2 KiB
C#
89 lines
2.2 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("MaterialsList")]
|
|
public partial class MaterialModel
|
|
{
|
|
/// <summary>
|
|
/// Init classe
|
|
/// </summary>
|
|
public MaterialModel()
|
|
{
|
|
RawItemList = new HashSet<RawItemModel>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Primary Key AUTO
|
|
/// </summary>
|
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int MatId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Codice Materiale
|
|
/// </summary>
|
|
public string MatCode { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Descrizione materiale
|
|
/// </summary>
|
|
public string MatDesc { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Height (Thikness/Spessore) in mm
|
|
/// </summary>
|
|
public decimal HMm { get; set; } = 0;
|
|
|
|
/// <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>
|
|
/// Codice materiale x QR/Datamatrix
|
|
/// </summary>
|
|
[NotMapped]
|
|
public string MatDtmx
|
|
{
|
|
get => $"MT{MatId: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>
|
|
/// Navigazione ad oggetti child
|
|
/// </summary>
|
|
public virtual ICollection<RawItemModel>? RawItemList { get; set; }
|
|
}
|
|
}
|