Imports System.Text

''' <summary>
''' In order to access object properties in Silverlight the OrderProduct and User classes must be declared as public.
''' </summary>
Public Class OrderProduct
    Private _partId As Integer
    Private _productName As String
    Private _quantity As Integer
    Private _price As Single

    Public Property PartId() As Integer
        Get
            Return _partId
        End Get
        Set(ByVal value As Integer)
            _partId = value
        End Set
    End Property

    Public Property ProductName() As String
        Get
            Return _productName
        End Get
        Set(ByVal value As String)
            _productName = value
        End Set
    End Property

    Public Property Quantity() As Integer
        Get
            Return _quantity
        End Get
        Set(ByVal value As Integer)
            _quantity = value
        End Set
    End Property

    Public Property Price() As Single
        Get
            Return _price
        End Get
        Set(ByVal value As Single)
            _price = value
        End Set
    End Property
End Class

Public Class User
    Private _fullName As String
    Private _emailAddress As String
    Private _password As String

    Public Property FullName() As String
        Get
            Return _fullName
        End Get
        Set(ByVal value As String)
            _fullName = value
        End Set
    End Property

    Public Property EmailAddress() As String
        Get
            Return _emailAddress
        End Get
        Set(ByVal value As String)
            _emailAddress = value
        End Set
    End Property

    Public Property Password() As String
        Get
            Return _password
        End Get
        Set(ByVal value As String)
            _password = value
        End Set
    End Property

    Public Function GetOrders() As OrderProduct()
        Dim ops(2) As OrderProduct

        ops(0) = New OrderProduct()
        ops(0).PartId = 1239
        ops(0).Price = 104.09F
        ops(0).ProductName = "Product A"
        ops(0).Quantity = 3

        ops(1) = New OrderProduct()
        ops(1).PartId = 22
        ops(1).Price = 134.09F
        ops(1).ProductName = "Product B"
        ops(1).Quantity = 1

        ops(2) = New OrderProduct()
        ops(2).PartId = 167
        ops(2).Price = 14.7F
        ops(2).ProductName = "Product C"
        ops(2).Quantity = 5

        Return ops
    End Function
End Class