终端一体化运控平台
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.
 
 
 

62 lines
2.1 KiB

  1. using BPA.Helper;
  2. using BPASmartClient.SmallBatchingSystem.ViewModels;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Shapes;
  16. namespace BPASmartClient.SmallBatchingSystem.Views
  17. {
  18. /// <summary>
  19. /// NewPfView.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class NewRecipeView : Window
  22. {
  23. public NewRecipeView()
  24. {
  25. InitializeComponent();
  26. ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "NewRecipeViewModelClose", true);
  27. }
  28. private void Button_Click_1(object sender, RoutedEventArgs e)
  29. {
  30. //this.Close();
  31. }
  32. private void Button_Click(object sender, RoutedEventArgs e)
  33. {
  34. //if (Json<ConfigInfoModel>.Data.Recipes.FirstOrDefault(p => p.RecipeName == this.outName.Text) == null)
  35. //{
  36. // Json<ConfigInfoModel>.Data.Recipes.Add(new RecipeInfo()
  37. // {
  38. // RecipeName = this.outName.Text,
  39. // SiloInfoModels = NewRecipeViewModel.SiloInfoModels
  40. // });
  41. //}
  42. //else
  43. //{
  44. // int index = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == outName.Text);
  45. // if (index >= 0 && index < Json<ConfigInfoModel>.Data.Recipes.Count)
  46. // {
  47. // Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).RecipeName = outName.Text;
  48. // Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).SiloInfoModels.Clear();
  49. // NewRecipeViewModel.SiloInfoModels.ToList().ForEach(item =>
  50. // {
  51. // Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).SiloInfoModels.Add(item);
  52. // });
  53. // }
  54. //}
  55. //this.Close();
  56. }
  57. }
  58. }