Files
wcs/货架标准上位机/ViewModels/MatDetailCurrentInfoUpdateViewModel.cs
2025-06-27 14:06:52 +08:00

149 lines
3.7 KiB
C#

using HandyControl.Controls;
using Ping9719.WpfEx.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.AccessControl;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
using System.Windows.Controls;
using TouchSocket.Core;
using WCS.Model;
using WCS.Model.ApiModel.Home;
using WCS.Model.ApiModel.MatDetailCurrentInfo;
using WCS.Model.ApiModel.StoreInfo;
using .Tool;
namespace .ViewModel
{
public class MatDetailCurrentInfoUpdateViewModel : BindableBase
{
public MatDetailCurrentInfoModel model { get; set; }
public System.Windows.Controls.TextBox textBox { get; set; }
#region Property
public void SetValues(MatDetailCurrentInfoModel matDetailCurrentInfoModel)
{
model = matDetailCurrentInfoModel;
ShelfType = matDetailCurrentInfoModel.ShelfType;
ShelfCode = matDetailCurrentInfoModel.ShelfCode;
LocationArea = matDetailCurrentInfoModel.LocationArea;
LocationCode = matDetailCurrentInfoModel.LocationCode;
MatName = matDetailCurrentInfoModel.MatName;
MatCode = matDetailCurrentInfoModel.MatCode;
MatSpec = matDetailCurrentInfoModel.MatSpec;
MatQty = matDetailCurrentInfoModel.MatQty;
if (textBox != null)
Task.Run(() =>
{
Thread.Sleep(100);
App.Current.Dispatcher.Invoke(() =>
{
textBox.Focus();
});
});
}
public MatDetailCurrentInfoModel GetValues()
{
if (model == null)
{
return null;
}
model.MatQty = MatQty;
return model;
}
private string shelfCode;
public string ShelfCode
{
get { return shelfCode; }
set
{
SetProperty(ref shelfCode, value);
}
}
private string shelfType;
public string ShelfType
{
get { return shelfType; }
set
{
SetProperty(ref shelfType, value);
}
}
private string locationArea;
public string LocationArea
{
get { return locationArea; }
set
{
SetProperty(ref locationArea, value);
}
}
private string locationCode;
public string LocationCode
{
get { return locationCode; }
set
{
SetProperty(ref locationCode, value);
}
}
private string matCode;
public string MatCode
{
get { return matCode; }
set
{
SetProperty(ref matCode, value);
}
}
private string matName;
public string MatName
{
get { return matName; }
set
{
SetProperty(ref matName, value);
}
}
private string matSpec;
public string MatSpec
{
get { return matSpec; }
set
{
SetProperty(ref matSpec, value);
}
}
private int matQty;
public int MatQty
{
get { return matQty; }
set
{
SetProperty(ref matQty, value);
}
#endregion
}
}
}