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 }; } }