' This class is "generated" and will be overwritten.
' Your customizations should be made in CategoriesRecord.vb

Imports System.Data.SqlTypes
Imports BaseClasses
Imports BaseClasses.Data
Imports BaseClasses.Data.SqlProvider

Namespace UseDAL.Business

''' <summary>
''' The generated superclass for the <see cref="CategoriesRecord"></see> class.
''' </summary>
''' <remarks>
''' This class is not intended to be instantiated directly.  To obtain an instance of this class, 
''' use the methods of the <see cref="CategoriesTable"></see> class.
''' </remarks>
''' <seealso cref="CategoriesTable"></seealso>
''' <seealso cref="CategoriesRecord"></seealso>

<Serializable()> Public Class BaseCategoriesRecord
	Inherits PrimaryKeyRecord
	

	Public Shared Shadows ReadOnly TableUtils As CategoriesTable = CategoriesTable.Instance

	' Constructors
 
	Protected Sub New()
		MyBase.New(TableUtils)
	End Sub

	Protected Sub New(ByVal record As PrimaryKeyRecord)
		MyBase.New(record, TableUtils)
	End Sub







#Region "Convenience methods to get/set values of fields"

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.CategoryID field.
	''' </summary>
	Public Function GetCategoryIDValue() As ColumnValue
		Return Me.GetValue(TableUtils.CategoryIDColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.CategoryID field.
	''' </summary>
	Public Function GetCategoryIDFieldValue() As Int32
		Return CType(Me.GetValue(TableUtils.CategoryIDColumn).ToInt32(), Int32)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.CategoryName field.
	''' </summary>
	Public Function GetCategoryNameValue() As ColumnValue
		Return Me.GetValue(TableUtils.CategoryNameColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.CategoryName field.
	''' </summary>
	Public Function GetCategoryNameFieldValue() As String
		Return CType(Me.GetValue(TableUtils.CategoryNameColumn).ToString(), String)
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.CategoryName field.
	''' </summary>
	Public Sub SetCategoryNameFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.CategoryNameColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.CategoryName field.
	''' </summary>
	Public Sub SetCategoryNameFieldValue(ByVal val As String)
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.CategoryNameColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.Description field.
	''' </summary>
	Public Function GetDescriptionValue() As ColumnValue
		Return Me.GetValue(TableUtils.DescriptionColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.Description field.
	''' </summary>
	Public Function GetDescriptionFieldValue() As String
		Return CType(Me.GetValue(TableUtils.DescriptionColumn).ToString(), String)
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.Description field.
	''' </summary>
	Public Sub SetDescriptionFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.DescriptionColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.Description field.
	''' </summary>
	Public Sub SetDescriptionFieldValue(ByVal val As String)
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.DescriptionColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.Picture field.
	''' </summary>
	Public Function GetPictureValue() As ColumnValue
		Return Me.GetValue(TableUtils.PictureColumn)
	End Function

	''' <summary>
	''' This is a convenience method that provides direct access to the value of the record's Categories_.Picture field.
	''' </summary>
	Public Function GetPictureFieldValue() As Byte()
		Return CType(Me.GetValue(TableUtils.PictureColumn).ToBinary(), Byte())
	End Function

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.Picture field.
	''' </summary>
	Public Sub SetPictureFieldValue(ByVal val As ColumnValue)
		Me.SetValue(val, TableUtils.PictureColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.Picture field.
	''' </summary>
	Public Sub SetPictureFieldValue(ByVal val As String)
		Me.SetString(val, TableUtils.PictureColumn)
	End Sub

	''' <summary>
	''' This is a convenience method that allows direct modification of the value of the record's Categories_.Picture field.
	''' </summary>
	Public Sub SetPictureFieldValue(ByVal val As Byte ())
		Dim colValue As ColumnValue = New ColumnValue(val)
		Me.SetValue(colValue, TableUtils.PictureColumn)
	End Sub


#End Region

#Region "Convenience methods to get field names"

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Categories_.CategoryID field.
	''' </summary>
	Public Property CategoryID() As Int32
		Get 
			Return CType(Me.GetValue(TableUtils.CategoryIDColumn).ToInt32(), Int32)
		End Get
		Set (ByVal val As Int32) 
			Dim colValue As ColumnValue = New ColumnValue(val)
			Me.SetValue(colValue, TableUtils.CategoryIDColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property CategoryIDSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.CategoryIDColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property CategoryIDDefault() As String
        Get
            Return TableUtils.CategoryIDColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Categories_.CategoryName field.
	''' </summary>
	Public Property CategoryName() As String
		Get 
			Return CType(Me.GetValue(TableUtils.CategoryNameColumn).ToString(), String)
		End Get
		Set (ByVal Value As String) 
			Me.SetString(value, TableUtils.CategoryNameColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property CategoryNameSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.CategoryNameColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property CategoryNameDefault() As String
        Get
            Return TableUtils.CategoryNameColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Categories_.Description field.
	''' </summary>
	Public Property Description() As String
		Get 
			Return CType(Me.GetValue(TableUtils.DescriptionColumn).ToString(), String)
		End Get
		Set (ByVal Value As String) 
			Me.SetString(value, TableUtils.DescriptionColumn)
		End Set
	End Property


	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property DescriptionSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.DescriptionColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property DescriptionDefault() As String
        Get
            Return TableUtils.DescriptionColumn.DefaultValue
        End Get
    End Property

	''' <summary>
	''' This is a convenience property that provides direct access to the value of the record's Categories_.Picture field.
	''' </summary>
	Public Property Picture() As Byte()
		Get 
			Return CType(Me.GetValue(TableUtils.PictureColumn).ToBinary(), Byte())
		End Get
		Set (ByVal val As Byte ()) 
			Dim colValue As ColumnValue = New ColumnValue(val)
			Me.SetValue(colValue, TableUtils.PictureColumn)
		End Set
	End Property



	''' <summary>
	''' This is a convenience method that can be used to determine that the column is set.
	''' </summary>
	Public ReadOnly Property PictureSpecified() As Boolean
        Get
            Dim val As ColumnValue = Me.GetValue(TableUtils.PictureColumn)
            If val Is Nothing OrElse val.IsNull Then
                Return False
            End If
            Return True
        End Get
    End Property

	''' <summary>
	''' This is a convenience method that can be used to get the default value of a column.
	''' </summary>
    Public ReadOnly Property PictureDefault() As String
        Get
            Return TableUtils.PictureColumn.DefaultValue
        End Get
    End Property



#End Region

End Class
End Namespace
