Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.net class structure

Status
Not open for further replies.

trenta87

Programmer
Oct 29, 2007
13
0
0
US
Hello

Im creating a program to record data into an access database. The program will be able to create accounts which will hold contact information etc. I have created an account class and multiple other classes such as credit control contact details and decision maker contact details which are inherited from the class contact details. Im just unsure how to create instances of accounts which relate to the contact details of credit control and decision maker. Could someone help please. Below are the classes im using.

Account --------------------------------------
Public Class Account

Private mSessionID As Integer
Private mName As String
Private mRouteNo As Integer
Private mDifRouteNo As Integer
Private mBusiness As String
Private mSiebelID As Integer

Private mCreditControl As CreditControl
Private mDecision As Decision

'properties
Public Property SessionID() As Integer
Get
Return mSessionID
End Get
Set(ByVal value As Integer)
mSessionID = value
End Set
End Property

Public Property RouteNo() As Integer
Get
Return mRouteNo
End Get
Set(ByVal value As Integer)
mRouteNo = value
End Set
End Property

Public Property DifRouteNo() As Integer
Get
Return mDifRouteNo
End Get
Set(ByVal value As Integer)
mDifRouteNo = value
End Set
End Property

Public Property Name() As Integer
Get
Return mName
End Get
Set(ByVal value As Integer)
mName = value
End Set
End Property

Public Property Business() As Integer
Get
Return mBusiness
End Get
Set(ByVal value As Integer)
mBusiness = value
End Set
End Property

Public Property CreditControl() As CreditControl
Get
Return mCreditControl
End Get
Set(ByVal value As CreditControl)
mCreditControl = value
End Set
End Property

Public Property Decision() As Decision
Get
Return mDecision
End Get
Set(ByVal value As Decision)
mDecision = value
End Set
End Property

Public Sub New(ByVal sessionid As Integer, ByVal name As String, ByVal routeno As Integer, ByVal difrouteno As Integer, ByVal business As String, ByVal credit As CreditControl, ByVal decision As Decision)
mSessionID = sessionid
mName = name
mRouteNo = routeno
mDifRouteNo = difrouteno
mBusiness = business
mCreditControl = credit
mDecision = decision
End Sub

End Class
----------------------------------------------------------
CreditControl
Public Class CreditControl
Inherits Contact_Details

'Constructor methods
Public Sub New()
End Sub

Public Sub New(ByVal surname As String, ByVal forename As String, ByVal phone As Integer)
surname = surname
forename = forename
PhoneNumber = phone
End Sub

Public Sub New(ByVal surname As String, ByVal forename As String, ByVal phone As Integer, ByVal fax As Integer, ByVal emailAddress As String)
surname = surname
forename = forename
PhoneNumber = phone
FaxNumber = fax
Email = emailAddress
End Sub
End Class
---------------------------------------------------------
Decision Maker
Public Class Decision
Inherits Contact_Details

'Constructor methods
Public Sub New()
End Sub

Public Sub New(ByVal surname As String, ByVal forename As String, ByVal phone As Integer)
surname = surname
forename = forename
PhoneNumber = phone
End Sub

Public Sub New(ByVal surname As String, ByVal forename As String, ByVal phone As Integer, ByVal fax As Integer, ByVal emailAddress As String)
surname = surname
forename = forename
PhoneNumber = phone
FaxNumber = fax
Email = emailAddress
End Sub
End Class
-----------------------------------------------------------
Contact Details
Public MustInherit Class Contact_Details

'attributes
Protected Surname As String
Protected Forename As String
Protected mTitle As Title
Protected mPhoneNumber As Integer
Protected mFaxNumber As Integer
Protected mEmail As String

'properties
Public Property LastName() As String
Get
Return Surname
End Get
Set(ByVal value As String)
Surname = value
End Set
End Property

Public Property FirstName() As String
Get
Return Forename
End Get
Set(ByVal value As String)
Forename = value
End Set
End Property

Public Property Title() As Title
Get
Return mTitle
End Get
Set(ByVal value As Title)
mTitle = value
End Set
End Property


Public Property phoneNumber() As Integer
Get
Return mPhoneNumber
End Get
Set(ByVal value As Integer)
mPhoneNumber = value
End Set
End Property

Public Property faxNumber() As Integer
Get
Return mFaxNumber
End Get
Set(ByVal value As Integer)
mFaxNumber = value
End Set
End Property

Public Property email() As String
Get
Return mEmail
End Get
Set(ByVal value As String)
mEmail = value
End Set
End Property

'Constructor methods
Public Sub New()
End Sub

End Class
----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top