63 lines
1.6 KiB
C#
63 lines
1.6 KiB
C#
using Step.Model.DatabaseModels;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Step.Model.DTOModels.ToolModels
|
|
{
|
|
public class DTONcToolModel
|
|
{
|
|
public int Id { get; set; }
|
|
|
|
[Required]
|
|
public byte Type { get; set; }
|
|
|
|
[Required]
|
|
public short OffsetLenght { get; set; }
|
|
|
|
[Required]
|
|
public short ResidualLife { get; set; }
|
|
|
|
[Required]
|
|
public short ResidualRevive { get; set; }
|
|
|
|
[Required]
|
|
// Foreign keys
|
|
public int FamilyId { get; set; }
|
|
|
|
[Required]
|
|
public int ShankId { get; set; }
|
|
|
|
public static explicit operator DTONcToolModel(NcToolModel obj)
|
|
{
|
|
return new DTONcToolModel()
|
|
{
|
|
Id = obj.ToolId,
|
|
FamilyId = obj.FamilyId,
|
|
ShankId = obj.ShankId,
|
|
Type = obj.Type,
|
|
OffsetLenght = obj.OffsetLenght,
|
|
ResidualLife = obj.ResidualLife,
|
|
ResidualRevive = obj.ResidualRevive
|
|
};
|
|
}
|
|
|
|
public static explicit operator NcToolModel(DTONcToolModel obj)
|
|
{
|
|
return new NcToolModel()
|
|
{
|
|
ToolId = obj.Id,
|
|
FamilyId = obj.FamilyId,
|
|
ShankId = obj.ShankId,
|
|
Type = obj.Type,
|
|
OffsetLenght = obj.OffsetLenght,
|
|
ResidualLife = obj.ResidualLife,
|
|
ResidualRevive = obj.ResidualRevive
|
|
};
|
|
}
|
|
}
|
|
}
|