终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LocalConfigureViewModel.cs 1.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using BPASmartClient.MorkMOC;
  2. using CommunityToolkit.Mvvm.Input;
  3. using Newtonsoft.Json;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Collections.ObjectModel;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows;
  12. namespace BPASmartClient.MilkWithTea.ViewModel
  13. {
  14. partial class LocalConfigureViewModel : ObservableObject
  15. {
  16. #region 本地奶茶配方
  17. /// <summary>
  18. /// 本地奶茶配方列表
  19. /// </summary>
  20. public ObservableCollection<LocalRecipe> localMaterialRecipes { get; set; } = Json<JsonLocalRecipes>.Data.localRecipes;
  21. /// <summary>
  22. /// 删除配方奶茶
  23. /// </summary>
  24. [RelayCommand]
  25. private void DeleteRecipe(object o)
  26. {
  27. if (o == null) return;
  28. if(o is string id)
  29. {
  30. var res = localMaterialRecipes.FirstOrDefault(p => p.RecipeID == id);
  31. if (res != null)
  32. {
  33. localMaterialRecipes.Remove(res);
  34. Json<JsonLocalRecipes>.Save();
  35. }
  36. }
  37. }
  38. #endregion
  39. #region 物料位置名称
  40. /// <summary>
  41. /// 物料位置名称集合
  42. /// </summary>
  43. public ObservableCollection<LocalMaterail> localMaterails { get; set; } = Json<JsonLocalRecipes>.Data.localMaterails;
  44. /// <summary>
  45. /// 更新物料位置
  46. /// </summary>
  47. [RelayCommand]
  48. private void UpdateMaterialPosion()
  49. {
  50. Json<JsonLocalRecipes>.Save();
  51. }
  52. #endregion
  53. public LocalConfigureViewModel()
  54. {
  55. }
  56. }
  57. }