This commit is contained in:
sc committed 2024-10-27 23:48:34 +08:00
commit ac41e81fa1
4 files changed
+70 -12

No files matched your search

+12 -6
View File
@@ -45,19 +45,20 @@ namespace DyeingComputer.View
}
public static object workName;
public static string Program_Name;
private SQLiteHelper SQLiteHelpers = null; //定义数据库
private readonly string DBAddress = Environment.CurrentDirectory + "\\DataBase\\800COMPUTER.db"; //数据库路径
DataSet sql; //内存数据缓存
public static DataSet sql; //内存数据缓存
private void TechnologicalProcess_Import()
{
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
SQLiteHelpers.Open(); //打开数据库
int r = 0;
string sql_script = "select * from ProgramSteps where ProgramID = '" + workName + "'";
string sql_script = "select * from WorkorderSteps where ProgramID = '" + workName + "'";
if (sql != null) sql.Clear(); //清空缓存
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
name.Text = SQLiteHelpers.ExecuteScalar("select ProgramName from ProgramName where ProgramID = '" + workName + "'", null).ToString();
Program_Name = SQLiteHelpers.ExecuteScalar("select ProgramName from WorkOrder where ProgramID = '" + workName + "'", null).ToString();
if (sql != null) Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
SQLiteHelpers.Delete("RUN", null, null); //删除run信息
@@ -88,7 +89,7 @@ namespace DyeingComputer.View
string sql_script = "select * from RUN";
if (sql != null) sql.Clear(); //清空缓存
sql = SQLiteHelpers.ExecuteDataSet(sql_script, null); //读取表写入缓存
name.Text = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
Program_Name = SQLiteHelpers.ExecuteScalar("select Program from RUN where Step = '1'", null).ToString();
MainWindowViewModel.WorkNumder = SQLiteHelpers.ExecuteScalar("select DYELOT from RUN where Step = '1'", null).ToString();
SQLiteHelpers.Close(); //关闭连接
@@ -189,7 +190,7 @@ namespace DyeingComputer.View
dr.EndEdit();
}
}
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)
private void ProgramgroupView_del_Click(object sender, RoutedEventArgs e)//删除
{
int d = 0;
int a = sql.Tables[0].Rows.Count;
@@ -204,7 +205,7 @@ namespace DyeingComputer.View
}
}
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)
private void ProgramgroupView_Insert_Click(object sender, RoutedEventArgs e)//插入
{
int d = 0;
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
@@ -258,6 +259,11 @@ namespace DyeingComputer.View
void Tick_Event_1S(object sender, EventArgs e)//Tick_Event周期执行事件1S
{
if (MainWindowViewModel.WORK_RUN == 2) Grid.SelectedIndex = MainWindowViewModel.RUN_STEPID - 1;//设定图表显示
if (sql != null)
{
Grid.ItemsSource = sql.Tables[0].DefaultView; //转换显示计划表
name.Text = Program_Name;
}
}
}
}
+1 -1
View File
@@ -68,7 +68,7 @@
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Width="300" Binding="{Binding ProcessName}" IsReadOnly="True"/>
<DataGridTextColumn Header="{x:Static lang:Resources.ProcessName}" Width="300" Binding="{Binding ProgramName}" IsReadOnly="True"/>
<DataGridTextColumn Header="ProcessID" Binding="{Binding ProcessID}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Header="lock" Binding="{Binding lock}" Width="0" MinWidth="0" MaxWidth="0"/>
<DataGridTextColumn Header="{x:Static lang:Resources.State}" Width="120" IsReadOnly="True">