|
@@ -204,6 +204,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
|
|
|
|
//导入并解密db文件
|
|
//导入并解密db文件
|
|
var path = DataBaseUtil.ImportData();
|
|
var path = DataBaseUtil.ImportData();
|
|
|
|
+ if (string.IsNullOrEmpty(path)) return;
|
|
|
|
|
|
var inspectApplies = DataBaseUtil.QueryAll<InspectApply>(path, p => p
|
|
var inspectApplies = DataBaseUtil.QueryAll<InspectApply>(path, p => p
|
|
.Include(x => x.Material)
|
|
.Include(x => x.Material)
|
|
@@ -247,7 +248,7 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
/// 导出报检数据包
|
|
/// 导出报检数据包
|
|
/// </summary>
|
|
/// </summary>
|
|
[RelayCommand]
|
|
[RelayCommand]
|
|
- private async Task ExportInspectApplyData()
|
|
|
|
|
|
+ private void ExportInspectApplyData()
|
|
{
|
|
{
|
|
var result = MessageBox.Show("确认导出报检数据包吗?(仅导出“导出状态”为“未导出”的检验申请单)", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
|
|
var result = MessageBox.Show("确认导出报检数据包吗?(仅导出“导出状态”为“未导出”的检验申请单)", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Question);
|
|
if (result != MessageBoxResult.OK) return;
|
|
if (result != MessageBoxResult.OK) return;
|
|
@@ -269,8 +270,6 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
{
|
|
{
|
|
inspect.ExportStatus = true;
|
|
inspect.ExportStatus = true;
|
|
}
|
|
}
|
|
- var success = _inspectService.SaveChanges();
|
|
|
|
- if (!success) return;
|
|
|
|
|
|
|
|
var serialNumbers = _serialService.Query().ToArray();
|
|
var serialNumbers = _serialService.Query().ToArray();
|
|
|
|
|
|
@@ -316,7 +315,19 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
DataBaseUtil.ExportTable(serialNumbers, "SerialNumbers");
|
|
DataBaseUtil.ExportTable(serialNumbers, "SerialNumbers");
|
|
}
|
|
}
|
|
|
|
|
|
- await DataBaseUtil.ExportData();
|
|
|
|
|
|
+ var path = DataBaseUtil.ExportData();
|
|
|
|
+ if (string.IsNullOrEmpty(path))
|
|
|
|
+ {
|
|
|
|
+ //将导出状态更新为未导出
|
|
|
|
+ foreach (var inspect in inspectApplies)
|
|
|
|
+ {
|
|
|
|
+ inspect.ExportStatus = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ _inspectService.SaveChanges();
|
|
|
|
|
|
MessageBox.Show("报检数据包导出成功!");
|
|
MessageBox.Show("报检数据包导出成功!");
|
|
}
|
|
}
|