|
|
@ -66,15 +66,20 @@ namespace SunlightCentralizedControlManagement_SCCM_.View |
|
|
|
{ |
|
|
|
if (!string.IsNullOrEmpty(comboBoxMachine.Text)) |
|
|
|
{ |
|
|
|
DataRow dr = MainWindowViewModel.Machines.NewRow();//添加数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<string, object> dr_new = new Dictionary<string, object>();//缓存函数
|
|
|
|
dr_new.Add("Name", comboBoxMachine.Text); |
|
|
|
dr_new.Add("Groups", TextMachineGroup.Text); |
|
|
|
|
|
|
|
|
|
|
|
dr["Name"] = comboBoxMachine.Text; |
|
|
|
dr["Group"] = TextMachineGroup; |
|
|
|
|
|
|
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
|
|
|
SQLiteHelpers.Open(); //打开数据库
|
|
|
|
// SQLiteHelpers.InsertData("Machines", SQLiteHelpers.DataTableToDictionary(dr));
|
|
|
|
// MainWindowViewModel.Machines = SQLiteHelpers.ExecuteDataSet("select * from Machines Order by id", null).Tables[0]; //读取表写入缓存
|
|
|
|
|
|
|
|
SQLiteHelpers.InsertData("Machines", dr_new); |
|
|
|
MainWindowViewModel.Machines = SQLiteHelpers.ExecuteDataSet("select * from Machines Order by id", null).Tables[0]; //读取表写入缓存
|
|
|
|
SQLiteHelpers.Close(); |
|
|
|
|
|
|
|
|
|
|
|