Beispiel #1
0
 private void DeletePart()
 {
     if (SelectedPart == null)
     {
         return;
     }
     //if (SelectedPart.Status != PartStatus.PS_Idle)
     //{
     //    return;
     //}
     if (SelectedPart.Placed)
     {
         return;
     }
     Parts.Remove(SelectedPart);
     SelectParts.Remove(SelectedPart);
     CategoriesRefresh();
     PartsFileRepository.UpdateParts(Parts);
 }
Beispiel #2
0
 private void DeleteAllParts()
 {
     //须判断是否放置在料盘中
     foreach (var part in Parts)
     {
         if (part.Placed)
         {
             MessageBox.Show("有未卸载零件,无法清除", "警告", MessageBoxButton.OK, MessageBoxImage.Exclamation, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
             return;
         }
     }
     Parts.Clear();
     if (SelectParts != null)
     {
         SelectParts.Clear();
     }
     CategoriesRefresh();
     PartsFileRepository.UpdateParts(Parts);
 }