WIP start&stop edit magazine
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
|
||||
namespace Step.Model.DatabaseModels
|
||||
{
|
||||
[Table("shank")]
|
||||
public class NcShankModel
|
||||
public class DbNcShankModel
|
||||
{
|
||||
[Key]
|
||||
[Column("id")]
|
||||
public int ShankId { get; set; }
|
||||
|
||||
[Column("balluf")]
|
||||
public short? Balluf { get; set; }
|
||||
public int? Balluf { get; set; }
|
||||
|
||||
[Column("magazine_position_type")]
|
||||
public byte MagazinePositionType { get; set; }
|
||||
@@ -23,8 +24,20 @@ namespace Step.Model.DatabaseModels
|
||||
[ForeignKey("MagazinePosition"), Column("position_id", Order = 1)]
|
||||
public byte? PositionId { get; set; }
|
||||
|
||||
public NcMagazinePositionModel MagazinePosition { get; set; }
|
||||
public DbNcMagazinePositionModel MagazinePosition { get; set; }
|
||||
|
||||
public List<NcToolModel> Tools { get; set; }
|
||||
public List<DbNcToolModel> Tools { get; set; }
|
||||
|
||||
public static explicit operator NcShankModel(DbNcShankModel obj)
|
||||
{
|
||||
return new NcShankModel()
|
||||
{
|
||||
Id = obj.ShankId,
|
||||
Balluf = obj.Balluf == null ? (ushort)0 : (ushort)obj.Balluf.Value,
|
||||
MagazineId = obj.MagazineId == null ? (byte)0 : obj.MagazineId.Value,
|
||||
PositionId = obj.PositionId == null ? (byte)0 : obj.PositionId.Value,
|
||||
MagazinePositionType = obj.MagazinePositionType,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user