Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightCentralizedControlManagement
This commit is contained in:
commit
83e77f50f3
1 file changed
+23
-1
@@ -62,12 +62,34 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Save_Click(object sender, RoutedEventArgs e)
|
private void Save_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(comboBoxMachine.Text))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textlog.Text = "Invalid";
|
||||||
|
textlog.Foreground = new SolidColorBrush(Color.FromRgb(255, 0, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void Delete_Click(object sender, RoutedEventArgs e)
|
private void Delete_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (!string.IsNullOrEmpty(comboBoxMachine.Text))
|
||||||
|
{
|
||||||
|
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||||
|
SQLiteHelpers.Open(); //打开数据库
|
||||||
|
SQLiteHelpers.Delete("Machines","Name='"+comboBoxMachine.Text+"'",null);
|
||||||
|
MainWindowViewModel.Machines = SQLiteHelpers.ExecuteDataSet("select * from Machines Order by id", null).Tables[0]; //读取表写入缓存
|
||||||
|
SQLiteHelpers.Close();
|
||||||
|
Griddata.ItemsSource = MainWindowViewModel.Machines.DefaultView;
|
||||||
|
comboBoxMachine.Text = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textlog.Text = "Invalid";
|
||||||
|
textlog.Foreground = new SolidColorBrush(Color.FromRgb(255, 0, 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void Test_Click(object sender, RoutedEventArgs e)//测试按钮
|
private void Test_Click(object sender, RoutedEventArgs e)//测试按钮
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user