!提交代码
This commit is contained in:
170
货架标准上位机/ViewModels/ShelfInfoAddOrUpdateViewModel.cs
Normal file
170
货架标准上位机/ViewModels/ShelfInfoAddOrUpdateViewModel.cs
Normal file
@ -0,0 +1,170 @@
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading.Tasks;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.Home;
|
||||
using WCS.Model.ApiModel.StoreInfo;
|
||||
using 货架标准上位机.Tool;
|
||||
|
||||
namespace 货架标准上位机.ViewModel
|
||||
{
|
||||
public class ShelfInfoAddOrUpdateViewModel : BindableBase
|
||||
{
|
||||
#region Property 属性
|
||||
public ShelfInfoAddOrUpdateViewModel()
|
||||
{
|
||||
ShelfTypeItems = GetBaseData.GetShelfType();
|
||||
if (ShelfTypeItems != null && ShelfTypeItems.Count > 0)
|
||||
SelectedShelfTypeItem = ShelfTypeItems.First();
|
||||
}
|
||||
|
||||
public void SetValues(ShelfInfoModel shelfInfoModel)
|
||||
{
|
||||
if (shelfInfoModel != null)
|
||||
{
|
||||
ShelfId = shelfInfoModel.Id;
|
||||
SelectedShelfTypeItem = shelfTypeItems.First(t => t.Id == shelfInfoModel.ShelfTypeId);
|
||||
ShelfCode = shelfInfoModel.ShelfCode;
|
||||
RowCounts = shelfInfoModel.Rowcounts;
|
||||
ColumnCounts = shelfInfoModel.Columncounts;
|
||||
LightId = shelfInfoModel.LightId;
|
||||
ClientIp = shelfInfoModel.ClientIp;
|
||||
GroupName = shelfInfoModel.GroupName;
|
||||
IsBind = shelfInfoModel.IsBind;
|
||||
BindShelfCode = shelfInfoModel.BindShelfCode;
|
||||
}
|
||||
}
|
||||
|
||||
public ShelfInfoModel GetValues()
|
||||
{
|
||||
return new ShelfInfoModel()
|
||||
{
|
||||
Id = ShelfId,
|
||||
ShelfTypeId = SelectedShelfTypeItem.Id,
|
||||
ShelfTypeName = SelectedShelfTypeItem.ShelfTypeName,
|
||||
ShelfCode = ShelfCode,
|
||||
Rowcounts = RowCounts,
|
||||
Columncounts = ColumnCounts,
|
||||
LightId = LightId,
|
||||
ClientIp = ClientIp,
|
||||
GroupName = GroupName,
|
||||
IsBind = IsBind,
|
||||
BindShelfCode = BindShelfCode,
|
||||
};
|
||||
}
|
||||
|
||||
private int shelfId;
|
||||
public int ShelfId
|
||||
{
|
||||
get { return shelfId; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfId, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<ShelfTypeModel> shelfTypeItems;
|
||||
public List<ShelfTypeModel> ShelfTypeItems
|
||||
{
|
||||
get { return shelfTypeItems; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfTypeItems, value);
|
||||
}
|
||||
}
|
||||
|
||||
private ShelfTypeModel selectedShelfTypeItem;
|
||||
public ShelfTypeModel SelectedShelfTypeItem
|
||||
{
|
||||
get { return selectedShelfTypeItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedShelfTypeItem, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string shelfCode;
|
||||
public string ShelfCode
|
||||
{
|
||||
get { return shelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref shelfCode, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int rowCounts;
|
||||
public int RowCounts
|
||||
{
|
||||
get { return rowCounts; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref rowCounts, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int columnCounts;
|
||||
public int ColumnCounts
|
||||
{
|
||||
get { return columnCounts; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref columnCounts, value);
|
||||
}
|
||||
}
|
||||
|
||||
private int lightId;
|
||||
public int LightId
|
||||
{
|
||||
get { return lightId; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref lightId, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string clientIp;
|
||||
public string ClientIp
|
||||
{
|
||||
get { return clientIp; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref clientIp, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string groupName;
|
||||
public string GroupName
|
||||
{
|
||||
get { return groupName; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref groupName, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool isBind;
|
||||
public bool IsBind
|
||||
{
|
||||
get { return isBind; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref isBind, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string bindShelfCode;
|
||||
public string BindShelfCode
|
||||
{
|
||||
get { return bindShelfCode; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref bindShelfCode, value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user