38 lines
961 B
C#
38 lines
961 B
C#
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||
|
using Seyounth.Hyosung.Data.Entities;
|
||
|
|
||
|
namespace Seyounth.Hyosung.Data.Models;
|
||
|
|
||
|
public partial class AgvBin : ObservableObject
|
||
|
{
|
||
|
public int Id { get; set; }
|
||
|
public string BinCode { get; set; }
|
||
|
public string CtnrCode { get; set; }
|
||
|
|
||
|
public bool IsFree { get; set; }
|
||
|
|
||
|
public int Sort { get; set; }
|
||
|
|
||
|
[ObservableProperty] private bool _isDeleted;
|
||
|
|
||
|
public event Func<AgvBin, bool, Task>? OnDeletedChanged;
|
||
|
|
||
|
partial void OnIsDeletedChanged(bool value)
|
||
|
{
|
||
|
// 触发视图模型的保存方法
|
||
|
OnDeletedChanged?.Invoke(this, value);
|
||
|
}
|
||
|
|
||
|
public static AgvBin FromEntity(AgvBinEntity entity)
|
||
|
{
|
||
|
return new AgvBin()
|
||
|
{
|
||
|
Id = entity.Id,
|
||
|
BinCode = entity.BinCode,
|
||
|
CtnrCode = entity.CtnrCode,
|
||
|
IsDeleted = entity.IsDeleted,
|
||
|
Sort = entity.Sort,
|
||
|
IsFree = entity.IsFree,
|
||
|
};
|
||
|
}
|
||
|
}
|