0e009dc6ec
& alarm Fixes
45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using CMS_CORE_Library.Models;
|
|
|
|
namespace Step.Model.DatabaseModels
|
|
{
|
|
[Table("shank")]
|
|
public class DbNcShankModel
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
|
[Column("id")]
|
|
public short ShankId { get; set; }
|
|
|
|
[Column("balluf")]
|
|
public int? Balluf { get; set; }
|
|
|
|
[Column("magazine_position_type")]
|
|
public byte MagazinePositionType { get; set; }
|
|
|
|
[ForeignKey("MagazinePosition"), Column("magazine_id", Order = 0)]
|
|
public byte? MagazineId { get; set; }
|
|
|
|
[ForeignKey("MagazinePosition"), Column("position_id", Order = 1)]
|
|
public byte? PositionId { get; set; }
|
|
|
|
public DbNcMagazinePositionModel MagazinePosition { get; set; }
|
|
|
|
public List<DbNcToolModel> Tools { get; set; }
|
|
|
|
public static explicit operator NcShankModel(DbNcShankModel obj)
|
|
{
|
|
return new NcShankModel()
|
|
{
|
|
ShankId = (ushort)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,
|
|
};
|
|
}
|
|
}
|
|
} |