diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb index 37108189..a602fcd8 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLPartManager/BTLPartManagerVM.vb @@ -189,12 +189,7 @@ Public Class BTLPartManagerVM End Sub Public Sub NewRawPart(bLast As Boolean) - 'If IsNothing(Map.refProdManagerVM) OrElse IsNothing(ProjectManagerVM.CurrProd) Then Return - If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(ProjectManagerVM.CurrProd) Then - Return - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProd) Then - Return - End If + If IsNothing(Map.refProdManagerVM) OrElse IsNothing(ProjectManagerVM.CurrProd) Then Return 'Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() If IsNothing(SelParts) OrElse SelParts.Count <= 0 Then Return @@ -616,12 +611,7 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub AddToRawPart() - 'If IsNothing(ProjectManagerVM.CurrProd) Then Return - If Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso IsNothing(ProjectManagerVM.CurrProd) Then - Return - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProd) Then - Return - End If + If IsNothing(ProjectManagerVM.CurrProd) Then Return Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLParts(0) Dim SelParts As List(Of BTLPartVM) = Map.refProjectVM.BTLStructureVM.SelBTLParts.ToList() For Index = 0 To SelParts.Count() - 1 @@ -889,12 +879,7 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub CopyPart() - 'If IsNothing(ProjectManagerVM.CurrProj) Then Return - If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(ProjectManagerVM.CurrProj) Then - Return - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProj) Then - Return - End If + If IsNothing(ProjectManagerVM.CurrProj) Then Return Dim SelPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.SelBTLPart If IsNothing(SelPart) Then Return ' creo copia @@ -925,12 +910,7 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub AddPart(ByVal param As Object) - 'If IsNothing(ProjectManagerVM.CurrProj) Then Return - If Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(ProjectManagerVM.CurrProj) Then - Return - ElseIf Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProj) Then - Return - End If + If IsNothing(ProjectManagerVM.CurrProj) Then Return ' apro finestra di definizione nuovo part Dim AddPartWndVM As New AddPartWndVM() Dim AddPartWnd As New AddPartWndV(Application.Current.MainWindow, AddPartWndVM) @@ -1116,11 +1096,7 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub BackRotation() - If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then - Return - ElseIf (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then - Return - End If + If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return ' salvo sezione impostata Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection ' se modalita' assemblato @@ -1165,11 +1141,7 @@ Public Class BTLPartManagerVM ''' Execute the Exec. This method is invoked by the ExecCommand. ''' Public Sub ForwardRotation() - If (Map.refMainMenuVM.SelPage = Pages.VIEW AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then - Return - ElseIf (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then - Return - End If + If IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return ' salvo sezione impostata Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection ' se modalita' assemblato @@ -1198,5 +1170,4 @@ Public Class BTLPartManagerVM #End Region ' COMMANDS - End Class