- Correzzione warning
- Cambiata gestione tipo progetto e macchina associata
This commit is contained in:
@@ -283,7 +283,7 @@ Public Class BTLFeatureM
|
||||
NewBTLFeature.m_sCALC_MSG = sMsg
|
||||
If nErr = 0 Then
|
||||
NewBTLFeature.nState = CalcStates.OK
|
||||
ElseIf nErr = 17 Then
|
||||
ElseIf nErr = 17 Or nErr = 19 Then
|
||||
NewBTLFeature.nState = CalcStates.WARNING
|
||||
ElseIf nErr > 0 Then
|
||||
NewBTLFeature.nState = CalcStates.ERROR_
|
||||
@@ -312,22 +312,6 @@ Public Class BTLFeatureM
|
||||
Return NewBTLFeature
|
||||
End Function
|
||||
|
||||
'Sub New(ParentPart As BTLPartM, nFeatureId As Integer)
|
||||
' m_ParentPart = ParentPart
|
||||
' m_nFeatureId = nFeatureId
|
||||
' m_PParamList = New ObservableCollection(Of BTLParam)
|
||||
' m_QParamList = New ObservableCollection(Of BTLParam)
|
||||
'End Sub
|
||||
|
||||
'Sub New(nPRC As Integer, nGRP As Integer, nSIDE As Integer)
|
||||
' m_PParamList = New ObservableCollection(Of BTLParam)
|
||||
' m_QParamList = New ObservableCollection(Of BTLParam)
|
||||
' m_nPRC = nPRC
|
||||
' m_nSelGRP = nGRP
|
||||
' m_nSelSIDE = nSIDE
|
||||
' m_bDO = True
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
@@ -168,9 +168,9 @@ Public Class BTLFeatureVM
|
||||
Select Case m_BTLFeatureM.nCALC_ERR
|
||||
Case 22
|
||||
Return "c"
|
||||
Case 19, 23, 24, 25
|
||||
Case 23, 24, 25
|
||||
Return "e"
|
||||
Case 17
|
||||
Case 17, 19
|
||||
Return "w"
|
||||
Case < 0
|
||||
Return "i"
|
||||
|
||||
@@ -349,7 +349,7 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
''' <summary>
|
||||
''' Execute the New. This method is invoked by the NewCommand.
|
||||
''' </summary>
|
||||
Friend Overridable Sub Delete()
|
||||
Public Overridable Sub Delete()
|
||||
End Sub
|
||||
|
||||
#End Region ' Delete
|
||||
|
||||
@@ -27,15 +27,16 @@ Public Class ProdFileM
|
||||
Return New ProdFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType) As ProdFileM
|
||||
Dim NewProjectFileM As New ProdFileM
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_sName = sName
|
||||
NewProjectFileM.m_nType = nType
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
Public Shared Function CreateProdFileM(nProdId As Integer, nProjIdList As List(Of Integer), dtCreateProjDate As DateTime, sName As String, nType As BWType, sMachine As String) As ProdFileM
|
||||
Dim NewProjectFileM As New ProdFileM
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_nProjIdList = nProjIdList
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_sName = sName
|
||||
NewProjectFileM.m_nType = nType
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
|
||||
@@ -37,19 +37,21 @@ Public Class ProjFileM
|
||||
Return New ProjFileM
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String, sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType) As ProjFileM
|
||||
Dim NewProjectFileM As New ProjFileM
|
||||
NewProjectFileM.m_nProjId = nProjId
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_dtExportDate = dtExportDate
|
||||
NewProjectFileM.m_sListName = sListName
|
||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||
NewProjectFileM.m_bIsNew = IsNew
|
||||
NewProjectFileM.m_bIsLocked = IsLocked
|
||||
NewProjectFileM.m_nType = nType
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
Public Shared Function CreateProjFileM(nProjId As Integer, nProdId As Integer, dtCreateProjDate As DateTime, dtExportDate As DateTime, sListName As String,
|
||||
sBTLFileName As String, IsNew As Boolean, IsLocked As Boolean, nType As BWType, sMachine As String) As ProjFileM
|
||||
Dim NewProjectFileM As New ProjFileM
|
||||
NewProjectFileM.m_nProjId = nProjId
|
||||
NewProjectFileM.m_nProdId = nProdId
|
||||
NewProjectFileM.m_dtCreateDate = dtCreateProjDate
|
||||
NewProjectFileM.m_dtExportDate = dtExportDate
|
||||
NewProjectFileM.m_sListName = sListName
|
||||
NewProjectFileM.m_sBTLFileName = sBTLFileName
|
||||
NewProjectFileM.m_bIsNew = IsNew
|
||||
NewProjectFileM.m_bIsLocked = IsLocked
|
||||
NewProjectFileM.m_nType = nType
|
||||
NewProjectFileM.m_sMachine = sMachine
|
||||
Return NewProjectFileM
|
||||
End Function
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
|
||||
@@ -54,29 +54,28 @@ Public Class ProjectFileM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_nType As BWType
|
||||
Public Property nType As BWType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
Set(value As BWType)
|
||||
m_nType = value
|
||||
End Set
|
||||
End Property
|
||||
Protected m_nType As BWType
|
||||
Public Property nType As BWType
|
||||
Get
|
||||
Return m_nType
|
||||
End Get
|
||||
Set(value As BWType)
|
||||
m_nType = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_sMachine As String
|
||||
Public Property sMachine As String
|
||||
Get
|
||||
Return m_sMachine
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sMachine = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTORS"
|
||||
|
||||
'Sub New(nProjectType As ProjectType, nProjId As Integer, nProdId As Integer, sBTLFileName As String)
|
||||
' m_nProjectType = nProjectType
|
||||
' If m_nProjectType = ProjectType.PROJ Then
|
||||
' m_nProjId = nProjId
|
||||
' m_nProdId = nProdId
|
||||
' m_BTLFileName = sBTLFileName
|
||||
' ElseIf m_nProjectType = ProjectType.PROD Then
|
||||
' m_nProdId = nProdId
|
||||
' End If
|
||||
'End Sub
|
||||
|
||||
#End Region ' CONSTRUCTORS
|
||||
|
||||
End Class
|
||||
@@ -111,6 +111,12 @@ Public Class ProjectFileVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMachine As String
|
||||
Get
|
||||
Return m_ProjectFileM.sMachine
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property Id_Msg As String
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
protected Core.ProdFileM coreConv(ProdModel currProd)
|
||||
{
|
||||
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType);
|
||||
Core.ProdFileM answ = Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(currProd.ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine);
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
{
|
||||
var currProd = FindByProdId(ProdId);
|
||||
|
||||
return Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(ProdId), currProd.DtCreated, currProd.Description, currProd.PType);
|
||||
return Core.ProdFileM.CreateProdFileM(currProd.ProdId, ProjIdByProd(ProdId), currProd.DtCreated, currProd.Description, currProd.PType, currProd.Machine);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -225,7 +225,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
List<Core.ProdFileM> result = new List<Core.ProdFileM>();
|
||||
var dbResult = GetLastDbModelDesc(numRecord);
|
||||
// conversione
|
||||
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType)).ToList();
|
||||
result = dbResult.Select(x => Core.ProdFileM.CreateProdFileM(x.ProdId, ProjIdByProd(x.ProdId), x.DtCreated, x.Description, x.PType, x.Machine)).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <returns></returns>
|
||||
protected Core.ProjFileM coreConv(ProjModel currProj)
|
||||
{
|
||||
Core.ProjFileM answ = Core.ProjFileM.CreateProjFileM(currProj.ProjId, ProdIdByProdDbId(currProj.ProdDbId), currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.IsNew, currProj.Locked, currProj.PType);
|
||||
Core.ProjFileM answ = Core.ProjFileM.CreateProjFileM(currProj.ProjId, ProdIdByProdDbId(currProj.ProdDbId), currProj.DtCreated, currProj.DtExported, currProj.ListName, currProj.BTLFileName, currProj.IsNew, currProj.Locked, currProj.PType, currProj.Machine);
|
||||
return answ;
|
||||
}
|
||||
|
||||
@@ -409,10 +409,11 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
bool done = false;
|
||||
var item2update = dbCtx
|
||||
.ProjList
|
||||
.Where(x => x.ProjDbId == updItem.ProjDbId)
|
||||
.Where(x => x.ProjId == updItem.ProjId)
|
||||
.SingleOrDefault();
|
||||
try
|
||||
{
|
||||
updItem.ProjDbId = item2update.ProjDbId;
|
||||
// update, vers 1...
|
||||
dbCtx.Entry(item2update).CurrentValues.SetValues(updItem);
|
||||
|
||||
@@ -425,7 +426,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
ResetController();
|
||||
done = true;
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{ }
|
||||
return done;
|
||||
}
|
||||
@@ -519,7 +520,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
/// <param name="ListName"></param>
|
||||
/// <param name="DtExported"></param>
|
||||
/// <returns></returns>
|
||||
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string ListName, DateTime DtExported, BWType PType)
|
||||
public Core.ProjFileM UpdateInfo(int ProjId, string BTLFileName, string ListName, DateTime DtExported, BWType PType, string Machine)
|
||||
{
|
||||
var currData = FindByProjId(ProjId);
|
||||
// aggiorno valore BTL
|
||||
@@ -527,6 +528,7 @@ namespace EgtBEAMWALL.DataLayer.Controllers
|
||||
currData.DtExported = DtExported;
|
||||
currData.ListName = ListName;
|
||||
currData.PType = PType;
|
||||
currData.Machine = Machine;
|
||||
|
||||
// Commit changes
|
||||
dbCtx.SaveChanges();
|
||||
|
||||
@@ -237,7 +237,7 @@ Public Class BTLFeatureVM
|
||||
m_BTLFeatureM.sCALC_MSG = MSG
|
||||
If ERR = 0 Then
|
||||
m_BTLFeatureM.nState = CalcStates.OK
|
||||
ElseIf ERR = 17 Then
|
||||
ElseIf ERR = 17 Or ERR = 19 Then
|
||||
m_BTLFeatureM.nState = CalcStates.WARNING
|
||||
ElseIf ERR > 0 Then
|
||||
m_BTLFeatureM.nState = CalcStates.ERROR_
|
||||
|
||||
@@ -1204,7 +1204,7 @@ Public Class BTLPartVM
|
||||
ElseIf m_BTLPartM.nGlobalState = CalcStates.INFO Then
|
||||
Return Brushes.Green
|
||||
ElseIf m_BTLPartM.nGlobalState = CalcStates.WARNING Then
|
||||
Return Brushes.Gold
|
||||
Return Brushes.Orange
|
||||
ElseIf m_BTLPartM.nGlobalState = CalcStates.ERROR_ Then
|
||||
Return Brushes.Red
|
||||
Else
|
||||
|
||||
@@ -232,17 +232,25 @@ Public Class BTLStructureVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property nPROJTYPE As BWType
|
||||
Public ReadOnly Property nPROJTYPE As BWType
|
||||
Get
|
||||
Return m_BTLStructureM.m_nPROJTYPE
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
Return Map.refProjManagerVM.nProjType
|
||||
Case Pages.MACHINING
|
||||
Return Map.refProdManagerVM.nProdType
|
||||
Case Else
|
||||
Return BWType.NULL
|
||||
End Select
|
||||
'Return m_BTLStructureM.m_nPROJTYPE
|
||||
End Get
|
||||
Set(value As BWType)
|
||||
If EgtSetInfo(m_BTLStructureM.nBTLInfoId, BTL_GEN_PROJTYPE, value) Then
|
||||
m_BTLStructureM.m_nPROJTYPE = value
|
||||
Else
|
||||
NotifyPropertyChanged(NameOf(nPROJTYPE))
|
||||
End If
|
||||
End Set
|
||||
'Set(value As BWType)
|
||||
' If EgtSetInfo(m_BTLStructureM.nBTLInfoId, BTL_GEN_PROJTYPE, value) Then
|
||||
' m_BTLStructureM.m_nPROJTYPE = value
|
||||
' Else
|
||||
' NotifyPropertyChanged(NameOf(nPROJTYPE))
|
||||
' End If
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
Public Property sLISTNAME As String
|
||||
|
||||
@@ -45,28 +45,6 @@ Public Class MachinePanelVM
|
||||
End If
|
||||
NotifyPropertyChanged(NameOf(BeamTable_Visibility))
|
||||
NotifyPropertyChanged(NameOf(WallTable_Visibility))
|
||||
' se il tipo della macchina selezionata non è congruo al tipo progetto del Proj o del Prod correnti
|
||||
' resetto quello non congruo di questi due, assieme a BTLStructure e MachGroupPanel
|
||||
Dim bReset As Boolean = False
|
||||
If Not IsNothing(Map.refProjectVM) AndAlso
|
||||
Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso
|
||||
nMachType <> 3 Then
|
||||
If Not IsNothing(Map.refProjManagerVM.CurrProj) AndAlso
|
||||
nMachType <> Map.refProjManagerVM.CurrProj.nType Then
|
||||
Map.refProjManagerVM.ResetCurrProj()
|
||||
bReset = True
|
||||
End If
|
||||
If Not IsNothing(Map.refProdManagerVM.CurrProd) AndAlso
|
||||
nMachType <> Map.refProdManagerVM.CurrProd.nType Then
|
||||
Map.refProdManagerVM.ResetCurrProd()
|
||||
bReset = True
|
||||
End If
|
||||
If bReset AndAlso Not IsNothing(Map.refProjectVM) Then
|
||||
Map.refProjectVM.BTLStructureVM = Nothing
|
||||
Map.refProjectVM.MachGroupPanelVM = Nothing
|
||||
EgtNewFile()
|
||||
End If
|
||||
End If
|
||||
' aggiorno nome macchina in statusbar
|
||||
Map.refMyStatusBarVM.RefreshMachName()
|
||||
End If
|
||||
|
||||
@@ -40,7 +40,7 @@ Public Class OpenProjectFileDialogVM
|
||||
m_ProjectList_View.Filter = AddressOf ProjectFilter
|
||||
End Function
|
||||
|
||||
Friend Sub Delete()
|
||||
Public Overrides Sub Delete()
|
||||
If IsNothing(SelProject) Then Return
|
||||
' recupero indice per riselezionare
|
||||
Dim ProjListIndex As Integer = m_ProjectList.IndexOf(SelProject)
|
||||
|
||||
@@ -36,6 +36,12 @@ Public Class ProdManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProdType As BWType
|
||||
Get
|
||||
Return If(Not IsNothing(CurrProd), CurrProd.nType, BWType.NULL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_MruFiles As New MruList
|
||||
Public ReadOnly Property MruFileNames As ObservableCollection(Of String)
|
||||
Get
|
||||
|
||||
@@ -48,6 +48,12 @@ Public Class ProjManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property nProjType As BWType
|
||||
Get
|
||||
Return If(Not IsNothing(CurrProj), CurrProj.nType, BWType.NULL)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' indice progetto in caricamento
|
||||
Private m_nLoadingProjId As Integer = 0
|
||||
Public ReadOnly Property nLoadingProjId As Integer
|
||||
@@ -56,14 +62,6 @@ Public Class ProjManagerVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' tipo progetto (Beam o Wall)
|
||||
Private m_nProjType As BWType = 0
|
||||
Public ReadOnly Property nProjType As BWType
|
||||
Get
|
||||
Return m_nProjType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend m_MruFiles As New MruList
|
||||
Public ReadOnly Property MruFileNames As ObservableCollection(Of String)
|
||||
Get
|
||||
@@ -200,12 +198,13 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function InitNewProject(ByRef nProjId As Integer, ByRef sProjectDir As String) As Boolean
|
||||
Private Function InitNewProject(ByRef nProjId As Integer, ByRef sProjectDir As String, nType As BWType) As Boolean
|
||||
' richiedo indice nuovo progetto
|
||||
nProjId = DbControllers.m_ProjController.GetNextIndex()
|
||||
' salvo data creazione progetto
|
||||
DbControllers.m_ProjController.Update(New ProjModel() With {.ProjId = nProjId,
|
||||
.DtCreated = DateTime.Now()})
|
||||
Dim x = DbControllers.m_ProjController.Update(New ProjModel() With {.ProjId = nProjId,
|
||||
.DtCreated = DateTime.Now(),
|
||||
.PType = nType})
|
||||
If nProjId <= 0 Then Return False
|
||||
sProjectDir = refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000")
|
||||
' creo cartella nuovo progetto
|
||||
@@ -280,26 +279,27 @@ Public Class ProjManagerVM
|
||||
' verifico se progetto modificato, e chiedo se salvare
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
' setto il tipo progetto in base al tipo macchina
|
||||
Dim nType As BWType = BWType.NULL
|
||||
If CurrentMachine.nType = Core.ConstBeam.MachineType.BOTH Then
|
||||
' se tipo macchina è BOTH apro dialog per settare tipo progetto a Beam o a Wall
|
||||
Dim ProjectTypeWndVM As New ProjectTypeWndVM()
|
||||
Dim ProjectTypeWnd As New ProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM)
|
||||
If ProjectTypeWnd.ShowDialog() Then
|
||||
m_nProjType = ProjectTypeWndVM.nSelType
|
||||
nType = ProjectTypeWndVM.nSelType
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
ElseIf CurrentMachine.nType = Core.ConstBeam.MachineType.BEAM Then
|
||||
m_nProjType = BWType.BEAM
|
||||
nType = BWType.BEAM
|
||||
ElseIf CurrentMachine.nType = Core.ConstBeam.MachineType.WALL Then
|
||||
m_nProjType = BWType.WALL
|
||||
nType = BWType.WALL
|
||||
End If
|
||||
' creo nuovo progetto
|
||||
If Map.refSceneHostVM.MainController.NewProject() Then
|
||||
' inizializzo nuovo progetto
|
||||
Dim nProjId As Integer = 0
|
||||
Dim sProjDir As String = ""
|
||||
InitNewProject(nProjId, sProjDir)
|
||||
InitNewProject(nProjId, sProjDir, nType)
|
||||
SetCurrProj(nProjId)
|
||||
Dim sProjFileName As String = sProjDir & "\" & nProjId.ToString("0000") & ".nge"
|
||||
' imposto ProjId di caricamento
|
||||
@@ -309,14 +309,12 @@ Public Class ProjManagerVM
|
||||
EgtSetName(nBTLInfoLayer, BTLINFO)
|
||||
EgtSetLevel(nBTLInfoLayer, GDB_LV.SYSTEM)
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.UpdateBTLInfoLayer()
|
||||
' setto il tipo di progetto nella BTLStructure creata
|
||||
Map.refProjectVM.BTLStructureVM.nPROJTYPE = m_nProjType
|
||||
' scrivo info proj su layer BtlInfo
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, nProjId)
|
||||
' salvo il progetto
|
||||
If EgtSaveFile(sProjFileName, NGE.CMPTEXT) Then
|
||||
SectionXMaterial.SetType(m_nProjType)
|
||||
DbControllers.m_ProjController.UpdateInfo(nProjId, "Hand made", "", Date.MinValue, m_nProjType)
|
||||
SectionXMaterial.SetType(nType)
|
||||
DbControllers.m_ProjController.UpdateInfo(nProjId, "Hand made", "", Date.MinValue, nType, Map.refMachinePanelVM.SelectedMachine.Name)
|
||||
SetCurrProj(nProjId)
|
||||
End If
|
||||
Else
|
||||
@@ -371,57 +369,10 @@ Public Class ProjManagerVM
|
||||
Else
|
||||
sFilePath = TempCurrProj.sProjPath
|
||||
End If
|
||||
' apro un nuovo contesto per leggere il tipo progetto senza caricare nel programma il progetto intero
|
||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||
Dim nTempCtx As Integer = EgtInitContext()
|
||||
Dim nBTLProjType As Integer
|
||||
If nTempCtx <> 0 Then
|
||||
EgtOpenFile(sFilePath)
|
||||
Dim ProjectType As ProjectType = If(Map.refMainMenuVM.SelPage = Pages.VIEW, ProjectType.PROJ, ProjectType.PROD)
|
||||
Dim ProjId As Integer = If(ProjectType = ProjectType.PROJ, Map.refProjManagerVM.nLoadingProjId, 0)
|
||||
Dim nBTLInfoId As Integer
|
||||
Dim sValue As String = String.Empty
|
||||
' se devo filtrare un progetto
|
||||
If ProjId > 0 Then
|
||||
' cerco tra i layer BTLInfo
|
||||
Dim nBTLInfoLayerId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
While nBTLInfoLayerId <> GDB_ID.NULL
|
||||
' verifico se il layer appartiene al ProjId
|
||||
Dim nBTLInfoLayerProjId As Integer
|
||||
EgtGetInfo(nBTLInfoLayerId, BTL_PRT_PROJ, nBTLInfoLayerProjId)
|
||||
If nBTLInfoLayerProjId = ProjId Then
|
||||
nBTLInfoId = nBTLInfoLayerId
|
||||
Exit While
|
||||
End If
|
||||
nBTLInfoLayerId = EgtGetNextName(nBTLInfoLayerId, BTLINFO)
|
||||
End While
|
||||
Else
|
||||
nBTLInfoId = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
End If
|
||||
EgtGetInfo(nBTLInfoId, BTL_GEN_PROJTYPE, nBTLProjType)
|
||||
' verifico che il tipo di progetto sia congruo al tipo di macchina corrente
|
||||
Dim bOkType As Boolean = True
|
||||
Select Case CurrentMachine.nType
|
||||
Case Core.ConstBeam.MachineType.NULL
|
||||
bOkType = False
|
||||
Case Core.ConstBeam.MachineType.BEAM
|
||||
If nBTLProjType <> BWType.BEAM Then bOkType = False
|
||||
Case Core.ConstBeam.MachineType.WALL
|
||||
If nBTLProjType <> BWType.WALL Then bOkType = False
|
||||
Case Core.ConstBeam.MachineType.BOTH
|
||||
' non fare niente
|
||||
End Select
|
||||
' torno sul contesto corrente
|
||||
EgtSetCurrentContext(nCurrCtx)
|
||||
EgtDeleteContext(nTempCtx)
|
||||
' se il tipo non è congruo mostro msg d'errore ed esco dall'apertura progetto
|
||||
If Not bOkType Then
|
||||
MessageBox.Show(EgtMsg(61881), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
SectionXMaterial.SetType(nBTLProjType)
|
||||
SectionXMaterial.SetType(TempCurrProj.nType)
|
||||
If Map.refSceneHostVM.MainController.OpenProject(sFilePath, False) Then
|
||||
' imposto macchina del progetto
|
||||
Map.refMachinePanelVM.SelectedMachine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = TempCurrProj.sMachine)
|
||||
' aggiorno le colonne in base al tipo progetto
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
@@ -545,24 +496,26 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
End If
|
||||
' setto il tipo progetto in base al tipo macchina
|
||||
Dim nType As BWType = BWType.NULL
|
||||
If CurrentMachine.nType = Core.ConstBeam.MachineType.BOTH Then
|
||||
' se tipo macchina è BOTH apro dialog per settare tipo progetto a Beam o a Wall
|
||||
Dim ProjectTypeWndVM As New ProjectTypeWndVM()
|
||||
Dim ProjectTypeWnd As New ProjectTypeWndV(Application.Current.MainWindow, ProjectTypeWndVM)
|
||||
If ProjectTypeWnd.ShowDialog() Then
|
||||
m_nProjType = ProjectTypeWndVM.nSelType
|
||||
nType = ProjectTypeWndVM.nSelType
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
ElseIf CurrentMachine.nType = Core.ConstBeam.MachineType.BEAM Then
|
||||
m_nProjType = BWType.BEAM
|
||||
nType = BWType.BEAM
|
||||
ElseIf CurrentMachine.nType = Core.ConstBeam.MachineType.WALL Then
|
||||
m_nProjType = BWType.WALL
|
||||
nType = BWType.WALL
|
||||
End If
|
||||
' inizializzo nuovo progetto
|
||||
Dim nProjId As Integer = 0
|
||||
Dim sProjDir As String = ""
|
||||
InitNewProject(nProjId, sProjDir)
|
||||
InitNewProject(nProjId, sProjDir, nType)
|
||||
SetCurrProj(nProjId)
|
||||
' imposto ProjId di caricamento
|
||||
m_nLoadingProjId = nProjId
|
||||
' copio file BTL
|
||||
@@ -587,15 +540,15 @@ Public Class ProjManagerVM
|
||||
EgtOutLog("Errore nell'importazione BTL")
|
||||
End If
|
||||
If bOk Then
|
||||
SectionXMaterial.SetType(m_nProjType)
|
||||
SectionXMaterial.SetType(nType)
|
||||
' aggiorno Db
|
||||
Dim sBTLFileName As String = Path.GetFileNameWithoutExtension(sFile)
|
||||
'UpdateBTLFileName(nProjId, sBTLFileName)
|
||||
Dim ExportDate As DateTime
|
||||
DateTime.TryParse(Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPDATE & " " &
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPTIME, ExportDate)
|
||||
DbControllers.m_ProjController.UpdateInfo(nProjId, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, m_nProjType)
|
||||
SetCurrProj(nProjId)
|
||||
DbControllers.m_ProjController.UpdateInfo(nProjId, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, nType, Map.refMachinePanelVM.SelectedMachine.Name)
|
||||
SetCurrProj(nProjId)
|
||||
Map.refMainWindowVM.UpdateTitle()
|
||||
' mostro tutti i pezzi
|
||||
Map.refShowBeamPanelVM.ShowAll()
|
||||
@@ -766,7 +719,7 @@ Public Class ProjManagerVM
|
||||
' inizializzo nuovo proj
|
||||
Dim nNewProjId As Integer = 0
|
||||
Dim sNewProjDir As String = ""
|
||||
InitNewProject(nNewProjId, sNewProjDir)
|
||||
InitNewProject(nNewProjId, sNewProjDir, nType)
|
||||
NewProjIdList.Add(nNewProjId)
|
||||
' imposto ProjId di caricamento
|
||||
m_nLoadingProjId = nImportProjId
|
||||
@@ -804,8 +757,8 @@ Public Class ProjManagerVM
|
||||
Dim ExportDate As DateTime
|
||||
DateTime.TryParse(Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPDATE & " " &
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.m_sEXPTIME, ExportDate)
|
||||
DbControllers.m_ProjController.UpdateInfo(nNewProjId, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, BWType.NULL)
|
||||
Else
|
||||
DbControllers.m_ProjController.UpdateInfo(nNewProjId, sBTLFileName, Map.refProjectVM.BTLStructureVM.sLISTNAME, ExportDate, BWType.NULL, Map.refMachinePanelVM.SelectedMachine.Name)
|
||||
Else
|
||||
' elimino da Db
|
||||
DbControllers.m_ProjController.DeleteProj(nNewProjId)
|
||||
End If
|
||||
|
||||
@@ -26,98 +26,98 @@ Public Class ProdFileVM
|
||||
Return refMainWindowVM.MainWindowM.sProjsDir & "\" & nProjId.ToString("0000") & "\" & nProjId.ToString("0000") & ".nge"
|
||||
End Function
|
||||
|
||||
' funzione che restituisce le parti di nome file
|
||||
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROD Then
|
||||
Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
Else Return False
|
||||
End If
|
||||
End Function
|
||||
'' funzione che restituisce le parti di nome file
|
||||
'Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
' If nProjectType = ProjectType.PROJ Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If DataFromFileName.Count = 3 Then
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
' Else Return False
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
' Else
|
||||
' nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' sBTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' Return True
|
||||
' Else Return False
|
||||
' End If
|
||||
' ElseIf nProjectType = ProjectType.PROD Then
|
||||
' Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
' Else Return False
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
' funzione che dato un nome file e il tipo restituisce il corretto numero di progetto
|
||||
Friend Shared Function GetProjectNumber(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If String.IsNullOrWhiteSpace(ProjectFileName) Then
|
||||
nProjId = 0
|
||||
nProdId = 0
|
||||
sBTLFileName = ""
|
||||
Return False
|
||||
ElseIf ProjectFileName.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROJ Then
|
||||
Dim ProjectFileNameProd As String = Integer.TryParse(ProjectFileName, nProdId)
|
||||
Dim nTempProjId As Integer = 0
|
||||
Dim nTempProdId As Integer = 0
|
||||
Dim sTempBTLFileName As String = ""
|
||||
' ricavo lista cartelle proj
|
||||
Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(Map.refMainWindowVM.MainWindowM.sProjsDir)
|
||||
For Each Directory In AllDirsInDir
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Directory)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nTempProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nTempProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sTempBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
If ProjectFileNameProd = nTempProdId Then
|
||||
nProjId = nTempProjId
|
||||
nProdId = nTempProdId
|
||||
sTempBTLFileName = sBTLFileName
|
||||
Return True
|
||||
End If
|
||||
Else Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
'' funzione che dato un nome file e il tipo restituisce il corretto numero di progetto
|
||||
'Friend Shared Function GetProjectNumber(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
' If String.IsNullOrWhiteSpace(ProjectFileName) Then
|
||||
' nProjId = 0
|
||||
' nProdId = 0
|
||||
' sBTLFileName = ""
|
||||
' Return False
|
||||
' ElseIf ProjectFileName.Contains(FILENAMESEPARATOR) Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If DataFromFileName.Count = 3 Then
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
' Else Return False
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
' Else
|
||||
' nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' sBTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' Return True
|
||||
' Else Return False
|
||||
' End If
|
||||
' ElseIf nProjectType = ProjectType.PROJ Then
|
||||
' Dim ProjectFileNameProd As String = Integer.TryParse(ProjectFileName, nProdId)
|
||||
' Dim nTempProjId As Integer = 0
|
||||
' Dim nTempProdId As Integer = 0
|
||||
' Dim sTempBTLFileName As String = ""
|
||||
' ' ricavo lista cartelle proj
|
||||
' Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(Map.refMainWindowVM.MainWindowM.sProjsDir)
|
||||
' For Each Directory In AllDirsInDir
|
||||
' Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Directory)
|
||||
' For Each File In AllFilesInDir
|
||||
' If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
' If File.Contains(FILENAMESEPARATOR) Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If DataFromFileName.Count = 3 Then
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), nTempProjId)
|
||||
' Else Return False
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), nTempProdId)
|
||||
' Else
|
||||
' nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' sTempBTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' If ProjectFileNameProd = nTempProdId Then
|
||||
' nProjId = nTempProjId
|
||||
' nProdId = nTempProdId
|
||||
' sTempBTLFileName = sBTLFileName
|
||||
' Return True
|
||||
' End If
|
||||
' Else Return False
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Next
|
||||
' End If
|
||||
' Return False
|
||||
'End Function
|
||||
|
||||
Friend Shared Function VerifyProjectModification(CurrProject As ProdFileVM) As Boolean
|
||||
If IsNothing(CurrProject) Then Return True
|
||||
|
||||
@@ -15,98 +15,98 @@ Public Class ProjFileVM
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
' funzione che restituisce le parti di nome file
|
||||
Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If nProjectType = ProjectType.PROJ Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROD Then
|
||||
Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
Else Return False
|
||||
End If
|
||||
End Function
|
||||
'' funzione che restituisce le parti di nome file
|
||||
'Friend Shared Function VerifyProjectFile(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
' If nProjectType = ProjectType.PROJ Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If DataFromFileName.Count = 3 Then
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
' Else Return False
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
' Else
|
||||
' nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' sBTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' Return True
|
||||
' Else Return False
|
||||
' End If
|
||||
' ElseIf nProjectType = ProjectType.PROD Then
|
||||
' Return Integer.TryParse(ProjectFileName, nProdId)
|
||||
' Else Return False
|
||||
' End If
|
||||
'End Function
|
||||
|
||||
' funzione che dato un nome file e il tipo restituisce il corretto numero di progetto
|
||||
Friend Shared Function GetProjectNumber(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
If String.IsNullOrWhiteSpace(ProjectFileName) Then
|
||||
nProjId = 0
|
||||
nProdId = 0
|
||||
sBTLFileName = ""
|
||||
Return False
|
||||
ElseIf ProjectFileName.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
Return True
|
||||
Else Return False
|
||||
End If
|
||||
ElseIf nProjectType = ProjectType.PROJ Then
|
||||
Dim ProjectFileNameProd As String = Integer.TryParse(ProjectFileName, nProdId)
|
||||
Dim nTempProjId As Integer = 0
|
||||
Dim nTempProdId As Integer = 0
|
||||
Dim sTempBTLFileName As String = ""
|
||||
' ricavo lista cartelle proj
|
||||
Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(Map.refMainWindowVM.MainWindowM.sProjsDir)
|
||||
For Each Directory In AllDirsInDir
|
||||
Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Directory)
|
||||
For Each File In AllFilesInDir
|
||||
If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
If File.Contains(FILENAMESEPARATOR) Then
|
||||
Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
If DataFromFileName.Count = 3 Then
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
Integer.TryParse(DataFromFileName(0), nTempProjId)
|
||||
Else Return False
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
Integer.TryParse(DataFromFileName(1), nTempProdId)
|
||||
Else
|
||||
nProdId = 0
|
||||
End If
|
||||
If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
sTempBTLFileName = DataFromFileName(2)
|
||||
End If
|
||||
If ProjectFileNameProd = nTempProdId Then
|
||||
nProjId = nTempProjId
|
||||
nProdId = nTempProdId
|
||||
sTempBTLFileName = sBTLFileName
|
||||
Return True
|
||||
End If
|
||||
Else Return False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
'' funzione che dato un nome file e il tipo restituisce il corretto numero di progetto
|
||||
'Friend Shared Function GetProjectNumber(nProjectType As ProjectType, ProjectFileName As String, ByRef nProjId As Integer, ByRef nProdId As Integer, ByRef sBTLFileName As String) As Boolean
|
||||
' If String.IsNullOrWhiteSpace(ProjectFileName) Then
|
||||
' nProjId = 0
|
||||
' nProdId = 0
|
||||
' sBTLFileName = ""
|
||||
' Return False
|
||||
' ElseIf ProjectFileName.Contains(FILENAMESEPARATOR) Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If DataFromFileName.Count = 3 Then
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), nProjId)
|
||||
' Else Return False
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), nProdId)
|
||||
' Else
|
||||
' nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' sBTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' Return True
|
||||
' Else Return False
|
||||
' End If
|
||||
' ElseIf nProjectType = ProjectType.PROJ Then
|
||||
' Dim ProjectFileNameProd As String = Integer.TryParse(ProjectFileName, nProdId)
|
||||
' Dim nTempProjId As Integer = 0
|
||||
' Dim nTempProdId As Integer = 0
|
||||
' Dim sTempBTLFileName As String = ""
|
||||
' ' ricavo lista cartelle proj
|
||||
' Dim AllDirsInDir As IEnumerable(Of String) = IO.Directory.EnumerateDirectories(Map.refMainWindowVM.MainWindowM.sProjsDir)
|
||||
' For Each Directory In AllDirsInDir
|
||||
' Dim AllFilesInDir As IEnumerable(Of String) = IO.Directory.EnumerateFiles(Directory)
|
||||
' For Each File In AllFilesInDir
|
||||
' If Path.GetExtension(File).ToLower() = ".nge" Then
|
||||
' If File.Contains(FILENAMESEPARATOR) Then
|
||||
' Dim DataFromFileName As String() = ProjectFileName.Split(FILENAMESEPARATOR)
|
||||
' If DataFromFileName.Count = 3 Then
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(0)) Then
|
||||
' Integer.TryParse(DataFromFileName(0), nTempProjId)
|
||||
' Else Return False
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(1)) Then
|
||||
' Integer.TryParse(DataFromFileName(1), nTempProdId)
|
||||
' Else
|
||||
' nProdId = 0
|
||||
' End If
|
||||
' If Not String.IsNullOrEmpty(DataFromFileName(2)) Then
|
||||
' sTempBTLFileName = DataFromFileName(2)
|
||||
' End If
|
||||
' If ProjectFileNameProd = nTempProdId Then
|
||||
' nProjId = nTempProjId
|
||||
' nProdId = nTempProdId
|
||||
' sTempBTLFileName = sBTLFileName
|
||||
' Return True
|
||||
' End If
|
||||
' Else Return False
|
||||
' End If
|
||||
' End If
|
||||
' End If
|
||||
' Next
|
||||
' Next
|
||||
' End If
|
||||
' Return False
|
||||
'End Function
|
||||
|
||||
Friend Shared Function VerifyProjectModification(CurrProject As ProjFileVM, Type As ProjectType) As Boolean
|
||||
If IsNothing(CurrProject) Then Return True
|
||||
@@ -142,10 +142,6 @@ Public Class ProjFileVM
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Shared Function PostVerifyProjectModification(CurrProject As ProjFileVM, Type As ProjectType) As Boolean
|
||||
|
||||
End Function
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
@@ -615,8 +615,6 @@ Public Class MySceneHostVM
|
||||
If bOk Then
|
||||
' leggo struttura BTL
|
||||
Map.refProjectVM.BTLStructureVM = New BTLStructureVM(BTLStructureM.CreateBTLStructure(0))
|
||||
' setto il tipo di progetto nella BTLStructure creata
|
||||
Map.refProjectVM.BTLStructureVM.nPROJTYPE = Map.refProjManagerVM.nProjType
|
||||
' Ricavo il tipo di Warehouse settato nell'INI
|
||||
Dim nDefault As Integer = 1
|
||||
If GetMainPrivateProfileInt(S_GENERAL, K_WAREHOUSE, nDefault) = WarehouseType.MEDIUM Then
|
||||
|
||||
@@ -36,7 +36,6 @@ Friend Module MachParamIniFile
|
||||
End Function
|
||||
|
||||
Public Function GetMachPrivateProfileString(IpAppName As String, IpKeyName As String, IpDefault As String, ByRef IpString As String) As Integer
|
||||
Dim x = EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, sMachParamIniFile)
|
||||
Return EgtUILib.GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, sMachParamIniFile)
|
||||
End Function
|
||||
|
||||
|
||||
Reference in New Issue
Block a user