' <fileinfo name="ProductsAboveAveragePriceRow_Base.vb">
' <copyright>
' All rights reserved.
' </copyright>
' <remarks>
' Do not change this source code manually. Changes to this file may
' cause incorrect behavior and will be lost if the code is regenerated.
' </remarks>
' <generator rewritefile="True" infourl="http://www.SharpPower.com">RapTier</generator>
' </fileinfo>
Option Strict Off
Option Explicit On
Imports System
''' <summary>
''' The base class for <see cref="ProductsAboveAveragePriceRow"/> that
''' represents a record in the <c>Products Above Average Price</c> view.
''' </summary>
''' <remarks>
''' Do not change this source code manually. Update the <see cref="ProductsAboveAveragePriceRow"/>
''' class if you need to add or change some functionality.
''' </remarks>
Public MustInherit Class ProductsAboveAveragePriceRow_Base
Private _productName As String
Private _unitPrice As Decimal
Private _unitPriceNull As Boolean = True
''' <summary>
''' Initializes a new instance of the <see cref="ProductsAboveAveragePriceRow_Base"/> class.
''' </summary>
Public Sub New()
MyBase.New()
' EMPTY
End Sub
''' <summary>
''' Gets or sets the <c>ProductName</c> column value.
''' </summary>
''' <value>The <c>ProductName</c> column value.</value>
Public Property ProductName As String
Get
Return _productName
End Get
Set
_productName = value
End Set
End Property
''' <summary>
''' Gets or sets the <c>UnitPrice</c> column value.
''' This column is nullable.
''' </summary>
''' <value>The <c>UnitPrice</c> column value.</value>
Public Property UnitPrice As Decimal
Get
If IsUnitPriceNull Then
Throw New InvalidOperationException("Cannot get value because it is DBNull.")
End If
Return _unitPrice
End Get
Set
_unitPriceNull = false
_unitPrice = value
End Set
End Property
''' <summary>
''' Indicates whether the <see cref="UnitPrice"/>
''' property value is null.
''' </summary>
''' <value>true if the property value is null, otherwise false.</value>
Public Property IsUnitPriceNull As Boolean
Get
Return _unitPriceNull
End Get
Set
_unitPriceNull = value
End Set
End Property
''' <summary>
''' Returns the string representation of this instance.
''' </summary>
''' <returns>The string representation of this instance.</returns>
Public Overrides Function ToString() As String
Dim dynStr As System.Text.StringBuilder = New System.Text.StringBuilder(Me.GetType().Name)
dynStr.Append(":")
dynStr.Append(" ProductName=")
dynStr.Append(Me.ProductName)
dynStr.Append(" UnitPrice=")
If IsUnitPriceNull Then
dynStr.Append("<NULL>")
Else
dynStr.Append(Me.UnitPrice)
End If
Return dynStr.ToString()
End Function
End Class