diff --git a/View/TechnologicalProcessView.xaml b/View/TechnologicalProcessView.xaml index 035445c..52e5672 100644 --- a/View/TechnologicalProcessView.xaml +++ b/View/TechnologicalProcessView.xaml @@ -133,6 +133,16 @@ + + + + + diff --git a/ViewModel/MainWindowViewModel.cs b/ViewModel/MainWindowViewModel.cs index 5b0e561..39f3234 100644 --- a/ViewModel/MainWindowViewModel.cs +++ b/ViewModel/MainWindowViewModel.cs @@ -2686,6 +2686,7 @@ namespace DyeingComputer.ViewModel public string Parameter9 { get; set; } public string Parameter10 { get; set; } public string DYELOT { get; set; } + public string Remark { get; set; } } public ObservableCollection ToObservableCollection(DataTable dt) where T : class, new() { diff --git a/Windows/ViewStep.xaml b/Windows/ViewStep.xaml index fb6b0a0..b0fc04f 100644 --- a/Windows/ViewStep.xaml +++ b/Windows/ViewStep.xaml @@ -9,7 +9,7 @@ WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Title="SUNLIGHT 800" Height="800" Width="600"> - + diff --git a/Windows/ViewStep.xaml.cs b/Windows/ViewStep.xaml.cs index ab8a739..6a8c987 100644 --- a/Windows/ViewStep.xaml.cs +++ b/Windows/ViewStep.xaml.cs @@ -20,6 +20,7 @@ using System.Windows.Media.Imaging; using System.Windows.Shapes; using System.Xml.Linq; using TouchSocket.Core; +using static DyeingComputer.ViewModel.MainWindowViewModel; namespace DyeingComputer.Windows { @@ -158,9 +159,12 @@ namespace DyeingComputer.Windows { try { - dat_D.BeginEdit(); - dat_D["Parameter1"] = Convert.ToDouble(P1.Text); - dat_D.EndEdit(); + if (dat_D!=null) + { + dat_D.BeginEdit(); + dat_D["Parameter1"] = Convert.ToDouble(P1.Text); + dat_D.EndEdit(); + } } catch (Exception) { } } @@ -168,9 +172,12 @@ namespace DyeingComputer.Windows { try { - dat_D.BeginEdit(); - dat_D["Parameter2"] = Convert.ToDouble(P2.Text); - dat_D.EndEdit(); + if (dat_D != null) + { + dat_D.BeginEdit(); + dat_D["Parameter2"] = Convert.ToDouble(P2.Text); + dat_D.EndEdit(); + } } catch (Exception) { } } @@ -178,9 +185,12 @@ namespace DyeingComputer.Windows { try { - dat_D.BeginEdit(); - dat_D["Parameter3"] = Convert.ToDouble(P3.Text); - dat_D.EndEdit(); + if (dat_D != null) + { + dat_D.BeginEdit(); + dat_D["Parameter3"] = Convert.ToDouble(P3.Text); + dat_D.EndEdit(); + } } catch (Exception) { } } @@ -188,9 +198,12 @@ namespace DyeingComputer.Windows { try { - dat_D.BeginEdit(); - dat_D["Parameter4"] = Convert.ToDouble(P4.Text); - dat_D.EndEdit(); + if (dat_D != null) + { + dat_D.BeginEdit(); + dat_D["Parameter4"] = Convert.ToDouble(P4.Text); + dat_D.EndEdit(); + } } catch (Exception) { } } @@ -198,9 +211,12 @@ namespace DyeingComputer.Windows { try { - dat_D.BeginEdit(); - dat_D["Parameter5"] = Convert.ToDouble(P5.Text); - dat_D.EndEdit(); + if (dat_D != null) + { + dat_D.BeginEdit(); + dat_D["Parameter5"] = Convert.ToDouble(P5.Text); + dat_D.EndEdit(); + } } catch (Exception) { } } @@ -444,11 +460,11 @@ namespace DyeingComputer.Windows int i = boxID.SelectedIndex; boxNAME.Text = id_dat.ElementAt(i); Set(id_dat[i]); - P1.Text.Remove(0); - P2.Text.Remove(0); - P3.Text.Remove(0); - P4.Text.Remove(0); - P5.Text.Remove(0); + P1.Text ="0"; + P2.Text = "0"; + P3.Text = "0"; + P4.Text = "0"; + P5.Text = "0"; } } private void boxIDp_SelectionChanged(object sender, SelectionChangedEventArgs e) @@ -478,11 +494,11 @@ namespace DyeingComputer.Windows dat_D.EndEdit(); } - P1P.Text.Remove(0); - P2P.Text.Remove(0); - P3P.Text.Remove(0); - P4P.Text.Remove(0); - P5P.Text.Remove(0); + P1P.Text = "0"; + P2P.Text = "0"; + P3P.Text = "0"; + P4P.Text = "0"; + P5P.Text = "0"; } private void YES_Click(object sender, RoutedEventArgs e)//确认 {