diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index c5ab060..d251fb3 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -96,6 +96,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Advance 的本地化字符串。 + /// + public static string Advance { + get { + return ResourceManager.GetString("Advance", resourceCulture); + } + } + /// /// 查找类似 Auto 的本地化字符串。 /// @@ -114,6 +123,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Beginning 的本地化字符串。 + /// + public static string Beginning { + get { + return ResourceManager.GetString("Beginning", resourceCulture); + } + } + /// /// 查找类似 CallDistribution 的本地化字符串。 /// @@ -186,6 +204,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Curve 的本地化字符串。 + /// + public static string Curve { + get { + return ResourceManager.GetString("Curve", resourceCulture); + } + } + /// /// 查找类似 Curve 的本地化字符串。 /// @@ -384,6 +411,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Mixing 的本地化字符串。 + /// + public static string Mixing { + get { + return ResourceManager.GetString("Mixing", resourceCulture); + } + } + /// /// 查找类似 New 的本地化字符串。 /// @@ -762,6 +798,15 @@ namespace DyeingComputer.Properties { } } + /// + /// 查找类似 Type 的本地化字符串。 + /// + public static string Type { + get { + return ResourceManager.GetString("Type", resourceCulture); + } + } + /// /// 查找类似 Washing 的本地化字符串。 /// diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx index 19e6b60..d3b4791 100644 --- a/Properties/Resources.en-US.resx +++ b/Properties/Resources.en-US.resx @@ -366,4 +366,19 @@ Tank + + Beginning + + + Type + + + Advance + + + Curve + + + Mixing + \ No newline at end of file diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 10b4c81..121233b 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -342,15 +342,27 @@ YES + + Advance + + + Beginning + Container + + Curve + Headwaters Medicine + + Mixing + Number @@ -366,4 +378,7 @@ Target + + Type + \ No newline at end of file diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx index 2647160..806f5d7 100644 --- a/Properties/Resources.zh-CN.resx +++ b/Properties/Resources.zh-CN.resx @@ -366,4 +366,19 @@ + + 提前 + + + 开头 + + + 类型 + + + 搅拌 + + + 曲线 + \ No newline at end of file diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx index 4d79fd5..0457c45 100644 --- a/Properties/Resources.zh-TW.resx +++ b/Properties/Resources.zh-TW.resx @@ -366,4 +366,19 @@ + + 類別 + + + 開始 + + + 提前 + + + 曲線 + + + 攪拌 + \ No newline at end of file diff --git a/View/ProgramgroupView.xaml.cs b/View/ProgramgroupView.xaml.cs index f0bca9d..df5be1b 100644 --- a/View/ProgramgroupView.xaml.cs +++ b/View/ProgramgroupView.xaml.cs @@ -90,6 +90,7 @@ namespace DyeingComputer.View SQLiteHelpers.InsertData("ProgramName", Program_new);// 执行插入 SQLiteHelpers.Close(); //关闭连接 + Programgroup_Numder = VALUE; Programgroup_ID = ID; Programgroup_sql(); @@ -97,6 +98,7 @@ namespace DyeingComputer.View private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除 { + if(Programgroup_Numder == null)return; ///弹窗提示确认删除 if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm + Properties.Resources.Delete + Programgroup_Numder, "Delete ", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK) diff --git a/View/ProgramstepsView .xaml.cs b/View/ProgramstepsView .xaml.cs index d649f1b..9105ec3 100644 --- a/View/ProgramstepsView .xaml.cs +++ b/View/ProgramstepsView .xaml.cs @@ -9,6 +9,7 @@ using System.Data.SQLite; using System.Diagnostics.Eventing.Reader; using System.Linq; using System.Net; +using System.Net.NetworkInformation; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; @@ -23,6 +24,7 @@ using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using static DyeingComputer.UserClass.SqliteHelper; +using static DyeingComputer.Windows.ViewStep; namespace DyeingComputer.View { @@ -54,7 +56,7 @@ namespace DyeingComputer.View SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径 SQLiteHelpers.Open(); //打开数据库 - string sql_script = "select * from ProgramSteps where ProgramID='" + ProgramID + "' order by Step desc"; + string sql_script = "select * from ProgramSteps where ProgramID='" + ProgramID + "' order by Step asc"; if (sql != null) sql.Clear(); //清空缓存 sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存 @@ -97,10 +99,40 @@ namespace DyeingComputer.View private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)//编辑 { + if(ID == null) ID = sql.Tables[0].Rows.Count.ToString(); ViewStep viewstop = new ViewStep(); + viewstop.AddressUpdated += new ViewStep.AddressUpdateHandler(Address_ButtonClicked); viewstop.data = ID; viewstop.ShowDialog(); } + private void Address_ButtonClicked(object sender, AddressUpdateEventArgs e)//编辑返回结果 + { + int i = sql.Tables[0].Rows.Count; + int n = StrToInt.To16Convert10(ID); + if (i == n) + { + DataRow dr_ = sql.Tables[0].NewRow();//添加表数据 + dr_["ProgramID"] = ProgramID; + dr_["Program"] = ProgramNAME; + sql.Tables[0].Rows.Add(dr_); + Dat(); + ID = (n+1).ToString(); + } + + DataRow dr = sql.Tables[0].Rows[n-1]; + dr.BeginEdit(); + dr["StepID"] = e.StepID; + dr["StepName"] = e.StepNAME; + dr["ParameterName"] = e.PNAME; + dr["Parameter1"] = e.P1; + dr["Parameter2"] = e.P2; + dr["Parameter3"] = e.P3; + dr["Parameter4"] = e.P4; + dr["Parameter5"] = e.P5; + dr.EndEdit(); + + Grid.ItemsSource = sql.Tables[0].DefaultView; + } private void ProgramgroupView_Quit_Click(object sender, RoutedEventArgs e)//退出 { @@ -173,25 +205,6 @@ namespace DyeingComputer.View } } - - public struct Date - { - public string Step { get; set; } - public string StepID { get; set; } - public string StepNAME { get; set; } - public string PNAME { get; set; } - public string P1 { get; set; } - public string P2 { get; set; } - public string P3 { get; set; } - public string P4 { get; set; } - public string P5 { get; set; } - public string P6 { get; set; } - public string P7 { get; set; } - public string P8 { get; set; } - public string P9 { get; set; } - public string P10 { get; set; } - - } } diff --git a/Windows/ViewStep.xaml b/Windows/ViewStep.xaml index 77c71ae..4c8c30f 100644 --- a/Windows/ViewStep.xaml +++ b/Windows/ViewStep.xaml @@ -18,19 +18,19 @@ + Text="0" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" MaxLength="3"/> + Text="0" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" MaxLength="3"/> + Text="0" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" MaxLength="3"/> + Text="0" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" MaxLength="3"/> + Text="0" PreviewTextInput="Tb_KeyPress" InputMethod.IsInputMethodEnabled="False" FontSize="20" HorizontalContentAlignment="Right" MaxLength="3"/>