Files
2021-11-25 09:56:01 +01:00

106 lines
2.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace NKC.Data.DbModels
{
// <Auto-Generated>
// This is here so CodeMaid doesn't reorganize this document
// </Auto-Generated>
//[Index(nameof(Installazione), nameof(Active), nameof(DiskStatus))]
[Table("RemnantsList")]
public partial class RemnantsModel
{
/// <summary>
/// Primary Key AUTO
/// </summary>
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int RemnID { get; set; }
/// <summary>
/// Ext ref for Material
/// </summary>
public int MatID { get; set; }
/// <summary>
/// Location
/// </summary>
public string Location { get; set; } = "";
/// <summary>
/// Qty available on wharehouse
/// </summary>
public int QtyAvail { get; set; } = 0;
/// <summary>
/// DateTime last modification
/// </summary>
public DateTime DtMod { get; set; } = DateTime.Now.AddYears(10);
/// <summary>
/// Remnant's Lenght
/// </summary>
public decimal LMm { get; set; } = 0;
/// <summary>
/// Remnant's Width
/// </summary>
public decimal WMm { get; set; } = 0;
/// <summary>
/// Remnant's Thikness
/// </summary>
public decimal TMm { get; set; } = 0;
[NotMapped]
public decimal LIn
{
get => Math.Round(LMm / (decimal)25.4, 3);
}
[NotMapped]
public decimal WIn
{
get => Math.Round(WMm / (decimal)25.4, 3);
}
[NotMapped]
public decimal TIn
{
get => Math.Round(TMm / (decimal)25.4, 3);
}
/// <summary>
/// Note (optional)
/// </summary>
public string Note { get; set; } = "";
[NotMapped]
public decimal Area
{
get => LMm * WMm;
}
[NotMapped]
public string RemDtmx
{
get
{
string answ = $"MT99999999-{LMm * 1000:00000000}";
if (MaterialNav != null)
{
answ = $"MT{MaterialNav.MatExtCode:00000000}-{LMm * 1000:00000000}";
}
return answ;
}
}
/// <summary>
/// Navigation property to Material
/// </summary>
[ForeignKey("MatID")]
public virtual MaterialModel MaterialNav { get; set; } = null!;
}
}