diff --git a/LightDeployApp/Windows/AddEnvironment.xaml b/LightDeployApp/Windows/AddEnvironment.xaml index 054d95d..841934a 100644 --- a/LightDeployApp/Windows/AddEnvironment.xaml +++ b/LightDeployApp/Windows/AddEnvironment.xaml @@ -33,8 +33,18 @@ + + + + + + + + + + diff --git a/LightDeployApp/Windows/AddEnvironment.xaml.cs b/LightDeployApp/Windows/AddEnvironment.xaml.cs index ad87a9f..c854ce6 100644 --- a/LightDeployApp/Windows/AddEnvironment.xaml.cs +++ b/LightDeployApp/Windows/AddEnvironment.xaml.cs @@ -42,11 +42,19 @@ private void ButtonBase_OnClick(object sender, RoutedEventArgs e) private void ButtonBase_OnClick2(object sender, RoutedEventArgs e) { - var num=DBHelper.GetClient().Deleteable() - .Where(it => it.Name == EnvironmentName.Text) - .ExecuteCommand(); - MessageBox.Show($"删除{num}条数据"); - AppContext.RefreshData(); + if (int.TryParse(Id.Text,out var id)) + { + var num=DBHelper.GetClient().Deleteable() + .Where(it => it.Id == id) + .ExecuteCommand(); + MessageBox.Show($"删除{num}条数据"); + AppContext.RefreshData(); + } + else + { + MessageBox.Show("请输入编号数字"); + } + } private void SaveClick(object sender, RoutedEventArgs e)