Sub Class_Globals
Type typPie(sCodPie As String, sDesPie As String, nQta3mn As Double)
Private mPies As Map
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
mPies.Initialize
FillPiesMapTestNoDB(mPies)
End Sub
Private Sub FillPiesMapTestNoDB(mapPies As Map)
mapPies.Clear
Dim CodPie As String
For r = 1 To 10
CodPie = "CodPie_" & r
Dim Pie As typPie
Pie = CreatetypPie(CodPie, "DesPie_" & r, r)
mapPies.Put(CodPie, Pie)
Next
Log("Valori iniziali")
Log(mapPies.Get("CodPie_2").As(typPie).sCodPie)
Log(mapPies.Get("CodPie_2").As(typPie).sDesPie)
Log(mapPies.Get("CodPie_2").As(typPie).nQta3mn)
Dim Record() As Object = Array As Object("CodPie_2", "DesPie_2", 2)
Dim CodPie As String = Record(0)
If mapPies.ContainsKey(CodPie) Then
Dim Pie As typPie = mapPies.Get(CodPie)
Pie.nQta3mn = Pie.nQta3mn + 123
End If
Log("Quantità aggiornata")
Log(mapPies.Get("CodPie_2").As(typPie).sCodPie)
Log(mapPies.Get("CodPie_2").As(typPie).sDesPie)
Log(mapPies.Get("CodPie_2").As(typPie).nQta3mn)
End Sub
Public Sub CreatetypPie (sCodPie As String, sDesPie As String, nQta3mn As Double) As typPie
Dim t1 As typPie
t1.Initialize
t1.sCodPie = sCodPie
t1.sDesPie = sDesPie
t1.nQta3mn = nQta3mn
Return t1
End Sub