Compare commits

...

1 Commits

Author SHA1 Message Date
Emmanuele Sassi b43a8ff2bb - correzione creazione grezzi 2023-06-01 11:34:33 +02:00
@@ -285,6 +285,39 @@ Module WarehouseHelper
End If
ParamIndex += 1
End While
Else
Dim ParamIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, ParamIndex, String.Empty, sSxMValue, sWarehousePath) > 0
Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro
Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(1)
StringToLenAdv(sSectXMatValues(0), dH)
If SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
If sSectXMatValues.Length <= 2 Then Return Nothing
Dim sValue As String = ""
If EgtUILib.GetPrivateProfileString(S_WALL, "S" & sSectXMatValues(2), String.Empty, sValue, sWarehousePath) Then
Dim sParamValues() As String = sValue.Split(","c)
' verifico numero minimo di parametri
If sParamValues.Count < 3 Then Return Nothing
' cancello spazi
For Index = 0 To sParamValues.Count - 1
sParamValues(Index) = sParamValues(Index).Trim()
Next
Dim dW As Double = 0
Dim dL As Double = 0
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLenAdv(sParamValues(1), dW)
StringToLenAdv(sParamValues(2), dL)
If sParamValues.Count >= 3 Then Integer.TryParse(sParamValues(3), nQty)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(4), nActive)
Return New SParam(New SectionXMaterial(dW, dH, dL, sSectXMatValues(1)), dW, dL, nQty, nActive > 0)
End If
End If
ParamIndex += 1
End While
End If
Return Nothing
@@ -336,6 +369,50 @@ Module WarehouseHelper
End If
SectIndex += 1
End While
Else
' cerco sezione
Dim SectIndex As Integer = 1
Dim sSxMValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL_LIST, SectIndex, String.Empty, sSxMValue, sWarehousePath) > 0
Dim sSectXMatValues() As String = sSxMValue.Split(","c)
' creo parametro
Dim dH As Double = 0
Dim sMaterial As String = sSectXMatValues(1)
StringToLenAdv(sSectXMatValues(0), dH)
If SectXMat.dH = dH AndAlso SectXMat.sMaterial(0) = sMaterial Then
' recupero indice di SParam
Dim SParamIndex As Integer = 1
Dim sValue As String = ""
While EgtUILib.GetPrivateProfileString(S_WALL, "S" & SParamIndex, String.Empty, sValue, sWarehousePath)
Dim sParamValues() As String = sValue.Split(","c)
' verifico numero minimo di parametri
If sParamValues.Count < 3 Then Return
' cancello spazi
For Index = 0 To sParamValues.Count - 1
sParamValues(Index) = sParamValues(Index).Trim()
Next
Dim dW As Double = 0
Dim dL As Double = 0
Dim nSectIndex As Integer = sParamValues(0)
Dim nQty As Integer = 0
Dim nActive As Integer = 1
StringToLenAdv(sParamValues(1), dW)
StringToLenAdv(sParamValues(2), dL)
If sParamValues.Count >= 4 Then Integer.TryParse(sParamValues(3), nQty)
If sParamValues.Count >= 5 Then Integer.TryParse(sParamValues(4), nActive)
Dim bActive As Boolean = nActive = 1
If dW = SParam.dW AndAlso dL = SParam.dL AndAlso nQty = SParam.nQuantity AndAlso bActive = SParam.bActive Then
' scrivo indice ultimo materiale
EgtUILib.WritePrivateProfileString(S_WALL_LIST, SectIndex,
LenToString(dH, 3) & "," &
sMaterial & "," &
SParamIndex, sWarehousePath)
End If
SParamIndex += 1
End While
End If
SectIndex += 1
End While
End If
End Sub