Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
db9cb2778d
2 files changed
+11
-6
No files matched your search
@@ -59,7 +59,7 @@
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Machine}" Binding="{Binding Name}" Width="210" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Group}" Binding="{Binding Group}" Width="210" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Header="{x:Static lang:Resources.Group}" Binding="{Binding Groups}" Width="210" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding IP}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding PORT}" Width="0" IsReadOnly="True"/>
|
||||
<DataGridTextColumn Binding="{Binding Serial}" Width="0" IsReadOnly="True"/>
|
||||
|
||||
@@ -66,15 +66,20 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
{
|
||||
if (!string.IsNullOrEmpty(comboBoxMachine.Text))
|
||||
{
|
||||
DataRow dr = MainWindowViewModel.Machines.NewRow();//添加数据
|
||||
|
||||
dr["Name"] = comboBoxMachine.Text;
|
||||
dr["Group"] = TextMachineGroup;
|
||||
|
||||
|
||||
Dictionary<string, object> dr_new = new Dictionary<string, object>();//缓存函数
|
||||
dr_new.Add("Name", comboBoxMachine.Text);
|
||||
dr_new.Add("Groups", TextMachineGroup.Text);
|
||||
|
||||
|
||||
|
||||
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();
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user