Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
c42f44e20e
1 file changed
+22
-30
@@ -201,34 +201,32 @@ namespace DyeingComputer.View
|
|||||||
int a = dt_TP.Rows.Count;
|
int a = dt_TP.Rows.Count;
|
||||||
|
|
||||||
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
|
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
|
||||||
dt_TP.Rows.RemoveAt(d - 1);
|
dt_TP.Rows.RemoveAt(d - 1);
|
||||||
|
|
||||||
Dat();
|
Dat();
|
||||||
Grid.SelectedIndex = -1;
|
Grid.SelectedIndex = -1;
|
||||||
|
|
||||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
SQLiteHelpers.Open(); //打开数据库
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
SQLiteHelpers.Delete("RUN", null, null);
|
SQLiteHelpers.Delete("RUN", null, null);
|
||||||
DataTable data_t = dt_TP.Clone();
|
DataTable data_t = dt_TP.Clone();
|
||||||
a = dt_TP.Rows.Count;
|
a = dt_TP.Rows.Count;
|
||||||
for (int i = 0; i < a; i++)
|
for (int i = 0; i < a; i++)
|
||||||
{
|
{
|
||||||
data_t.Clear();//清空
|
data_t.Clear();//清空
|
||||||
|
|
||||||
DataRow dt = dt_TP.Rows[i];//行转换
|
DataRow dt = dt_TP.Rows[i];//行转换
|
||||||
DataRow drT = data_t.NewRow();
|
DataRow drT = data_t.NewRow();
|
||||||
drT.ItemArray = dt.ItemArray;
|
drT.ItemArray = dt.ItemArray;
|
||||||
data_t.Rows.InsertAt(drT, 0);
|
data_t.Rows.InsertAt(drT, 0);
|
||||||
drT.BeginEdit(); //添加订单号
|
drT.BeginEdit(); //添加订单号
|
||||||
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
drT.EndEdit();
|
drT.EndEdit();
|
||||||
|
|
||||||
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
}
|
}
|
||||||
|
|
||||||
SQLiteHelpers.Close(); //关闭连接
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
// dt_TP = sql.Tables[0]; //转换显示计划表
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
|
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
|
||||||
@@ -304,13 +302,7 @@ namespace DyeingComputer.View
|
|||||||
if (MainWindowViewModel.WORK_RUN == 2) Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
if (MainWindowViewModel.WORK_RUN == 2) Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
|
||||||
if (sql != null)
|
if (sql != null)
|
||||||
{
|
{
|
||||||
// sqlDefaultView = sql.Tables[0].DefaultView;
|
dt_TP= sql.Tables[0];
|
||||||
// Grid.ItemsSource = null;
|
|
||||||
dt_TP= sql.Tables[0];
|
|
||||||
// MainWindowViewModel.TechnologicalProcess_View = MainWindowViewModel.ToObservableCollection<TechnologicalProcess>(sql.Tables[0]);
|
|
||||||
|
|
||||||
// Grid.ItemsSource = dt_m.DE sql.Tables[0].DefaultView; //转换显示计划表
|
|
||||||
// name.Text = Program_Name;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user