Class building

Harcon

Member
Joined
May 8, 2012
Messages
18
Programming Experience
1-3
I have created a class and now i want to add a extra level.

Variables 1 until 4 i have created. But in one variable i want to make sub variables how can i program that?

Class.jpg

VB.NET:
Public Class VermaatApplicationUser

    Private _name As String
    Private _UserID As Integer
    Private _Sett_Applicatiebeheer As Boolean
    Private _Sett_logistiek As Boolean
    Private _Sett_IDL As Integer
    Private _Sett_Facturatie As Integer
    Private _Sett_Beheer As Integer
    Private _Sett_Gebruikers As Integer
    Private _Sett_Bulkorders As Integer
    Private _Sett_Rapport1 As Integer
    Private _Sett_Rapport2 As Integer
    Private _Basislocatie As Integer
    Private _Afdeling As Integer
    Private _Debiteurengroep As Integer

    Public ReadOnly Property name() As String
        Get
            Return _name
        End Get
    End Property

    Public ReadOnly Property Basislocatie() As String
        Get
            Return _Basislocatie
        End Get
    End Property

    Public ReadOnly Property UserIdentity() As String
        Get
            Return _UserID
        End Get
    End Property

    Public ReadOnly Property Applicatiebeheer() As Boolean
        Get
            Return _Sett_Applicatiebeheer
        End Get
    End Property

    Public ReadOnly Property Logistiek() As Boolean
        Get
            Return _Sett_logistiek
        End Get
    End Property

    Public ReadOnly Property beheer() As Boolean
        Get
            Return _Sett_Beheer
        End Get
    End Property

    Public ReadOnly Property Gebruikersbeheer() As Boolean
        Get
            Return _Sett_Gebruikers
        End Get
    End Property

    Public ReadOnly Property Bulkorders() As Boolean
        Get
            Return _Sett_Bulkorders

        End Get
    End Property

    Public ReadOnly Property Rapportage1() As Boolean
        Get
            Return _Sett_Rapport1
        End Get
    End Property

    Public ReadOnly Property Rapportage2() As Boolean
        Get
            Return _Sett_Rapport2
        End Get
    End Property

    Public ReadOnly Property Afdeling() As Boolean
        Get
            Return _Afdeling
        End Get
    End Property


    Public ReadOnly Property Debiteurengroep() As Boolean
        Get
            Return _Debiteurengroep
        End Get
    End Property


    Public Sub New(ByVal name As String, ByVal Basislocatie As Integer, ByVal ID As Integer, ByVal Applicatiebeheer As Boolean, ByVal Logistiek As Boolean, ByVal IDL As Boolean, ByVal facturatie As Boolean, ByVal beheer As Boolean, ByVal gebruikers As Boolean, ByVal bulkorders As Boolean, ByVal rapport1 As Boolean, ByVal rapport2 As Boolean, ByVal Afdeling As Integer, ByVal Debiteurgroep As Integer)
        _name = name
        _Basislocatie = _Basislocatie
        _UserID = ID
        _Sett_Applicatiebeheer = Applicatiebeheer
        _Sett_logistiek = Logistiek
        _Sett_IDL = IDL
        _Sett_Facturatie = facturatie
        _Sett_Beheer = beheer
        _Sett_Gebruikers = gebruikers
        _Sett_Bulkorders = bulkorders
        _Sett_Rapport1 = rapport1
        _Sett_Rapport2 = rapport2
        _Basislocatie = Basislocatie
        _Afdeling = Afdeling
        _Debiteurengroep = Debiteurgroep
    End Sub

End Class
 
You need to declare a property of a type that has those other properties. You've basically already got what you're talking about. Your VermaatApplicationUser class has a UserIdentity property of type String and the String class has a Length property, e.g.
userIdentityLength = myVermaatApplicationUser.UserIdentity.Length
 
You need to declare a property of a type that has those other properties. You've basically already got what you're talking about. Your VermaatApplicationUser class has a UserIdentity property of type String and the String class has a Length property, e.g.
userIdentityLength =  myVermaatApplicationUser.UserIdentity.Length

oke, but when i want to make a sub level of settings

VB.NET:
myVermaatApplicationUser.settings.Logistics

where logistics a boolean is?
 
You are thinking too hard about it. You already have the main type. Now you want to expose a property of type Settings, and that type must expose a property of type Boolean:

Public Class MyVermaatApplicationUserType
Public Property Settings As UserSettings
End Class

Public Class UserSettings
Public Property Logistics As Boolean
End Class
 
Back
Top