diff --git a/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProdFileVM.vb b/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProdFileVM.vb index a201b97e..c165f829 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProdFileVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ProjectManager/ProdFileVM.vb @@ -186,26 +186,26 @@ Public Class ProdFileVM Dim sProjectDirPath As String = "" sProjectDirPath = CurrProject.sProdDirPath ' verifico se progetto modificato, e chiedo se salvare - If (EgtGetModified() Or CurrProject.bIsNew) Then + If EgtGetModified() Then If MessageBox.Show("Salvare le modifiche apportate al progetto?", "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then ' salvo proj Map.refProdManagerVM.Save() Return True Else - ' se da non salvare e nuovo prod - If CurrProject.bIsNew Then - ' lo elimino - Directory.Delete(sProjectDirPath, True) - DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId) - If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then - ' reset prod in path proj - Map.refProjManagerVM.UpdateCurrProj() - End If - CurrProject = Nothing - End If EgtResetModified() Return False End If + Else If CurrProject.bIsNew Then + ' lo elimino + Directory.Delete(sProjectDirPath, True) + DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId) + If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then + ' reset prod in path proj + Map.refProjManagerVM.UpdateCurrProj() + End If + Map.refProdManagerVM.CurrProd = Nothing + EgtResetModified() + Return False End If DbControllers.m_ProdController.LockByProdId(CurrProject.nProdId, False) Return True