|
|
@ -268,13 +268,12 @@ namespace DyeingComputer.View |
|
|
|
public static object workName; |
|
|
|
public static SQLiteHelper SQLiteHelpers = null; //定义数据库
|
|
|
|
public static readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
|
|
|
|
public static DataSet sql; //内存数据缓存
|
|
|
|
//public static DataSet sql; //内存数据缓存
|
|
|
|
string Numder = null; |
|
|
|
string ID = null; |
|
|
|
string P1 = "0", P2 = "0", P3 = "0", P4 = "0", P5 = "0"; |
|
|
|
object P1_S1, P2_S1, P3_S1, P4_S1, P5_S1, P1_S2, P2_S2, P3_S2, P4_S2, P5_S2, P1_S3, P2_S3, P3_S3, P4_S3, P5_S3; |
|
|
|
|
|
|
|
private void TechnologicalProcess_Import() |
|
|
|
|
|
|
|
/* private void TechnologicalProcess_Import() |
|
|
|
{ |
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
@ -304,7 +303,7 @@ namespace DyeingComputer.View |
|
|
|
r = SQLiteHelpers.InsertData("RUN", SQLiteHelpers.DataTableToDictionary(data_t));//行插入
|
|
|
|
} |
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
} |
|
|
|
}*/ |
|
|
|
private void TechnologicalProcess_sql() |
|
|
|
{ |
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
@ -343,7 +342,7 @@ namespace DyeingComputer.View |
|
|
|
ID = null; |
|
|
|
if (e.PNAME != "") |
|
|
|
{ |
|
|
|
DataRow dr = sql.Tables[0].Rows[n - 1]; |
|
|
|
DataRow dr = MainWindowViewModel.dt_TP.Rows[n - 1]; |
|
|
|
dr.BeginEdit(); |
|
|
|
dr["StepID"] = e.StepID; |
|
|
|
dr["StepName"] = e.StepNAME; |
|
|
@ -355,7 +354,7 @@ namespace DyeingComputer.View |
|
|
|
dr["Parameter5"] = e.P5; |
|
|
|
dr.EndEdit(); |
|
|
|
|
|
|
|
MainWindowViewModel.dt_TP = sql.Tables[0]; |
|
|
|
// MainWindowViewModel.dt_TP = sql.Tables[0];
|
|
|
|
GridSTEP.SelectedIndex = -1; |
|
|
|
} |
|
|
|
else |
|
|
@ -436,13 +435,39 @@ namespace DyeingComputer.View |
|
|
|
SQLiteHelpers.Close(); |
|
|
|
|
|
|
|
if (ID != null) { d = Convert.ToInt16(ID); } else { return; } |
|
|
|
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
|
|
|
|
DataRow dr = MainWindowViewModel.dt_TP.NewRow();//添加表数据
|
|
|
|
//
|
|
|
|
dr["WorkOrder"] = MainWindowViewModel.WorkNumder; |
|
|
|
dr["ProgramID"] = ProgramID; |
|
|
|
dr["Program"] = ProgramNAME; |
|
|
|
dr["Program"] = ProgramNAME; |
|
|
|
dr["Parameter1"] = 0; |
|
|
|
dr["Parameter2"] = 0; |
|
|
|
dr["Parameter3"] = 0; |
|
|
|
dr["Parameter4"] = 0; |
|
|
|
dr["Parameter5"] = 0; |
|
|
|
dr["Parameter6"] = 0; |
|
|
|
dr["Parameter7"] = 0; |
|
|
|
dr["Parameter8"] = 0; |
|
|
|
dr["Parameter9"] = 0; |
|
|
|
dr["Parameter10"] = 0; |
|
|
|
dr["Parameter1_S1"] = 0; |
|
|
|
dr["Parameter2_S1"] = 0; |
|
|
|
dr["Parameter3_S1"] = 0; |
|
|
|
dr["Parameter4_S1"] = 0; |
|
|
|
dr["Parameter5_S1"] = 0; |
|
|
|
dr["Parameter1_S2"] = 0; |
|
|
|
dr["Parameter2_S2"] = 0; |
|
|
|
dr["Parameter3_S2"] = 0; |
|
|
|
dr["Parameter4_S2"] = 0; |
|
|
|
dr["Parameter5_S2"] = 0; |
|
|
|
dr["Parameter1_S3"] = 0; |
|
|
|
dr["Parameter2_S3"] = 0; |
|
|
|
dr["Parameter3_S3"] = 0; |
|
|
|
dr["Parameter4_S3"] = 0; |
|
|
|
dr["Parameter5_S3"] = 0; |
|
|
|
MainWindowViewModel.dt_TP.Rows.InsertAt(dr, d - 1); |
|
|
|
// ID = null;
|
|
|
|
Dat(); |
|
|
|
|
|
|
|
APILog.LOGlog(MainWindowViewModel.WorkNumder.ToString(), "UserActions", "Insert", "STEP = "+ID); |
|
|
|
if (ID == null) return;// ID = MainWindowViewModel.dt_TP.Rows.Count.ToString();
|
|
|
|
ViewStep viewstop = new ViewStep(null, MainWindowViewModel.dt_TP.Select("STEP = " + ID).First()); |
|
|
@ -458,7 +483,7 @@ namespace DyeingComputer.View |
|
|
|
ID = null; |
|
|
|
if (e.PNAME != "") |
|
|
|
{ |
|
|
|
DataRow dr = sql.Tables[0].Rows[n - 1]; |
|
|
|
DataRow dr = MainWindowViewModel.dt_TP.Rows[n - 1]; |
|
|
|
dr.BeginEdit(); |
|
|
|
dr["StepID"] = e.StepID; |
|
|
|
dr["StepName"] = e.StepNAME; |
|
|
@ -470,7 +495,7 @@ namespace DyeingComputer.View |
|
|
|
dr["Parameter5"] = e.P5; |
|
|
|
dr.EndEdit(); |
|
|
|
|
|
|
|
MainWindowViewModel.dt_TP = sql.Tables[0]; |
|
|
|
// MainWindowViewModel.dt_TP = sql.Tables[0];
|
|
|
|
GridSTEP.SelectedIndex = -1; |
|
|
|
} |
|
|
|
else |
|
|
@ -504,7 +529,7 @@ namespace DyeingComputer.View |
|
|
|
private void ProgramgroupView_Jump_Click(object sender, RoutedEventArgs e) |
|
|
|
{ |
|
|
|
int n = Convert.ToInt16(ID); |
|
|
|
DataRow dr = sql.Tables[0].Rows[n - 1]; |
|
|
|
DataRow dr = MainWindowViewModel.dt_TP.Rows[n - 1]; |
|
|
|
dr.BeginEdit(); |
|
|
|
dr["RUN"] = 2; |
|
|
|
dr.EndEdit(); |
|
|
@ -528,23 +553,7 @@ namespace DyeingComputer.View |
|
|
|
P2 = (GridSTEP.Columns[7].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第7列,
|
|
|
|
P3 = (GridSTEP.Columns[8].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第8列,
|
|
|
|
P4 = (GridSTEP.Columns[9].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第9列,
|
|
|
|
P5 = (GridSTEP.Columns[10].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
|
|
|
|
|
P1_S1 = (GridSTEP.Columns[16].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text; |
|
|
|
P2_S1 = (GridSTEP.Columns[17].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P3_S1 = (GridSTEP.Columns[18].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P4_S1 = (GridSTEP.Columns[19].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P5_S1 = (GridSTEP.Columns[20].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P1_S2 = (GridSTEP.Columns[21].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text; |
|
|
|
P2_S2 = (GridSTEP.Columns[22].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P3_S2 = (GridSTEP.Columns[23].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P4_S2 = (GridSTEP.Columns[24].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P5_S2 = (GridSTEP.Columns[25].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P1_S3 = (GridSTEP.Columns[26].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P2_S3 = (GridSTEP.Columns[27].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//,
|
|
|
|
P3_S3 = (GridSTEP.Columns[28].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//,
|
|
|
|
P4_S3 = (GridSTEP.Columns[29].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//
|
|
|
|
P5_S3 = (GridSTEP.Columns[30].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text; |
|
|
|
P5 = (GridSTEP.Columns[10].GetCellContent(GridSTEP.Items[rownum]) as TextBlock).Text;//定位第10列,
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|