KWD 3 months ago
parent
commit
ce2e388bbf
1 changed files with 3 additions and 3 deletions
  1. 3 3
      TeamAAS-VM/ViewModels/HomeViewModel.cs

+ 3 - 3
TeamAAS-VM/ViewModels/HomeViewModel.cs

@@ -405,8 +405,8 @@ namespace TeamAAS_VP.ViewModels
         /// </summary>
         /// </summary>
         async void ExecuteResetCounterCommand()
         async void ExecuteResetCounterCommand()
         {
         {
-
-            if (management.CurrentProduct == null) return;
+            var currentProduct = _productService.GetCurrentProduct();
+            if (currentProduct == null) return;
             var view = new ShowMessage(Lang.计数清零, Lang.是否重置当前产品的计数);
             var view = new ShowMessage(Lang.计数清零, Lang.是否重置当前产品的计数);
             //show the dialog
             //show the dialog
             var result = await DialogHost.Show(view, "RootDialog", null, null, null);
             var result = await DialogHost.Show(view, "RootDialog", null, null, null);
@@ -415,7 +415,7 @@ namespace TeamAAS_VP.ViewModels
                 if (((bool)result))
                 if (((bool)result))
                 {
                 {
                     isCanExecute = false;
                     isCanExecute = false;
-                    await _systemDatabaseService.ResetProductionAsync(management.CurrentProduct.Name);
+                    await _systemDatabaseService.ResetProductionAsync(currentProduct.Name);
                     isCanExecute = true;
                     isCanExecute = true;
                 }
                 }
             }
             }