|
|
@ -13,6 +13,7 @@ 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; |
|
|
@ -192,10 +193,42 @@ namespace ProcessManageUI |
|
|
|
{ |
|
|
|
if (DATAGRID_TABLE == 1) |
|
|
|
{ |
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
SQLiteHelpers.Delete("ProcessManage", null, null); |
|
|
|
DataTable data_t = Product.Clone(); |
|
|
|
Product.AcceptChanges(); |
|
|
|
for (int i = 0; i < Product.Rows.Count; i++) |
|
|
|
{ |
|
|
|
data_t.Clear();//清空
|
|
|
|
DataRow dt = Product.Rows[i];//行转换
|
|
|
|
DataRow drT = data_t.NewRow(); |
|
|
|
drT.ItemArray = dt.ItemArray; |
|
|
|
data_t.Rows.InsertAt(drT, 0); |
|
|
|
SQLiteHelpers.InsertData("ProcessManage", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
|
|
|
} |
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
|
|
inf.Text = "染料信息已储存"; |
|
|
|
} |
|
|
|
else if (DATAGRID_TABLE == 2) |
|
|
|
{ |
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
SQLiteHelpers.Delete("Gram", null, null); |
|
|
|
DataTable data_t = Gram.Clone(); |
|
|
|
Product.AcceptChanges(); |
|
|
|
for (int i = 0; i < Gram.Rows.Count; i++) |
|
|
|
{ |
|
|
|
data_t.Clear();//清空
|
|
|
|
DataRow dt = Gram.Rows[i];//行转换
|
|
|
|
DataRow drT = data_t.NewRow(); |
|
|
|
drT.ItemArray = dt.ItemArray; |
|
|
|
data_t.Rows.InsertAt(drT, 0); |
|
|
|
SQLiteHelpers.InsertData("Gram", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
|
|
|
} |
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
|
|
inf.Text = "流程信息已储存"; |
|
|
|
} |
|
|
|
|
|
|
|