|
- using BPA.Helper;
- using BPASmartClient.SmallBatchingSystem.ViewModels;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Shapes;
-
- namespace BPASmartClient.SmallBatchingSystem.Views
- {
- /// <summary>
- /// NewPfView.xaml 的交互逻辑
- /// </summary>
- public partial class NewRecipeView : Window
- {
- public NewRecipeView()
- {
- InitializeComponent();
- ActionManage.GetInstance.Register(new Action(() => { this.Close(); }), "NewRecipeViewModelClose", true);
- }
-
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- //this.Close();
- }
-
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- //if (Json<ConfigInfoModel>.Data.Recipes.FirstOrDefault(p => p.RecipeName == this.outName.Text) == null)
- //{
- // Json<ConfigInfoModel>.Data.Recipes.Add(new RecipeInfo()
- // {
- // RecipeName = this.outName.Text,
- // SiloInfoModels = NewRecipeViewModel.SiloInfoModels
- // });
- //}
- //else
- //{
- // int index = Array.FindIndex(Json<ConfigInfoModel>.Data.Recipes.ToArray(), p => p.RecipeName == outName.Text);
- // if (index >= 0 && index < Json<ConfigInfoModel>.Data.Recipes.Count)
- // {
- // Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).RecipeName = outName.Text;
- // Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).SiloInfoModels.Clear();
- // NewRecipeViewModel.SiloInfoModels.ToList().ForEach(item =>
- // {
- // Json<ConfigInfoModel>.Data.Recipes.ElementAt(index).SiloInfoModels.Add(item);
- // });
- // }
- //}
- //this.Close();
- }
- }
- }
|