终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

SiemensRecipeReceiveViewModel.cs 2.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.Toolkit.Mvvm.ComponentModel;
  7. using System.Collections.Concurrent;
  8. using System.Collections.ObjectModel;
  9. using System.Windows;
  10. using BPASmartClient.Helper;
  11. using Microsoft.Toolkit.Mvvm.Input;
  12. using BPASmartClient.JXJFoodSmallStation.Model;
  13. using BPASmartClient.JXJFoodSmallStation.View;
  14. using BPASmartClient.CustomResource.UserControls;
  15. using BPASmartClient.CustomResource.UserControls.Model;
  16. using BPASmartClient.CustomResource.UserControls.Enum;
  17. using System.Windows.Media;
  18. using BPASmartClient.CustomResource.UserControls.MessageShow;
  19. using BPASmartClient.CustomResource.Pages.Model;
  20. using BPASmartClient.JXJFoodSmallStation.Model.Siemens;
  21. using BPASmartClient.JXJFoodSmallStation.Model.GVL;
  22. namespace BPASmartClient.JXJFoodSmallStation.ViewModel
  23. {
  24. public class SiemensRecipeReceiveViewModel : ObservableObject
  25. {
  26. //ObservableCollection<RemoteRecipeRawMaterial> RawMaterials { get; set; } = new ObservableCollection<RemoteRecipeRawMaterial>();
  27. public SiemensRecipeReceiveViewModel()
  28. {
  29. Recipes = Json<RemoteRecipeDataColl>.Data.Recipes;
  30. DetailsCommand = new RelayCommand<object>((o) =>
  31. {
  32. if (o != null && o is string cnt)
  33. {
  34. ActionManage.GetInstance.Send("CloseRecipeInfosView");
  35. RecipeInfosView nrv = new RecipeInfosView();
  36. var res = Json<RemoteRecipeDataColl>.Data.Recipes.FirstOrDefault(p => p.RecipeCode == cnt);
  37. if (res != null)
  38. {
  39. ActionManage.GetInstance.Send("RecipeInfo", res);
  40. nrv.Show();
  41. MessageLog.GetInstance.ShowUserLog($"查看配方——{res.RecipeName}");
  42. }
  43. }
  44. });
  45. }
  46. public RelayCommand<object> DetailsCommand { get; set; }
  47. public RelayCommand ClearAllRecipe { get; set; }
  48. public ObservableCollection<RemoteRecipeData> Recipes { get; set; }
  49. }
  50. }