diff --git a/DyeingComputer.csproj b/DyeingComputer.csproj
index 9e5a76c..c5ea206 100644
--- a/DyeingComputer.csproj
+++ b/DyeingComputer.csproj
@@ -115,6 +115,9 @@
ParameterSetView.xaml
+
+ ProgramstepsView .xaml
+
ProgramgroupView.xaml
@@ -166,6 +169,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs
index e92684a..f342bc2 100644
--- a/Properties/Resources.Designer.cs
+++ b/Properties/Resources.Designer.cs
@@ -96,6 +96,15 @@ namespace DyeingComputer.Properties {
}
}
+ ///
+ /// 查找类似 Code 的本地化字符串。
+ ///
+ public static string Code {
+ get {
+ return ResourceManager.GetString("Code", resourceCulture);
+ }
+ }
+
///
/// 查找类似 Confirm 的本地化字符串。
///
@@ -123,6 +132,15 @@ namespace DyeingComputer.Properties {
}
}
+ ///
+ /// 查找类似 Directives 的本地化字符串。
+ ///
+ public static string Directives {
+ get {
+ return ResourceManager.GetString("Directives", resourceCulture);
+ }
+ }
+
///
/// 查找类似 edit 的本地化字符串。
///
@@ -177,6 +195,15 @@ namespace DyeingComputer.Properties {
}
}
+ ///
+ /// 查找类似 ID 的本地化字符串。
+ ///
+ public static string ID {
+ get {
+ return ResourceManager.GetString("ID", resourceCulture);
+ }
+ }
+
///
/// 查找类似 I/O 的本地化字符串。
///
diff --git a/Properties/Resources.en-US.resx b/Properties/Resources.en-US.resx
index ec3d069..7dcd64f 100644
--- a/Properties/Resources.en-US.resx
+++ b/Properties/Resources.en-US.resx
@@ -228,4 +228,13 @@
Rename
+
+ ID
+
+
+ Directives
+
+
+ Code
+
\ No newline at end of file
diff --git a/Properties/Resources.resx b/Properties/Resources.resx
index bd0afad..323762b 100644
--- a/Properties/Resources.resx
+++ b/Properties/Resources.resx
@@ -228,4 +228,13 @@
Step
+
+ Code
+
+
+ Directives
+
+
+ ID
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-CN.resx b/Properties/Resources.zh-CN.resx
index 9cb1990..0b483ca 100644
--- a/Properties/Resources.zh-CN.resx
+++ b/Properties/Resources.zh-CN.resx
@@ -228,4 +228,13 @@
重命名
+
+ ID
+
+
+ 指令
+
+
+ 代码
+
\ No newline at end of file
diff --git a/Properties/Resources.zh-TW.resx b/Properties/Resources.zh-TW.resx
index 30b26f1..a386d1a 100644
--- a/Properties/Resources.zh-TW.resx
+++ b/Properties/Resources.zh-TW.resx
@@ -228,4 +228,13 @@
重新命名
+
+ ID
+
+
+ 指令
+
+
+ 代碼
+
\ No newline at end of file
diff --git a/View/ProgramgroupView.xaml b/View/ProgramgroupView.xaml
index 3d586d9..daaa384 100644
--- a/View/ProgramgroupView.xaml
+++ b/View/ProgramgroupView.xaml
@@ -14,8 +14,7 @@
-
-
+
-
+
diff --git a/View/ProgramgroupView.xaml.cs b/View/ProgramgroupView.xaml.cs
index a0f5abe..14cf731 100644
--- a/View/ProgramgroupView.xaml.cs
+++ b/View/ProgramgroupView.xaml.cs
@@ -50,14 +50,15 @@ namespace DyeingComputer.View
SQLiteHelpers.Close(); //关闭连接
- Programgroup_Numder = null;
- Programgroup_ID = null;
//sql.Clear(); //清除缓存
//System.GC.Collect();
}
private void ProgramgroupView_edit_Click(object sender, RoutedEventArgs e)
{
+ if (Programgroup_ID == null) return;
+
+ container.Content = new ProgramstepsView();
}
@@ -90,6 +91,8 @@ namespace DyeingComputer.View
SQLiteHelpers.InsertData("ProgramName", Program_new);// 执行插入
SQLiteHelpers.Close(); //关闭连接
+ Programgroup_ID = ID;
+
Programgroup_sql();
}
@@ -106,10 +109,13 @@ namespace DyeingComputer.View
SQLiteHelpers.Close();
Programgroup_sql();
}
+ Programgroup_Numder = null;
+ Programgroup_ID = null;
}
private void ProgramgroupView_Rename_Click(object sender, RoutedEventArgs e)//重命名按钮
{
+ if (Programgroup_ID == null) return;
InputBox frm = new InputBox();
frm.Accept += new EventHandler(InputBox_Rename_accept);
frm.ShowDialog();
@@ -130,15 +136,39 @@ namespace DyeingComputer.View
SQLiteHelpers.Close(); //关闭连接
Programgroup_sql();
+ Programgroup_Numder = null;
+ Programgroup_ID = null;
+ }
+
+ private void ProgramgroupView_Remark_Click(object sender, RoutedEventArgs e)//备注
+ {
+ if (Programgroup_ID == null) return;
+ InputBox frm = new InputBox();
+ frm.Accept += new EventHandler(InputBox_Remark_accept);
+ frm.ShowDialog();
}
- private void ProgramgroupView_Remark_Click(object sender, RoutedEventArgs e)
+ void InputBox_Remark_accept(object sender, EventArgs e)//备注按钮窗口返回
{
+ //事件的接收者通过一个简单的类型转换得到InputBox的引用
+ InputBox frm = (InputBox)sender;
+ //接收到InputBox的TextBox值
+ string VALUE = frm.InputValue;
+ Dictionary Program_Remark = new Dictionary();//缓存函数
+ Program_Remark.Add("Notes", VALUE);
+
+ SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
+ SQLiteHelpers.Open(); //打开数据库
+ SQLiteHelpers.Update("ProgramName", Program_Remark, "ProgramID='" + Programgroup_ID + "'", null);
+ SQLiteHelpers.Close(); //关闭连接
+ Programgroup_sql();
+ Programgroup_Numder = null;
+ Programgroup_ID = null;
}
- string Programgroup_Numder;
- string Programgroup_ID;
+ string Programgroup_Numder = null;
+ string Programgroup_ID = null;
private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
{
int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
diff --git a/View/ProgramstepsView .xaml b/View/ProgramstepsView .xaml
new file mode 100644
index 0000000..ca7613a
--- /dev/null
+++ b/View/ProgramstepsView .xaml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/View/ProgramstepsView .xaml.cs b/View/ProgramstepsView .xaml.cs
new file mode 100644
index 0000000..7d4c1f9
--- /dev/null
+++ b/View/ProgramstepsView .xaml.cs
@@ -0,0 +1,69 @@
+using DyeingComputer.UserClass;
+using DyeingComputer.Windows;
+using formula_manage.UserClass;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net;
+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.Animation;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using static DyeingComputer.UserClass.SqliteHelper;
+
+namespace DyeingComputer.View
+{
+ ///
+ /// ProgramgroupView.xaml 的交互逻辑
+ ///
+ public partial class ProgramstepsView : UserControl
+ {
+ public ProgramstepsView()
+ {
+ InitializeComponent();
+ Programgroup_sql();
+ }
+
+ private SQLiteHelper SQLiteHelpers = null; //定义数据库
+ private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
+ DataSet sql; //内存数据缓存
+
+ public void Programgroup_sql()
+ {
+ SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
+ SQLiteHelpers.Open(); //打开数据库
+
+ string sql_script = "select * from ProgramName order by ProgramID desc";
+
+ if (sql != null) sql.Clear(); //清空缓存
+ sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取计划表写入缓存
+ // if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
+
+ SQLiteHelpers.Close(); //关闭连接
+
+ //sql.Clear(); //清除缓存
+ //System.GC.Collect();
+ }
+
+ string Programgroup_Numder = null;
+ string Programgroup_ID = null;
+ private void Grid_SelectionChanged(object sender, SelectionChangedEventArgs e)//表格选择事件
+ {
+ int rownum = Grid.SelectedIndex;//获取鼠标选中行并定义变量
+ if (rownum != -1)//判断鼠标定位是否有效
+ {
+ Programgroup_ID = (Grid.Columns[0].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第0列,
+ Programgroup_Numder = (Grid.Columns[1].GetCellContent(Grid.Items[rownum]) as TextBlock).Text;//定位第1列,
+ }
+ }
+ }
+}
diff --git a/View/WorkOrderView.xaml.cs b/View/WorkOrderView.xaml.cs
index 458d2e9..7dcea9f 100644
--- a/View/WorkOrderView.xaml.cs
+++ b/View/WorkOrderView.xaml.cs
@@ -87,6 +87,7 @@ namespace DyeingComputer.View
private void WorkOrderView_lock_Click(object sender, RoutedEventArgs e)//锁定按钮
{
+ if (WorkOrder_Numder == null) return;
Dictionary lock_v = new Dictionary();//缓存函数
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
@@ -107,11 +108,12 @@ namespace DyeingComputer.View
private void WorkOrderView_new_Click(object sender, RoutedEventArgs e)//新建按钮
{
- WpfPlot();
+
}
private void WorkOrderView_del_Click(object sender, RoutedEventArgs e)//删除按钮
{
+ if (WorkOrder_Numder == null) return;
///弹窗提示确认删除
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm + Properties.Resources.Delete + WorkOrder_Numder , "Delete ",
System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)