Files
Demetrio Cassarino f903f80433 EgtBEAMWALL 3.1.2.3:
-cambio versione
-introdotto finestre EgtMessageBox e EgtManageDialog al posto di quello di Windows
-spostato immagni in dizionario
-aggiunto messaggi
2026-02-18 12:30:30 +01:00

80 lines
3.0 KiB
VB.net

Imports System.IO
Imports EgtBEAMWALL.Core
Imports EgtUILib
Public Class ProjFileVM
Inherits Core.ProjFileVM
#Region "FIELDS & PROPERTIES"
Public ReadOnly Property bIsEnabled As Boolean
Get
Return Not DbControllers.bNetwork OrElse Not bIsLocked
End Get
End Property
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTORS"
Sub New(ProjectFileM As ProjFileM)
MyBase.New(ProjectFileM)
' verifico valore description
If Not IsNothing(ProjectFileM) AndAlso String.IsNullOrWhiteSpace(ProjectFileM.sDescription) Then
DbControllers.m_ProjController.UpdateDescription(ProjectFileM.nProjId, ProjectFileM.sBTLFileName)
ProjectFileM.sDescription = ProjectFileM.sBTLFileName
End If
End Sub
#End Region ' CONSTRUCTORS
#Region "METHODS"
Friend Shared Function VerifyProjectModification(CurrProject As ProjFileVM, Type As ProjectType) As Boolean
If IsNothing(CurrProject) Then Return True
Dim sProjectDirPath As String = ""
sProjectDirPath = CurrProject.sProjDirPath
' verifico se progetto modificato, e chiedo se salvare
If EgtGetModified() OrElse CurrProject.bIsNew OrElse Map.refCALCPanelVM.IsMachineModified() Then
Select Case EgtBEAMWALL.Core.EgtMessageBoxV.Show(Application.Current.MainWindow, EgtMsg(61875), "", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)
Case MessageBoxResult.Yes
' salvo proj
If Not IsNothing(Map.refProdManagerVM) Then
Map.refProdManagerVM.Save()
End If
Map.refCALCPanelVM.IsMachineApplied = False
Case MessageBoxResult.Cancel
Return False
Case Else ' No
EgtResetModified()
Map.refCALCPanelVM.RevertToOriginalMachine()
Map.refCALCPanelVM.IsMachineApplied = False
If CurrProject.bIsNew Then
' lo elimino
If Directory.Exists(sProjectDirPath) Then
Directory.Delete(sProjectDirPath, True)
End If
If Not IsNothing(Map.refProdManagerVM) Then
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProjPath)
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
End If
' CheckMe impostata come cancellazione FISICA dal DB...
DbControllers.m_ProjController.DeleteProj(CurrProject.nProjId, False)
If Not IsNothing(Map.refProdManagerVM) Then
ProjectManagerVM.CurrProj = Nothing
End If
EgtResetModified()
Return True
End If
End Select
Else
EgtResetModified()
End If
DbControllers.m_ProjController.LockByProjId(CurrProject.nProjId, False, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
Return True
End Function
#End Region ' METHODS
End Class