Public Class Sales
Public Property salesperson() As String
Get
Return m_salesperson
End Get
Set(value As String)
m_salesperson = Value
End Set
End Property
Private m_salesperson As String
Public Property region() As String
Get
Return m_region
End Get
Set(value As String)
m_region = Value
End Set
End Property
Private m_region As String
Public Property account_number() As Double
Get
Return m_account_number
End Get
Set(value As Double)
m_account_number = Value
End Set
End Property
Private m_account_number As Double
Public Property amount() As Decimal
Get
Return m_amount
End Get
Set(value As Decimal)
m_amount = Value
End Set
End Property
Private m_amount As Decimal
Public Property month() As String
Get
Return m_month
End Get
Set(value As String)
m_month = Value
End Set
End Property
Private m_month As String
Public Sub New(reader As IDataReader)
Dim nv = New NullValue()
salesperson = If(reader.IsDBNull(0), nv.NullString, reader.GetString(0))
region = If(reader.IsDBNull(1), nv.NullString, reader.GetString(1))
account_number = If(reader.IsDBNull(2), nv.NullDouble, reader.GetDouble(2))
amount = If(reader.IsDBNull(3), nv.NullDecimal, reader.GetDecimal(3))
month = If(reader.IsDBNull(4), nv.NullString, reader.GetString(4))
End Sub
Public Shared Iterator Function GetSalesInfo(reader As IDataReader) As IEnumerable(Of Sales)
While reader.Read()
Yield New Sales(reader)
End While
End Function
End Class