2025-04-07 23:25:45 +08:00

40 lines
963 B
C#

using Seyounth.Core.Extensions;
using Seyounth.Hyosung.Data.Entities;
namespace Seyounth.Hyosung.Data.Models;
public class Pallet : PalletEntity
{
public string Name
{
get
{
if (Type == PalletType.Honey)
{
return
$"{Type.GetDescription()}({Width}*{Length}*{Height})({HoleCount}|{(IsBigHole != null && IsBigHole.Value ? "" : "")})";
}
else if (Length != 0)
{
return $"{Type.GetDescription()}({Width}*{Length}*{Height})";
}
else return "无";
}
}
public static Pallet FromEntity(PalletEntity p)
{
return new Pallet()
{
Height = p.Height,
Width = p.Width,
Length = p.Length,
HoleCount = p.HoleCount,
Id = p.Id,
IsBigHole = p.IsBigHole,
Type = p.Type
};
}
}