|
@ -4,6 +4,7 @@ using System.Collections.Generic; |
|
|
using System.Data; |
|
|
using System.Data; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
|
|
|
using System.Text.RegularExpressions; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using System.Windows; |
|
|
using System.Windows; |
|
|
using System.Windows.Controls; |
|
|
using System.Windows.Controls; |
|
@ -37,7 +38,7 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
|
|
|
comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field<string>("name")).ToList();//转换机台
|
|
|
comboBoxMachine.ItemsSource = MainWindowViewModel.Machines.AsEnumerable().Select(rowdata => rowdata.Field<string>("name")).ToList();//转换机台
|
|
|
comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field<string>("ProgramID")).ToList();//转换工艺代码
|
|
|
comboBoxProgram.ItemsSource = ProgramName.AsEnumerable().Select(rowdata => rowdata.Field<string>("ProgramName")).ToList();//转换工艺代码
|
|
|
} |
|
|
} |
|
|
private void Multi_Click(object sender, RoutedEventArgs e) |
|
|
private void Multi_Click(object sender, RoutedEventArgs e) |
|
|
{ |
|
|
{ |
|
@ -56,15 +57,49 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
|
|
|
|
|
private void comboBoxProgram_DropDownClosed(object sender, EventArgs e)//工艺选择事件
|
|
|
private void comboBoxProgram_DropDownClosed(object sender, EventArgs e)//工艺选择事件
|
|
|
{ |
|
|
{ |
|
|
if (!string.IsNullOrEmpty(comboBoxProgram.SelectedValue.ToString())) |
|
|
if (!string.IsNullOrEmpty(comboBoxProgram.Text)) |
|
|
{ |
|
|
{ |
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
DataTable dat = SQLiteHelpers.ExecuteDataSet( |
|
|
DataTable dat = SQLiteHelpers.ExecuteDataSet( |
|
|
"select * from ProgramSteps where ProgramID='" + comboBoxProgram.SelectedValue + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
|
|
"select * from ProgramSteps where Program='" + comboBoxProgram.SelectedValue + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
Grid_data.ItemsSource = dat.DefaultView; |
|
|
Grid_data.ItemsSource = dat.DefaultView; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void comboBoxProgram_TextChanged(object sender, TextChangedEventArgs e) |
|
|
|
|
|
{ |
|
|
|
|
|
string text = comboBoxProgram.Text; |
|
|
|
|
|
if (!string.IsNullOrEmpty(text)) |
|
|
|
|
|
{ |
|
|
|
|
|
// try
|
|
|
|
|
|
{ |
|
|
|
|
|
string[] sArray = Regex.Split(text, @"\+", RegexOptions.IgnoreCase); |
|
|
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DataTable dat = new DataTable(); |
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < sArray.Length; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
DataTable temp = SQLiteHelpers.ExecuteDataSet( |
|
|
|
|
|
"select * from ProgramSteps where Program='" + sArray[i] + "' order by Step asc", null).Tables[0]; //读取计划表写入缓存
|
|
|
|
|
|
if (dat.Columns.Count == 0) dat = temp.Clone(); |
|
|
|
|
|
foreach (DataRow dr in temp.Rows) |
|
|
|
|
|
{ |
|
|
|
|
|
dat.Rows.Add(dr.ItemArray); |
|
|
|
|
|
} |
|
|
|
|
|
//dat = temp.Copy();
|
|
|
|
|
|
} |
|
|
|
|
|
SQLiteHelpers.Close(); //关闭连接
|
|
|
|
|
|
Grid_data.ItemsSource = dat.DefaultView; |
|
|
|
|
|
} |
|
|
|
|
|
// catch (Exception) { }
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|