|
- using BPASmartClient.CustomResource.Pages.Model;
- using BPASmartClient.FoodStationTest.Model;
- using BPASmartClient.FoodStationTest.View;
- using BPASmartClient.Helper;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using Microsoft.Toolkit.Mvvm.Input;
- using System.Collections.ObjectModel;
- using System.Linq;
-
- namespace BPASmartClient.FoodStationTest.ViewModel
- {
- public class SiemensRecipeReceiveViewModel : ObservableObject
- {
- //ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
- public SiemensRecipeReceiveViewModel()
- {
- Recipes = Json<RemoteRecipeDataColl>.Data.Recipes;
- DetailsCommand = new RelayCommand<object>((o) =>
- {
- if (o != null && o is string cnt)
- {
- ActionManage.GetInstance.Send("CloseRecipeInfosView");
- RecipeInfosView nrv = new RecipeInfosView();
-
- var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
- if (res != null)
- {
- ActionManage.GetInstance.Send("RecipeInfo", res);
- nrv.Show();
- MessageNotify.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
- }
- }
- });
- ClearAllRecipe = new RelayCommand(() =>
- {
- if (MessageNotify.GetInstance.ShowDialog($"请确认,是否删除所有配方订单?"))
- {
- Json<RemoteRecipeDataColl>.Data.Recipes.Clear();
- MessageNotify.GetInstance.ShowUserLog($"手动清除所有配方。");
- }
- });
- }
- public RelayCommand<object> DetailsCommand { get; set; }
- public RelayCommand ClearAllRecipe { get; set; }
- public ObservableCollection<RemoteRecipeData> Recipes { get; set; }
- }
- }
|