更新202612

This commit is contained in:
GukSang.Jin
2026-05-20 13:33:15 +08:00
parent 43893e5da6
commit 17d9904898
7 changed files with 250 additions and 30 deletions

View File

@@ -43,6 +43,66 @@ namespace TabletTester2025
LoadData();
}
private void DeleteHardness_Click(object sender, RoutedEventArgs e)
{
if (HardnessGrid.SelectedItem is not TestBatch batch)
{
MessageBox.Show("请先选择一条记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
var result = MessageBox.Show($"确定要删除该记录吗?\n检测时间{batch.TestTime:yyyy-MM-dd HH:mm:ss}",
"确认删除", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes)
return;
_dbService.DeleteBatch(batch.Id);
LoadData();
}
private void DeleteFriability_Click(object sender, RoutedEventArgs e)
{
if (FriabilityGrid.SelectedItem is not TestBatch batch)
{
MessageBox.Show("请先选择一条记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
var result = MessageBox.Show($"确定要删除该记录吗?\n检测时间{batch.TestTime:yyyy-MM-dd HH:mm:ss}",
"确认删除", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes)
return;
_dbService.DeleteBatch(batch.Id);
LoadData();
}
private void DeleteDisintegration_Click(object sender, RoutedEventArgs e)
{
if (DisintegrationGrid.SelectedItem is not TestBatch batch)
{
MessageBox.Show("请先选择一条记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
var result = MessageBox.Show($"确定要删除该记录吗?\n检测时间{batch.TestTime:yyyy-MM-dd HH:mm:ss}",
"确认删除", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes)
return;
_dbService.DeleteBatch(batch.Id);
LoadData();
}
private void DeleteDissolution_Click(object sender, RoutedEventArgs e)
{
if (DissolutionGrid.SelectedItem is not TestBatch batch)
{
MessageBox.Show("请先选择一条记录", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
return;
}
var result = MessageBox.Show($"确定要删除该记录吗?\n检测时间{batch.TestTime:yyyy-MM-dd HH:mm:ss}",
"确认删除", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result != MessageBoxResult.Yes)
return;
_dbService.DeleteBatch(batch.Id);
LoadData();
}
private void ExportHardness_Click(object sender, RoutedEventArgs e)
{
var data = HardnessGrid.ItemsSource as IEnumerable<TestBatch>;