|
- using BPASmartClient.CustomResource.Pages.Model;
- using BPASmartClient.CustomResource.UserControls;
- using BPASmartClient.CustomResource.UserControls.MessageShow;
- using BPASmartClient.Helper;
- using BPASmartClient.JXJFoodBigStation.Model;
- using BPASmartClient.JXJFoodBigStation.Model.HK_PLC;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using Microsoft.Toolkit.Mvvm.Input;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.ComponentModel;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
-
- namespace BPASmartClient.JXJFoodBigStation.ViewModel
- {
- public class StockBinRawMaterialViewModel : ObservableObject
- {
- public StockBinRawMaterialViewModel()
- {
- RawMaterialInfo = Json<RawMaterialData>.Data.RawMaterial;
- RemoveCommand = new RelayCommand<Object>((loc) =>
- {
- if (loc is int pos)
- {
- var res = RawMaterialInfo.FirstOrDefault(p => p.RawMaterialLocation == pos);
- if (res != null) RawMaterialInfo.Remove(res);
- }
- });
- SaveRawMaterialPara = new RelayCommand(() =>
- {
- Json<RawMaterialData>.Save();
- MessageNotify.GetInstance.ShowUserLog($"原料与料仓对应关系保存成功");
- NoticeDemoViewModel.OpenMsg(EnumPromptType.Success, App.MainWindow, "成功", $"原料与料仓对应关系保存成功");
- });
- UpdateRawMaterial = new RelayCommand(() =>
- {
- RawMaterialInfo.Add(new RawMaterial() { RawMaterialCount = (short)(RawMaterialInfo.Count + 1)});
- });
- }
- public ObservableCollection<RawMaterial> RawMaterialInfo { get; set; } = new ObservableCollection<RawMaterial>();
- public RelayCommand<Object> RemoveCommand { get; set; }
- public RelayCommand SaveRawMaterialPara { get; set; }
- public RelayCommand UpdateRawMaterial { get; set; }
- }
- }
|