- correzioni ProjectManager
- correzioni selezione pezzi e machgroup
This commit is contained in:
@@ -72,14 +72,15 @@ Public Class OnlyProdManagerVM
|
||||
Get
|
||||
Dim IdAndBTLFileNames As New ObservableCollection(Of String)
|
||||
For Each FileName In m_MruFiles.FileNames.ToList()
|
||||
Dim PjId As Integer = 0
|
||||
Dim sPjId As String = Path.GetFileNameWithoutExtension(DirectCast(FileName, String).Replace("__", "_"))
|
||||
Integer.TryParse(sPjId, PjId)
|
||||
Dim PjFileM = DbControllers.m_ProjController.FindByProjIdConv(PjId)
|
||||
If IsNothing(PjFileM) Then
|
||||
Dim PdId As Integer = 0
|
||||
Dim sPdId As String = Path.GetFileNameWithoutExtension(DirectCast(FileName, String).Replace("__", "_"))
|
||||
Integer.TryParse(sPdId, PdId)
|
||||
Dim PdFileM = DbControllers.m_ProdController.FindCoreByProdId(PdId)
|
||||
If IsNothing(PdFileM) Then
|
||||
m_MruFiles.Remove(FileName)
|
||||
Else
|
||||
IdAndBTLFileNames.Add(sPjId & " | " & PjFileM.sBTLFileName)
|
||||
Dim PdFileVM = New ProdFileVM(PdFileM)
|
||||
IdAndBTLFileNames.Add(sPdId & " | " & PdFileVM.sBTLFileName)
|
||||
End If
|
||||
Next
|
||||
Return IdAndBTLFileNames
|
||||
@@ -133,6 +134,7 @@ Public Class OnlyProdManagerVM
|
||||
' Definizione comandi
|
||||
Private m_cmdNew As ICommand
|
||||
Private m_cmdOpen As ICommand
|
||||
Private m_cmdOpenMruFile As ICommand
|
||||
Private m_cmdSave As ICommand
|
||||
Private m_cmdImportBTL As ICommand
|
||||
Private m_cmdUpdateBTL As ICommand
|
||||
@@ -241,7 +243,7 @@ Public Class OnlyProdManagerVM
|
||||
Return SetCurrProj(CurrProj.nProjId)
|
||||
End Function
|
||||
|
||||
Private Function InitNewProject(ByRef nProjId As Integer, ByRef sProjectDir As String, nType As BWType, Machine As Machine) As Boolean
|
||||
Private Function InitNewProj(ByRef nProjId As Integer, ByRef sProjectDir As String, nType As BWType, Machine As Machine) As Boolean
|
||||
' se non ho ricevuto numero progetto da sovrascrivere
|
||||
If nProjId = 0 Then
|
||||
' richiedo indice nuovo progetto
|
||||
@@ -269,7 +271,7 @@ Public Class OnlyProdManagerVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function InitNewProjectPROD(ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sProjectDir As String) As Boolean
|
||||
Friend Function InitNewProd(ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sProjectDir As String) As Boolean
|
||||
' richiedo indice nuovo progetto
|
||||
nProdId = DbControllers.m_ProdController.GetNextIndex(nProjId, Map.refMainWindowVM.MainWindowM.GetKeyNumber())
|
||||
If nProdId <= 0 Then Return False
|
||||
@@ -290,7 +292,7 @@ Public Class OnlyProdManagerVM
|
||||
End Function
|
||||
|
||||
Private Sub ReloadBTLStructure()
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(Map.refOnlyProdManagerVM.CurrProd.nProdId))
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(CurrProj.nProjId))
|
||||
' verifico se volume pezzi calcolato
|
||||
Dim bIsCalculated As Boolean = False
|
||||
For Each BTLPart In Map.refProjectVM.BTLStructureVM.BTLPartVMList
|
||||
@@ -328,11 +330,11 @@ Public Class OnlyProdManagerVM
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(Map.refProjManagerVM.CurrProj, ProjectType.PROJ) Then Return
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.GOTOPROD, 3, EgtMsg(63004), EgtMsg(63011), 10) ' Optimization opening ' Loading environment
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> Map.refProjManagerVM.CurrProj.nProdId OrElse IsNothing(Map.refProdManagerVM.CurrProd)) Then
|
||||
Map.refProdManagerVM.SetCurrProd(m_nProjIdToOpen)
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(True)
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso (m_nProjIdToOpen <> Map.refProjManagerVM.CurrProj.nProdId OrElse IsNothing(CurrProd)) Then
|
||||
SetCurrProd(m_nProjIdToOpen)
|
||||
CurrProd.SetReloadProject(True)
|
||||
Else
|
||||
Map.refProdManagerVM.CurrProd.SetReloadProject(False)
|
||||
CurrProd.SetReloadProject(False)
|
||||
End If
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 2
|
||||
@@ -349,11 +351,18 @@ Public Class OnlyProdManagerVM
|
||||
m_nProjIdToOpen = GDB_ID.NULL
|
||||
End Sub
|
||||
|
||||
Private Sub InitProd()
|
||||
Public Sub OpenProjectFromSupervisor(ProjIdToOpen As Integer)
|
||||
If (Not IsNothing(m_CurrProd) AndAlso ProjIdToOpen <> m_CurrProd.nProdId) OrElse Map.refMainMenuVM.SelPage <> Pages.ONLYPRODPAGE Then
|
||||
m_nProjIdToOpen = ProjIdToOpen
|
||||
m_bOpenProj = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub NewProdFromProj()
|
||||
' inizializzo nuovo progetto PROD
|
||||
Dim nProdId As Integer = 0
|
||||
Dim sProdDir As String = ""
|
||||
InitNewProjectPROD(m_CurrProj.nProjId, nProdId, sProdDir)
|
||||
InitNewProd(m_CurrProj.nProjId, nProdId, sProdDir)
|
||||
' setto il PType del Prod
|
||||
DbControllers.m_ProdController.UpdatePType(nProdId, CurrProj.nType)
|
||||
' setto la Macchina associata al Prod
|
||||
@@ -374,17 +383,23 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
If bOk Then
|
||||
' aggiorno path proj
|
||||
Map.refOnlyProdManagerVM.UpdateCurrProj()
|
||||
UpdateCurrProj()
|
||||
' imposto currprod
|
||||
Map.refOnlyProdManagerVM.SetCurrProd(nProdId)
|
||||
SetCurrProd(nProdId)
|
||||
' imposto TempCurrProd
|
||||
Map.refOnlyProdManagerVM.TempCurrProd = Map.refOnlyProdManagerVM.CurrProd
|
||||
TempCurrProd = CurrProd
|
||||
' setto flag nuovo progetto in prod
|
||||
Map.refOnlyProdManagerVM.CurrProd.bIsNew = True
|
||||
CurrProd.bIsNew = True
|
||||
Else
|
||||
' elimino da DB
|
||||
DbControllers.m_ProdController.DeleteProd(nProdId, True)
|
||||
End If
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 2
|
||||
If GetMainPrivateProfileInt(S_WAREHOUSE, EgtBEAMWALL.Core.ConstIni.K_TYPE, nDefault) = WarehouseType.MEDIUM Then
|
||||
' Se di tipo Medium confronto le Sezioni del BTL importato con quelle in Warehouse
|
||||
WarehouseWndVM.UpdateSectionXMaterial()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ManageImportLog(nProjId As Integer, sProjDir As String)
|
||||
@@ -483,7 +498,7 @@ Public Class OnlyProdManagerVM
|
||||
' inizializzo nuovo progetto PROJ
|
||||
Dim nProjId As Integer = 0
|
||||
Dim sProjDir As String = ""
|
||||
InitNewProject(nProjId, sProjDir, nType, Machine)
|
||||
InitNewProj(nProjId, sProjDir, nType, Machine)
|
||||
SetCurrProj(nProjId)
|
||||
' carico lista macchine e macchina del progetto per il pulsante Reset Macchina del CALCPanel
|
||||
Map.refCALCPanelVM.LoadMachineList()
|
||||
@@ -512,7 +527,7 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(Map.refProjectVM.BTLStructureVM.nPROJTYPE = BWType.WALL AndAlso Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.NESTING_AUTO))
|
||||
' inizializzo nuovo progetto PROD
|
||||
InitProd()
|
||||
NewProdFromProj()
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61876))
|
||||
End If
|
||||
@@ -575,11 +590,11 @@ Public Class OnlyProdManagerVM
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.OPENPROD, 3, EgtMsg(63004), EgtMsg(63001), 50) ' Optimization opening ' Loading project geometries
|
||||
If File.Exists(sFilePath) Then
|
||||
' se la macchina del progetto in apertura non è tra le macchine disponibili lo segnalo e apro un progetto vuoto
|
||||
If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = Map.refOnlyProdManagerVM.TempCurrProd.sMachine)) Then
|
||||
If IsNothing(Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = TempCurrProd.sMachine)) Then
|
||||
' rimuovo il file in apertura dalla lista degli MRU
|
||||
Map.refOnlyProdManagerVM.m_MruFiles.Remove(sFilePath)
|
||||
m_MruFiles.Remove(sFilePath)
|
||||
MessageBox.Show(EgtMsg(61885), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
Map.refOnlyProdManagerVM.NewProject()
|
||||
NewProject()
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
Else
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
@@ -610,6 +625,37 @@ Public Class OnlyProdManagerVM
|
||||
|
||||
#End Region ' OpenCommand
|
||||
|
||||
#Region "OpenMruFileCommand"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Open.
|
||||
''' </summary>
|
||||
Public ReadOnly Property OpenMruFileCommand As ICommand
|
||||
Get
|
||||
If m_cmdOpenMruFile Is Nothing Then
|
||||
m_cmdOpenMruFile = New Command(AddressOf OpenMruFile)
|
||||
End If
|
||||
Return m_cmdOpenMruFile
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Open. This method is invoked by the OpenCommand.
|
||||
''' </summary>
|
||||
Public Sub OpenMruFile(ByVal param As Object)
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return
|
||||
' ricavo l'Id e il progetto associato per l'apertura di quest'ultimo
|
||||
Dim PdId As Integer = 0
|
||||
Dim arrStrPdId As String() = DirectCast(param, String).Split("|")
|
||||
Integer.TryParse(arrStrPdId(0), PdId)
|
||||
Dim PdFileM = DbControllers.m_ProdController.FindCoreByProdId(PdId)
|
||||
Dim PdFileVM = New ProdFileVM(PdFileM)
|
||||
OpenProject(PdFileVM)
|
||||
End Sub
|
||||
|
||||
#End Region ' OpenMruFileCommand
|
||||
|
||||
#Region "SaveCommand"
|
||||
|
||||
''' <summary>
|
||||
@@ -649,15 +695,15 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
' verifico se Reset Macchina modificato e nel caso aggiorno DB e CurrProj
|
||||
If Map.refCALCPanelVM.IsMachineModified() Then
|
||||
DbControllers.m_ProdController.UpdateMachine(Map.refOnlyProdManagerVM.CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
Map.refOnlyProdManagerVM.CurrProd.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
DbControllers.m_ProdController.UpdateMachine(CurrProd.nProdId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
CurrProd.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
' ciclo sulla lista di ProjId associati
|
||||
For Each ProjId In Map.refOnlyProdManagerVM.CurrProd.nProjIdList
|
||||
For Each ProjId In CurrProd.nProjIdList
|
||||
' aggiorno la Macchina per i ProjId associati sul DB
|
||||
DbControllers.m_ProjController.UpdateMachine(ProjId, Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
' se uno dei Proj interessati equivale al Proj correntemente aperto setto la Macchina dello stesso
|
||||
' (poichè il progetto corrente non viene riaperto e riletto dal DB)
|
||||
If ProjId = Map.refOnlyProdManagerVM.CurrProj.nProjId Then Map.refOnlyProdManagerVM.CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
If ProjId = CurrProj.nProjId Then CurrProj.SetMachine(Map.refCALCPanelVM.SelectedMachine.Name)
|
||||
Next
|
||||
Map.refCALCPanelVM.ResetMachineModified()
|
||||
End If
|
||||
@@ -693,8 +739,8 @@ Public Class OnlyProdManagerVM
|
||||
''' Execute the ImportBTL. This method is invoked by the ImportBTLCommand.
|
||||
''' </summary>
|
||||
Public Sub ImportBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True)
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
'If Not ProdFileVM.VerifyProjectModification(CurrProd) Then Return
|
||||
'If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
If Not ProdFileVM.VerifyProjectModification(CurrProd) Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
If bWithDlg Then
|
||||
@@ -764,7 +810,7 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.IMPORTBTL, 3, EgtMsg(63008), EgtMsg(63009), 50) ' BTL file importing ' Reading BTL file
|
||||
' inizializzo nuovo progetto
|
||||
InitNewProject(nProjId, sProjDir, nType, Machine)
|
||||
InitNewProj(nProjId, sProjDir, nType, Machine)
|
||||
SetCurrProj(nProjId)
|
||||
' imposto il tipo di parametri Q da utilizzare
|
||||
BTLIniFile.m_nBTLBWType = nType
|
||||
@@ -835,8 +881,10 @@ Public Class OnlyProdManagerVM
|
||||
' CheckMe impostata come cancellazione FISICA dal DB...
|
||||
DbControllers.m_ProjController.DeleteProj(nProjId, False)
|
||||
End If
|
||||
' inizializzo nuovo progetto PROD
|
||||
InitProd()
|
||||
If bOk Then
|
||||
' inizializzo nuovo progetto PROD
|
||||
NewProdFromProj()
|
||||
End If
|
||||
' carico filtri di ricerca
|
||||
Map.refProjectVM.BTLStructureVM.LoadFilters()
|
||||
' gestisco log di importazione
|
||||
@@ -933,7 +981,7 @@ Public Class OnlyProdManagerVM
|
||||
' setto il flag per inizializzazione gestore travi e pareti per importare progetto
|
||||
Dim nFlag As Integer
|
||||
Dim sBTLFlag As String
|
||||
If Map.refOnlyProdManagerVM.nProdType = Core.ConstBeam.BWType.BEAM Then
|
||||
If nProdType = Core.ConstBeam.BWType.BEAM Then
|
||||
sBTLFlag = K_BTLFLAG
|
||||
Else
|
||||
sBTLFlag = K_WALLBTLFLAG
|
||||
@@ -1274,7 +1322,7 @@ Public Class OnlyProdManagerVM
|
||||
Dim nAsseBaseToEraseId As Integer = 0
|
||||
EgtGetInfo(nAsseBaseId, BTL_PRT_PROJ, nAsseBaseProjId)
|
||||
' se AsseBase di questo step del ciclo è nuovo e suo ProjId uguale a quello del progetto corrente
|
||||
If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = Map.refOnlyProdManagerVM.CurrProd.nProdId Then
|
||||
If Not AsseBaseIdList.Contains(nAsseBaseId) AndAlso nAsseBaseProjId = CurrProd.nProdId Then
|
||||
' riloco i sottonodi del nuovo AsseBase nell'AsseBase del progetto aperto col medesimo ProjId
|
||||
Dim AsseBaseSubNodeId As Integer = EgtGetFirstInGroup(nAsseBaseId)
|
||||
While AsseBaseSubNodeId <> GDB_ID.NULL
|
||||
@@ -1285,7 +1333,7 @@ Public Class OnlyProdManagerVM
|
||||
EgtGetInfo(FindAsseBaseId, BTL_PRT_PROJ, SameAsseBaseProjId)
|
||||
' se l'ho trovato esco dal While (FindAsseBaseId è l'id dell'AsseBase in cui vogliamo rilocare i sottonodi)
|
||||
'If SameAsseBaseProjId = Map.refProjManagerVM.CurrProj.nProjId Then Exit While
|
||||
If SameAsseBaseProjId = Map.refOnlyProdManagerVM.CurrProd.nProdId Then Exit While
|
||||
If SameAsseBaseProjId = CurrProd.nProdId Then Exit While
|
||||
FindAsseBaseId = EgtGetNextName(FindAsseBaseId, ASSEBASE)
|
||||
End While
|
||||
' salvo id dell'AsseBase corrente per ottenere il seguente prima di rilocarlo
|
||||
@@ -1345,7 +1393,7 @@ Public Class OnlyProdManagerVM
|
||||
' copio il file originale scelto nel dialog per l'Update nella cartella Proj del progetto corrente
|
||||
If File.Exists(sFile) Then
|
||||
'Dim sDestPath As String = Map.refProjManagerVM.CurrProj.sProjDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
Dim sDestPath As String = Map.refOnlyProdManagerVM.CurrProd.sProdDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
Dim sDestPath As String = CurrProd.sProdDirPath & "\" & Path.GetFileNameWithoutExtension(sFile)
|
||||
While File.Exists(sDestPath & ".btl")
|
||||
sDestPath &= "_1"
|
||||
End While
|
||||
@@ -1389,11 +1437,11 @@ Public Class OnlyProdManagerVM
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return Nothing
|
||||
If IsNothing(CurrProj) Then Return Nothing
|
||||
Case Pages.MACHINING
|
||||
If ProdFileVM.VerifyProjectModification(Map.refProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return Nothing
|
||||
If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(CurrProd) Then Return Nothing
|
||||
Case Pages.ONLYPRODPAGE
|
||||
If ProdFileVM.VerifyProjectModification(Map.refOnlyProdManagerVM.CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(Map.refOnlyProdManagerVM.CurrProd) Then Return Nothing
|
||||
If ProdFileVM.VerifyProjectModification(CurrProd) = MessageBoxResult.Cancel Then Return Nothing
|
||||
If IsNothing(CurrProd) Then Return Nothing
|
||||
Case Else
|
||||
Return Nothing
|
||||
End Select
|
||||
@@ -1409,7 +1457,7 @@ Public Class OnlyProdManagerVM
|
||||
LoadingWndHelper.OpenLoadingWnd(ActiveIds.EXPORTPROJECT, 2, EgtMsg(63010), EgtMsg(63016), 30) ' Project exporting ' Adding export info
|
||||
' se assemblato me lo segno e lo smonto
|
||||
Dim bShowBuilding As Boolean = False
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
|
||||
If Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE Then
|
||||
If Map.refShowBeamPanelVM.bShowAll Then
|
||||
' verifico se assemblato e lo annullo per salvataggio
|
||||
bShowBuilding = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
|
||||
@@ -1450,7 +1498,7 @@ Public Class OnlyProdManagerVM
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
' impacchetto tutta la cartella del progetto
|
||||
Dim sProjectDirPath As String = If(CurrProd.nProdId > 0, CurrProd.sProdDirPath, CurrProj.sProjDirPath)
|
||||
Dim sProjectDirPath As String = If(CurrProd.nProdId > 0, CurrProd.sProdDirPath, CurrProd.sProjDirPath)
|
||||
For Each sFile As String In Directory.GetFiles(sProjectDirPath)
|
||||
zip.AddItem(sFile, "")
|
||||
Next
|
||||
@@ -1490,11 +1538,11 @@ Public Class OnlyProdManagerVM
|
||||
''' Execute the Export. This method is invoked by the ExportCommand.
|
||||
''' </summary>
|
||||
Public Sub ImportProject()
|
||||
Dim CurrProd As ProjectFileVM = Map.refOnlyProdManagerVM.CurrProd
|
||||
Dim TempCurrProd As ProjectFileVM = m_CurrProd
|
||||
' lista di tutti gli errori riscontrati
|
||||
Dim ErrorList As New List(Of String)
|
||||
'If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
If ProdFileVM.VerifyProjectModification(CurrProd) Then Return
|
||||
If ProdFileVM.VerifyProjectModification(TempCurrProd) Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, "", sDir)
|
||||
' apro finestra scelta file
|
||||
@@ -1579,7 +1627,7 @@ Public Class OnlyProdManagerVM
|
||||
' inizializzo nuovo proj
|
||||
Dim nNewProjId As Integer = 0
|
||||
Dim sNewProjDir As String = ""
|
||||
InitNewProject(nNewProjId, sNewProjDir, nType, Machine)
|
||||
InitNewProj(nNewProjId, sNewProjDir, nType, Machine)
|
||||
NewProjIdList.Add(nNewProjId)
|
||||
' imposto ProjId di caricamento
|
||||
m_nLoadingProjId = nImportProjId
|
||||
@@ -1664,22 +1712,14 @@ Public Class OnlyProdManagerVM
|
||||
nDuploId = EgtGetNext(nDuploId)
|
||||
End While
|
||||
' resetto CurrProd per evitare di leggere valori produzione dal Db di quel progetto
|
||||
If Not IsNothing(Map.refProdManagerVM) Then
|
||||
Map.refProdManagerVM.CurrProd = Nothing
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Map.refOnlyProdManagerVM.CurrProd = Nothing
|
||||
End If
|
||||
CurrProd = Nothing
|
||||
' carico Machgroup che non verrebbero altrimenti importati
|
||||
Map.refProjectVM.MachGroupPanelVM = New MyMachGroupPanelVM(MyMachGroupPanelM.CreateMyMachGroupPanel(Map.refMachinePanelVM.MachineList.ToList()))
|
||||
If Map.refProjectVM.MachGroupPanelVM.MachGroupVMList.Count > 0 Then
|
||||
' inizializzo nuovo progetto PROD
|
||||
Dim nProdId As Integer = 0
|
||||
Dim sProdDir As String = ""
|
||||
If Not IsNothing(Map.refProdManagerVM) Then
|
||||
Map.refProdManagerVM.InitNewProject(NewProjIdList(0), nProdId, sProdDir)
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Map.refOnlyProdManagerVM.InitNewProjectPROD(NewProjIdList(0), nProdId, sProdDir)
|
||||
End If
|
||||
InitNewProd(NewProjIdList(0), nProdId, sProdDir)
|
||||
' setto il PType del Prod
|
||||
DbControllers.m_ProdController.UpdatePType(nProdId, nType)
|
||||
' setto la Macchina associata al Prod
|
||||
@@ -1748,14 +1788,10 @@ Public Class OnlyProdManagerVM
|
||||
' imposto progetto corrente
|
||||
If NewProjIdList.Count > 0 Then
|
||||
SetCurrProj(NewProjIdList(0))
|
||||
OpenProject(CurrProd) ' Da controllare
|
||||
OpenProject(TempCurrProd) ' Da controllare
|
||||
End If
|
||||
' ripristino eventuale CurrProd precedente
|
||||
If Not IsNothing(Map.refProdManagerVM) Then
|
||||
Map.refProdManagerVM.CurrProd = CurrProd
|
||||
ElseIf Not IsNothing(Map.refOnlyProdManagerVM) Then
|
||||
Map.refOnlyProdManagerVM.CurrProd = CurrProd
|
||||
End If
|
||||
CurrProd = TempCurrProd
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName))
|
||||
LoadingWndHelper.CloseLoadingWnd(ActiveIds.IMPORTPROJECT)
|
||||
End Sub
|
||||
@@ -1792,7 +1828,7 @@ Public Class OnlyProdManagerVM
|
||||
Select Case VerifyResult
|
||||
Case MessageBoxResult.Yes, MessageBoxResult.OK
|
||||
' salvo proj
|
||||
Map.refOnlyProdManagerVM.Save()
|
||||
Save()
|
||||
Case MessageBoxResult.Cancel
|
||||
Return
|
||||
Case Else ' No
|
||||
@@ -1892,7 +1928,7 @@ Public Class OnlyProdManagerVM
|
||||
End If
|
||||
' mando richiesta di apertura progetto in supervisore
|
||||
'Dim x = DbControllers.m_StatusMapController.GetProd
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, Map.refOnlyProdManagerVM.CurrProd.nProdId, Map.refOnlyProdManagerVM.CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "")
|
||||
DbControllers.m_StatusMapController.UpdateAction(DbControllers.m_SupervisorId, CurrProd.nProdId, CurrProd.nProdId, StatusMapItemType.Comm, StatusMapOpType.ChangeProdInSupervisorRequest, "")
|
||||
End Sub
|
||||
|
||||
#End Region ' GoToSupervisor
|
||||
|
||||
Reference in New Issue
Block a user