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