提交代码
This commit is contained in:
95
货架标准上位机/ViewModels/OutInventoryAddMatViewModel.cs
Normal file
95
货架标准上位机/ViewModels/OutInventoryAddMatViewModel.cs
Normal file
@ -0,0 +1,95 @@
|
||||
using HandyControl.Controls;
|
||||
using Ping9719.WpfEx.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.MatInventoryDetail;
|
||||
using 货架标准上位机.Api;
|
||||
|
||||
namespace 货架标准上位机.ViewModels
|
||||
{
|
||||
public class OutInventoryAddMatViewModel : BindableBase
|
||||
{
|
||||
#region Property
|
||||
private ObservableCollection<MatInventorySummaryModel> dataGridItemSource;
|
||||
public ObservableCollection<MatInventorySummaryModel> DataGridItemSource
|
||||
{
|
||||
get { return dataGridItemSource; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref dataGridItemSource, value);
|
||||
}
|
||||
}
|
||||
|
||||
private MatInventorySummaryModel selectedataGridItem;
|
||||
public MatInventorySummaryModel SelectedataGridItem
|
||||
{
|
||||
get { return selectedataGridItem; }
|
||||
set
|
||||
{
|
||||
SetProperty(ref selectedataGridItem, 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);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
/// <summary>
|
||||
/// 搜索
|
||||
/// </summary>
|
||||
public ICommand BtnSearchCommand { get => new DelegateCommand(BtnSearch); }
|
||||
public void BtnSearch()
|
||||
{
|
||||
#region 调用接口获取数据
|
||||
try
|
||||
{
|
||||
var body = new GetMatInventorySummaryRequest()
|
||||
{
|
||||
MatName = MatName,
|
||||
MatCode = MatCode,
|
||||
};
|
||||
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<List<MatInventorySummaryModel>>>(LocalFile.Config.ApiIpHost + "matInventoryDetail/getMatInventorySummary", body, "POST");
|
||||
if (Result != null && Result.Data != null)
|
||||
{
|
||||
DataGridItemSource = new ObservableCollection<MatInventorySummaryModel>(Result.Data);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Growl.Error("加载数据失败:" + ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user