Merge branch 'master' of http://www.scserverddns.top:13000/sc/DyeingComputer
This commit is contained in:
commit
b4adafdc2a
2 files changed
+43
-22
No files matched your search
+14
-18
@@ -197,15 +197,15 @@ namespace DyeingComputer.UserClass
|
|||||||
int d = Convert.ToInt16( dat_821.GetValue("ID"));
|
int d = Convert.ToInt16( dat_821.GetValue("ID"));
|
||||||
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
||||||
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
||||||
|
/**插入行**/
|
||||||
string ProgramID = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString();
|
string ProgramID = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select ProgramID from RUN where Step = '1'", null).ToString();
|
||||||
string ProgramNAME = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
|
string ProgramNAME = TechnologicalProcessView.SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
|
||||||
TechnologicalProcessView.SQLiteHelpers.Close();
|
// TechnologicalProcessView.SQLiteHelpers.Close();
|
||||||
DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据
|
DataRow dr = TechnologicalProcessView.sql.Tables[0].NewRow();//添加表数据
|
||||||
dr["ProgramID"] = ProgramID;
|
dr["ProgramID"] = ProgramID;
|
||||||
dr["Program"] = ProgramNAME;
|
dr["Program"] = ProgramNAME;
|
||||||
TechnologicalProcessView.sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
TechnologicalProcessView.sql.Tables[0].Rows.InsertAt(dr, d - 1);
|
||||||
|
/**编辑行号**/
|
||||||
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
||||||
for (int i = 0; i < a; i++)
|
for (int i = 0; i < a; i++)
|
||||||
{
|
{
|
||||||
@@ -214,7 +214,7 @@ namespace DyeingComputer.UserClass
|
|||||||
drt["Step"] = i + 1;
|
drt["Step"] = i + 1;
|
||||||
drt.EndEdit();
|
drt.EndEdit();
|
||||||
}
|
}
|
||||||
|
/**编辑行信息**/
|
||||||
DataRow drtt = TechnologicalProcessView.sql.Tables[0].Rows[d - 1];
|
DataRow drtt = TechnologicalProcessView.sql.Tables[0].Rows[d - 1];
|
||||||
drtt.BeginEdit();
|
drtt.BeginEdit();
|
||||||
drtt["StepID"] = dat_821.GetValue("STEPID").ToString();
|
drtt["StepID"] = dat_821.GetValue("STEPID").ToString();
|
||||||
@@ -230,14 +230,12 @@ namespace DyeingComputer.UserClass
|
|||||||
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
|
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
|
||||||
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
|
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
|
||||||
_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
||||||
|
/**存入信息**/
|
||||||
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
|
||||||
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
|
||||||
TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null);
|
TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null);
|
||||||
DataTable data_t = new DataTable();
|
DataTable data_t = new DataTable();
|
||||||
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
|
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
|
||||||
data_t = TechnologicalProcessView.sql.Tables[0].Clone();
|
data_t = TechnologicalProcessView.sql.Tables[0].Clone();
|
||||||
int a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
a = TechnologicalProcessView.sql.Tables[0].Rows.Count;
|
||||||
for (int i = 0; i < a; i++)
|
for (int i = 0; i < a; i++)
|
||||||
{
|
{
|
||||||
data_t.Clear();//清空
|
data_t.Clear();//清空
|
||||||
@@ -246,19 +244,18 @@ namespace DyeingComputer.UserClass
|
|||||||
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);
|
||||||
dr.BeginEdit(); //添加订单号
|
drT.BeginEdit(); //添加订单号
|
||||||
dr["DYELOT"] = MainWindowViewModel.WorkNumder;
|
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
dr.EndEdit();
|
drT.EndEdit();
|
||||||
|
|
||||||
TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
}
|
}
|
||||||
|
|
||||||
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
|
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
|
||||||
}//插入
|
}//插入
|
||||||
else if (dat_821.GetValue("INSTRUCTION").ToString() == "EDIT")
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "EDIT")
|
||||||
{
|
{
|
||||||
int n = Convert.ToInt16(dat_821.GetValue("ID").ToString());
|
int n = Convert.ToInt16(dat_821.GetValue("ID").ToString());
|
||||||
|
/**编辑行信息**/
|
||||||
DataRow dr = TechnologicalProcessView.sql.Tables[0].Rows[n - 1];
|
DataRow dr = TechnologicalProcessView.sql.Tables[0].Rows[n - 1];
|
||||||
dr.BeginEdit();
|
dr.BeginEdit();
|
||||||
dr["StepID"] = dat_821.GetValue("STEPID").ToString();
|
dr["StepID"] = dat_821.GetValue("STEPID").ToString();
|
||||||
@@ -274,7 +271,7 @@ namespace DyeingComputer.UserClass
|
|||||||
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
|
var _TechnologicalProcessView = Application.Current.Windows.Cast<UserControl>().FirstOrDefault(window => window is TechnologicalProcessView) as TechnologicalProcessView;//跨页面
|
||||||
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
|
_TechnologicalProcessView.Grid.ItemsSource = TechnologicalProcessView.sql.Tables[0].DefaultView;
|
||||||
_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
_TechnologicalProcessView.Grid.SelectedIndex = -1;
|
||||||
|
/**存入信息**/
|
||||||
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
TechnologicalProcessView.SQLiteHelpers = new SQLiteHelper(TechnologicalProcessView.DBAddress); //数据库连接路径
|
||||||
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
TechnologicalProcessView.SQLiteHelpers.Open(); //打开数据库
|
||||||
TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null);
|
TechnologicalProcessView.SQLiteHelpers.Delete("RUN", null, null);
|
||||||
@@ -290,13 +287,12 @@ namespace DyeingComputer.UserClass
|
|||||||
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);
|
||||||
dr.BeginEdit(); //添加订单号
|
drT.BeginEdit(); //添加订单号
|
||||||
dr["DYELOT"] = MainWindowViewModel.WorkNumder;
|
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
dr.EndEdit();
|
drT.EndEdit();
|
||||||
|
|
||||||
TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
TechnologicalProcessView.SQLiteHelpers.InsertData("RUN", TechnologicalProcessView.SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
}
|
}
|
||||||
|
|
||||||
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
|
TechnologicalProcessView.SQLiteHelpers.Close(); //关闭连接
|
||||||
}//编辑
|
}//编辑
|
||||||
else if (dat_821.GetValue("INSTRUCTION").ToString() == "DELETE")
|
else if (dat_821.GetValue("INSTRUCTION").ToString() == "DELETE")
|
||||||
|
|||||||
@@ -177,9 +177,9 @@ namespace DyeingComputer.View
|
|||||||
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);
|
||||||
dr.BeginEdit(); //添加订单号
|
drT.BeginEdit(); //添加订单号
|
||||||
dr["DYELOT"] = MainWindowViewModel.WorkNumder;
|
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
dr.EndEdit();
|
drT.EndEdit();
|
||||||
|
|
||||||
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
}
|
}
|
||||||
@@ -202,12 +202,37 @@ namespace DyeingComputer.View
|
|||||||
int d = 0;
|
int d = 0;
|
||||||
int a = sql.Tables[0].Rows.Count;
|
int a = sql.Tables[0].Rows.Count;
|
||||||
|
|
||||||
if (ID != null) { d = StrToInt.To16Convert10(ID); } else { return; }
|
if (ID != null) { d = Convert.ToInt16(ID); } else { return; }
|
||||||
if (a != d)//如果删除不是最后一行执行
|
if (a != d)//如果删除不是最后一行执行
|
||||||
{
|
{
|
||||||
sql.Tables[0].Rows.RemoveAt(d - 1);
|
sql.Tables[0].Rows.RemoveAt(d - 1);
|
||||||
|
|
||||||
Dat();
|
Dat();
|
||||||
|
Grid.SelectedIndex = -1;
|
||||||
|
|
||||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
SQLiteHelpers.Delete("RUN", null, null);
|
||||||
|
DataTable data_t = new DataTable();
|
||||||
|
data_t.Columns.Add("DYELOT", typeof(string)); //添加列
|
||||||
|
data_t = sql.Tables[0].Clone();
|
||||||
|
a = sql.Tables[0].Rows.Count;
|
||||||
|
for (int i = 0; i < a; i++)
|
||||||
|
{
|
||||||
|
data_t.Clear();//清空
|
||||||
|
|
||||||
|
DataRow dt = sql.Tables[0].Rows[i];//行转换
|
||||||
|
DataRow drT = data_t.NewRow();
|
||||||
|
drT.ItemArray = dt.ItemArray;
|
||||||
|
data_t.Rows.InsertAt(drT, 0);
|
||||||
|
drT.BeginEdit(); //添加订单号
|
||||||
|
drT["DYELOT"] = MainWindowViewModel.WorkNumder;
|
||||||
|
drT.EndEdit();
|
||||||
|
|
||||||
|
SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
||||||
|
}
|
||||||
|
|
||||||
|
SQLiteHelpers.Close(); //关闭连接
|
||||||
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user