- aggiunta gestione archiviazione progetti
This commit is contained in:
@@ -128,6 +128,7 @@ Public Module ConstIni
|
||||
Public Const K_ENDDATE As String = "EndDate"
|
||||
|
||||
Public Const S_OPENFILEDIALOG As String = "OpenFileDialog"
|
||||
Public Const K_VIEWARCHIVED As String = "ViewArchived"
|
||||
|
||||
'Public Const S_NEST As String = "Nest"
|
||||
Public Const K_NESTEXEC As String = "NestExec"
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ComboBox ItemsSource="{Binding BTLDateTypeList}"
|
||||
SelectedIndex="{Binding SelBTLDateType}"
|
||||
@@ -56,6 +57,10 @@
|
||||
Style="{StaticResource Filter_DatePicker}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<CheckBox Grid.Column="2"
|
||||
IsChecked="{Binding bViewArchived}"
|
||||
Content="{Binding ViewArchived_Msg}"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -315,9 +320,13 @@
|
||||
</DataGrid.RowDetailsTemplate>
|
||||
</EgtBEAMWALL:EgtDataGrid>
|
||||
|
||||
<UniformGrid Columns="3" Grid.Row="2" Margin="0,0,0,5">
|
||||
<UniformGrid Columns="4" Grid.Row="2" Margin="0,0,0,5">
|
||||
<Button IsDefault="True" Name="OpenBtn"
|
||||
Content="{Binding Open_Msg}" Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
Content="{Binding Open_Msg}"
|
||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Archive_Msg}"
|
||||
Command="{Binding Archive_Command}"
|
||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="{Binding Delete_Msg}"
|
||||
Command="{Binding Delete_Command}"
|
||||
Style="{DynamicResource EgtWPFLib5_InputButton}"/>
|
||||
|
||||
@@ -359,6 +359,18 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
||||
NotifyPropertyChanged(NameOf(bIsEditNameActive))
|
||||
End Sub
|
||||
|
||||
Private m_bViewArchived As Boolean
|
||||
Public Property bViewArchived As Boolean
|
||||
Get
|
||||
Return m_bViewArchived
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_bViewArchived = value
|
||||
WriteMainPrivateProfileString(S_OPENFILEDIALOG, K_VIEWARCHIVED, If(bViewArchived, 1, 0))
|
||||
RefreshProjectList()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Title As String
|
||||
@@ -418,6 +430,11 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
||||
Return EgtMsg(30006)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Archive_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61981)
|
||||
End Get
|
||||
End Property
|
||||
Public ReadOnly Property Delete_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61823)
|
||||
@@ -441,11 +458,18 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ViewArchived_Msg As String
|
||||
Get
|
||||
Return EgtMsg(61982)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdProjectDoubleClick As ICommand
|
||||
Private m_cmdDelete As ICommand
|
||||
Private m_cmdArchive As ICommand
|
||||
Private m_cmdModifyName As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
@@ -479,6 +503,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
||||
m_dtEndDate = If(lEndDate > 0, DateTime.FromFileTimeUtc(lEndDate), DateTime.Today)
|
||||
m_Date_Visibility = Visibility.Visible
|
||||
End Select
|
||||
m_bViewArchived = GetMainPrivateProfileInt(S_OPENFILEDIALOG, K_VIEWARCHIVED, 0) <> 0
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
@@ -603,6 +628,28 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
||||
|
||||
#End Region ' ProjectDoubleClick
|
||||
|
||||
#Region "Archive"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do New.
|
||||
''' </summary>
|
||||
Public ReadOnly Property Archive_Command As ICommand
|
||||
Get
|
||||
If m_cmdArchive Is Nothing Then
|
||||
m_cmdArchive = New Command(AddressOf Archive)
|
||||
End If
|
||||
Return m_cmdArchive
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Public Overridable Sub Archive()
|
||||
End Sub
|
||||
|
||||
#End Region ' Archive
|
||||
|
||||
#Region "Delete"
|
||||
|
||||
''' <summary>
|
||||
@@ -623,7 +670,7 @@ Public MustInherit Class NewOpenProjectFileDialogVM
|
||||
Public Overridable Sub Delete()
|
||||
End Sub
|
||||
|
||||
#End Region ' ModifyName
|
||||
#End Region ' Delete
|
||||
|
||||
#Region "ModifyName"
|
||||
|
||||
@@ -703,11 +750,20 @@ Public Class ProdItem
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(ProdFileVM As ProjectFileVM, ProjFileVM As ProjectFileVM)
|
||||
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
|
||||
m_ProdFileVM = ProdFileVM
|
||||
m_ProjFileList.Add(ProjFileVM)
|
||||
End Sub
|
||||
|
||||
Sub New(ProjFileVM As ProjFileVM)
|
||||
m_ProjFileList = New List(Of ProjectFileVM)({ProjFileVM})
|
||||
End Sub
|
||||
|
||||
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
|
||||
m_ProdFileVM = ProdFileVM
|
||||
m_ProjFileList = ProjFileVMList
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
'Public Class ProjItem
|
||||
|
||||
+81
-171
@@ -56,42 +56,6 @@ Public Class NewOpenProjectFileDialogVM
|
||||
dtEnd = dtEndDate
|
||||
End Select
|
||||
|
||||
Dim DbProjList As New List(Of ProjFileM)
|
||||
' CheckMe: lasciato come prima, anche NON attivi (cancellazione logica)
|
||||
If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
|
||||
DbProjList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
Else
|
||||
DbProjList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
End If
|
||||
For Each Project In DbProjList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
|
||||
' verifico se ha prod
|
||||
If Not IsNothing(Project.nProdId) And Project.nProdId > 0 Then
|
||||
' verifico se prod e' gia' stato creato
|
||||
Dim SameProdItem As ProdItem = m_ProjectList.FirstOrDefault(Function(x) Not IsNothing(x.ProdFileVM) AndAlso Not IsNothing(x.ProdFileVM.nProdId) AndAlso x.ProdFileVM.nProdId = Project.nProdId)
|
||||
If Not IsNothing(SameProdItem) Then
|
||||
SameProdItem.ProjFileList.Add(New ProjFileVM(Project))
|
||||
Else
|
||||
' recupero Prod
|
||||
Dim NewDbProd As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(Project.nProdId)
|
||||
If Not IsNothing(NewDbProd) Then
|
||||
m_ProjectList.Add(New ProdItem(New ProdFileVM(NewDbProd), New ProjFileVM(Project)))
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
m_ProjectList.Add(New ProdItem(Nothing, New ProjFileVM(Project)))
|
||||
End If
|
||||
'Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
|
||||
'If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProjFileVM(Project))
|
||||
'Else
|
||||
' ' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
' 'DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
|
||||
' 'EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
|
||||
' MessageBox.Show("Project file not found!", "Error!", MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
'End If
|
||||
Next
|
||||
|
||||
|
||||
|
||||
@@ -103,142 +67,80 @@ Public Class NewOpenProjectFileDialogVM
|
||||
|
||||
|
||||
' leggo da db
|
||||
'If m_ProjectType = ProjectType.PROJ Then
|
||||
' Dim DbProjList As New List(Of ProjFileM)
|
||||
' ' CheckMe: lasciato come prima, anche NON attivi (cancellazione logica)
|
||||
' If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
|
||||
' DbProjList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
' Else
|
||||
' DbProjList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, False)
|
||||
' End If
|
||||
' For Each Project In DbProjList
|
||||
' ' recupero path per verificare esista
|
||||
' If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
|
||||
' Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
|
||||
' If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProjFileVM(Project))
|
||||
' Else
|
||||
' ' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
' DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
|
||||
' End If
|
||||
' Next
|
||||
'ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
'Dim DbProdList As New List(Of ProdFileM)
|
||||
' DbProdList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
' If GoToProd Then
|
||||
' For Each Project In DbProdList
|
||||
' ' recupero path per verificare esista
|
||||
' If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
' Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
' If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
' Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
' If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProdItem(New ProdFileVM(Project), Nothing))
|
||||
' Else
|
||||
' DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Else
|
||||
' For Each Project In DbProdList
|
||||
' ' recupero path per verificare esista
|
||||
' If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
' Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
' If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProdFileVM(Project))
|
||||
' Else
|
||||
' DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
'End If
|
||||
If m_ProjectType = ProjectType.PROJ Then
|
||||
Dim DbProjList As New List(Of ProjFileM)
|
||||
If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
|
||||
DbProjList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
Else
|
||||
DbProjList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
End If
|
||||
For Each Project In DbProjList
|
||||
If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
|
||||
' verifico se ha prod
|
||||
If Not IsNothing(Project.nProdId) And Project.nProdId > 0 Then
|
||||
' verifico se prod e' gia' stato creato
|
||||
Dim SameProdItem As ProdItem = m_ProjectList.FirstOrDefault(Function(x) Not IsNothing(x.ProdFileVM) AndAlso Not IsNothing(x.ProdFileVM.nProdId) AndAlso x.ProdFileVM.nProdId = Project.nProdId)
|
||||
If Not IsNothing(SameProdItem) Then
|
||||
SameProdItem.ProjFileList.Add(New ProjFileVM(Project))
|
||||
Else
|
||||
' recupero Prod
|
||||
Dim NewDbProd As ProdFileM = DbControllers.m_ProdController.FindCoreByProdId(Project.nProdId)
|
||||
If Not IsNothing(NewDbProd) Then
|
||||
m_ProjectList.Add(New ProdItem(New ProdFileVM(NewDbProd), New ProjFileVM(Project)))
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
m_ProjectList.Add(New ProdItem(New ProjFileVM(Project)))
|
||||
End If
|
||||
Next
|
||||
ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
Dim DbProdList As New List(Of ProdFileM)
|
||||
DbProdList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True, bViewArchived)
|
||||
If GoToProd Then
|
||||
For Each Project In DbProdList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProdItem(New ProdFileVM(Project)))
|
||||
'Else
|
||||
' DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
For Each Project In DbProdList
|
||||
' recupero path per verificare esista
|
||||
If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
If File.Exists(sPath) Then
|
||||
' recupero i proj
|
||||
Dim ProjList As New List(Of ProjectFileVM)
|
||||
For Each ProjFileId In Project.nProjIdList
|
||||
Dim ProjFileM As ProjectFileM = DbControllers.m_ProjController.FindByProjIdConv(ProjFileId)
|
||||
ProjList.Add(New ProjFileVM(ProjFileM))
|
||||
Next
|
||||
m_ProjectList.Add(New ProdItem(New ProdFileVM(Project), ProjList))
|
||||
'Else
|
||||
' DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'Public Overrides Sub RefreshProjectList(Optional GoToProd As Boolean = False)
|
||||
' m_ProjectList.Clear()
|
||||
' ' calcolo periodo e righe
|
||||
' Dim dtStart As DateTime
|
||||
' Dim dtEnd As DateTime
|
||||
' Dim nRowQuantity As Integer = 20
|
||||
' Select Case SelRowQuantity
|
||||
' Case RowQuantities.FIFTY
|
||||
' nRowQuantity = 50
|
||||
' Case RowQuantities.HUNDRED
|
||||
' nRowQuantity = 100
|
||||
' Case RowQuantities.HUNDREDANDFIFTY
|
||||
' nRowQuantity = 150
|
||||
' End Select
|
||||
' Select Case m_SelDayType
|
||||
' Case DayTypes.LASTMONTH
|
||||
' dtEnd = DateTime.Today + TimeSpan.FromDays(1)
|
||||
' dtStart = dtEnd - TimeSpan.FromDays(31)
|
||||
' Case DayTypes.LAST3MONTHS
|
||||
' dtEnd = DateTime.Today + TimeSpan.FromDays(1)
|
||||
' dtStart = dtEnd - TimeSpan.FromDays(31 * 3)
|
||||
' Case DayTypes.LAST6MONTHS
|
||||
' dtEnd = DateTime.Today + TimeSpan.FromDays(1)
|
||||
' dtStart = dtEnd - TimeSpan.FromDays(31 * 6)
|
||||
' Case DayTypes.PERIOD
|
||||
' dtStart = dtStartDate + TimeSpan.FromDays(1)
|
||||
' dtEnd = dtEndDate
|
||||
' End Select
|
||||
' ' leggo da db
|
||||
' If m_ProjectType = ProjectType.PROJ Then
|
||||
' Dim DbProjectList As New List(Of ProjFileM)
|
||||
' ' CheckMe: lasciato come prima, anche NON attivi (cancellazione logica)
|
||||
' If m_SelBTLDateType = BTLDateTypes.CREATEDATE Then
|
||||
' DbProjectList = DbControllers.m_ProjController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
' Else
|
||||
' DbProjectList = DbControllers.m_ProjController.GetLastByExpDesc(dtStart, dtEnd, nRowQuantity, False)
|
||||
' End If
|
||||
' For Each Project In DbProjectList
|
||||
' ' recupero path per verificare esista
|
||||
' If IsNothing(Project.nProjId) OrElse Project.nProjId = 0 Then Continue For
|
||||
' Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProjsDir & "\" & Project.nProjId.ToString("0000") & "\" & Project.nProjId.ToString("0000") & ".nge"
|
||||
' If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProjFileVM(Project))
|
||||
' Else
|
||||
' ' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
' DbControllers.m_ProjController.DeleteProj(Project.nProjId, False)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Proj number " & Project.nProjId.ToString("0000"))
|
||||
' End If
|
||||
' Next
|
||||
' ElseIf m_ProjectType = ProjectType.PROD Then
|
||||
' Dim DbProjectList As New List(Of ProdFileM)
|
||||
' DbProjectList = DbControllers.m_ProdController.GetLastDesc(dtStart, dtEnd, nRowQuantity, True)
|
||||
' If GoToProd Then
|
||||
' For Each Project In DbProjectList
|
||||
' ' recupero path per verificare esista
|
||||
' If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
' Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
' If Project.sMachine = Map.refProjManagerVM.CurrProj.sMachine AndAlso
|
||||
' Project.nType = Map.refProjManagerVM.CurrProj.nType Then
|
||||
' If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProdFileVM(Project))
|
||||
' Else
|
||||
' DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Else
|
||||
' For Each Project In DbProjectList
|
||||
' ' recupero path per verificare esista
|
||||
' If IsNothing(Project.nProdId) OrElse Project.nProdId = 0 Then Continue For
|
||||
' Dim sPath As String = Map.refMainWindowVM.MainWindowM.sProdsDir & "\" & Project.nProdId.ToString("0000") & "\" & Project.nProdId.ToString("0000") & ".nge"
|
||||
' If File.Exists(sPath) Then
|
||||
' m_ProjectList.Add(New ProdFileVM(Project))
|
||||
' Else
|
||||
' DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
' EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
' End If
|
||||
' Next
|
||||
' End If
|
||||
' End If
|
||||
'End Sub
|
||||
Public Overrides Sub Archive()
|
||||
If IsNothing(SelProject) Then Return
|
||||
If IsNothing(SelProject.ProdFileVM) Then Return
|
||||
' archivio il progetto
|
||||
DbControllers.m_ProdController.UpdateArchived(SelProject.ProdFileVM.nProdId, True)
|
||||
' aggiorno lista progetti
|
||||
RefreshProjectList()
|
||||
End Sub
|
||||
|
||||
Public Overrides Sub Delete()
|
||||
'If IsNothing(SelProject) Then Return
|
||||
@@ -385,8 +287,16 @@ Public Class ProdItem
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(ProdFileVM As ProjectFileVM, ProjFileVM As ProjectFileVM)
|
||||
Sub New(ProdFileVM As ProdFileVM, ProjFileVM As ProjFileVM)
|
||||
MyBase.New(ProdFileVM, ProjFileVM)
|
||||
End Sub
|
||||
|
||||
Sub New(ProjFileVM As ProjFileVM)
|
||||
MyBase.New(ProjFileVM)
|
||||
End Sub
|
||||
|
||||
Sub New(ProdFileVM As ProjectFileVM, ProjFileVMList As List(Of ProjectFileVM))
|
||||
MyBase.New(ProdFileVM, ProjFileVMList)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -91,7 +91,7 @@ Public Class OpenProjectFileDialogVM
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId, True)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
End If
|
||||
@@ -104,7 +104,7 @@ Public Class OpenProjectFileDialogVM
|
||||
If File.Exists(sPath) Then
|
||||
m_ProjectList.Add(New ProdFileVM(Project))
|
||||
Else
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId)
|
||||
DbControllers.m_ProdController.DeleteProd(Project.nProdId, True)
|
||||
EgtOutLog("Found project on Db without the folder and erased it! Prod number " & Project.nProdId.ToString("0000"))
|
||||
End If
|
||||
Next
|
||||
@@ -159,7 +159,7 @@ Public Class OpenProjectFileDialogVM
|
||||
Map.refProdManagerVM.m_MruFiles.Remove(SelProject.sProdPath)
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
' cancello progetto
|
||||
DbControllers.m_ProdController.DeleteProd(SelProject.nProdId)
|
||||
DbControllers.m_ProdController.DeleteProd(SelProject.nProdId, True)
|
||||
' riporto prod in proj
|
||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||
Dim nTempCtx As Integer = EgtInitContext()
|
||||
|
||||
@@ -230,7 +230,7 @@ Public Class ProjManagerVM
|
||||
Map.refProdManagerVM.CurrProd.bIsNew = True
|
||||
Else
|
||||
' elimino da DB
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId)
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1699,7 +1699,7 @@ Public Class ProjManagerVM
|
||||
Next
|
||||
Else
|
||||
' elimino da DB
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId)
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId, True)
|
||||
End If
|
||||
Dim MyMachGroupList As New List(Of MyMachGroupM)
|
||||
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
|
||||
|
||||
@@ -155,7 +155,7 @@ Public Class ProdFileVM
|
||||
End Try
|
||||
Map.refProdManagerVM.m_MruFiles.Remove(CurrProject.sProdPath)
|
||||
Map.refProdManagerVM.NotifyPropertyChanged(NameOf(Map.refProdManagerVM.MruFileNames))
|
||||
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId)
|
||||
DbControllers.m_ProdController.DeleteProd(CurrProject.nProdId, True)
|
||||
If CurrProject.nProdId = Map.refProjManagerVM.CurrProj.nProdId Then
|
||||
' reset prod in path proj
|
||||
Map.refProjManagerVM.UpdateCurrProj()
|
||||
|
||||
Reference in New Issue
Block a user