498 lines
17 KiB
VB.net
498 lines
17 KiB
VB.net
' This class is "generated" and will be overwritten.
|
|
' Your customizations should be made in ArmRecord.vb
|
|
|
|
Imports System.Data.SqlTypes
|
|
Imports BaseClasses
|
|
Imports BaseClasses.Data
|
|
Imports BaseClasses.Data.SqlProvider
|
|
|
|
Namespace Persons.Business
|
|
|
|
''' <summary>
|
|
''' The generated superclass for the <see cref="ArmRecord"></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="ArmTable"></see> class.
|
|
''' </remarks>
|
|
''' <seealso cref="ArmTable"></seealso>
|
|
''' <seealso cref="ArmRecord"></seealso>
|
|
|
|
<Serializable()> Public Class BaseArmRecord
|
|
Inherits PrimaryKeyRecord
|
|
|
|
|
|
Public Shared Shadows ReadOnly TableUtils As ArmTable = ArmTable.Instance
|
|
|
|
' Constructors
|
|
|
|
Protected Sub New()
|
|
MyBase.New(TableUtils)
|
|
End Sub
|
|
|
|
Protected Sub New(ByVal record As PrimaryKeyRecord)
|
|
MyBase.New(record, TableUtils)
|
|
End Sub
|
|
|
|
'Evaluates Initialize when->Inserting record formulas specified at the data access layer
|
|
Public Overridable Sub ArmRecord_InsertingRecord(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Me.InsertingRecord
|
|
'Apply Initialize->Inserting record formula only if validation is successful.
|
|
Dim ArmRec As ArmRecord = CType(sender,ArmRecord)
|
|
Validate_Inserting()
|
|
If Not ArmRec Is Nothing AndAlso Not ArmRec.IsReadOnly Then
|
|
End If
|
|
End Sub
|
|
|
|
'Evaluates Initialize when->Updating record formulas specified at the data access layer
|
|
Public Overridable Sub ArmRecord_UpdatingRecord(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Me.UpdatingRecord
|
|
'Apply Initialize->Updating record formula only if validation is successful.
|
|
Dim ArmRec As ArmRecord = CType(sender,ArmRecord)
|
|
Validate_Updating()
|
|
If Not ArmRec Is Nothing AndAlso Not ArmRec.IsReadOnly Then
|
|
End If
|
|
End Sub
|
|
|
|
'Evaluates Initialize when->Reading record formulas specified at the data access layer
|
|
Public Overridable Sub ArmRecord_ReadRecord(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ReadRecord
|
|
'Apply Initialize->Reading record formula only if validation is successful.
|
|
Dim ArmRec As ArmRecord = CType(sender,ArmRecord)
|
|
If Not ArmRec Is Nothing AndAlso Not ArmRec.IsReadOnly Then
|
|
End If
|
|
End Sub
|
|
|
|
'Evaluates Validate when->Inserting formulas specified at the data access layer
|
|
Public Overridable Sub Validate_Inserting ()
|
|
Dim fullValidationMessage As String = ""
|
|
Dim validationMessage As String = ""
|
|
|
|
dim formula as String = ""
|
|
|
|
|
|
If validationMessage <> "" AndAlso validationMessage.ToLower() <> "true" Then
|
|
fullValidationMessage &= validationMessage & vbCrLf
|
|
End If
|
|
|
|
If fullValidationMessage <> "" Then
|
|
Throw New Exception(fullValidationMessage)
|
|
End If
|
|
End Sub
|
|
|
|
'Evaluates Validate when->Updating formulas specified at the data access layer
|
|
Public Overridable Sub Validate_Updating ()
|
|
Dim fullValidationMessage As String = ""
|
|
Dim validationMessage As String = ""
|
|
|
|
dim formula as String = ""
|
|
|
|
|
|
If validationMessage <> "" AndAlso validationMessage.ToLower() <> "true" Then
|
|
fullValidationMessage &= validationMessage & vbCrLf
|
|
End If
|
|
|
|
If fullValidationMessage <> "" Then
|
|
Throw New Exception(fullValidationMessage)
|
|
End If
|
|
End Sub
|
|
|
|
Public Overridable Function EvaluateFormula(ByVal formula As String, Optional ByVal dataSourceForEvaluate As BaseClasses.Data.BaseRecord = Nothing, Optional ByVal format As String = Nothing) As String
|
|
|
|
Dim e As Data.BaseFormulaEvaluator = New Data.BaseFormulaEvaluator()
|
|
|
|
' All variables referred to in the formula are expected to be
|
|
' properties of the DataSource. For example, referring to
|
|
' UnitPrice as a variable will refer to DataSource.UnitPrice
|
|
e.DataSource = dataSourceForEvaluate
|
|
|
|
Dim resultObj As Object = e.Evaluate(formula)
|
|
If resultObj Is Nothing Then
|
|
Return ""
|
|
End If
|
|
Return resultObj.ToString()
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#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 Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Function GetArmIdValue() As ColumnValue
|
|
Return Me.GetValue(TableUtils.ArmIdColumn)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Function GetArmIdFieldValue() As Int32
|
|
Return CType(Me.GetValue(TableUtils.ArmIdColumn).ToInt32(), Int32)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Sub SetArmIdFieldValue(ByVal val As ColumnValue)
|
|
Me.SetValue(val, TableUtils.ArmIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Sub SetArmIdFieldValue(ByVal val As String)
|
|
Me.SetString(val, TableUtils.ArmIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Sub SetArmIdFieldValue(ByVal val As Double)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Sub SetArmIdFieldValue(ByVal val As Decimal)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Sub SetArmIdFieldValue(ByVal val As Int64)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmIdColumn)
|
|
End Sub
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Function GetArmyIdValue() As ColumnValue
|
|
Return Me.GetValue(TableUtils.ArmyIdColumn)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Function GetArmyIdFieldValue() As Byte
|
|
Return CType(Me.GetValue(TableUtils.ArmyIdColumn).ToByte(), Byte)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Sub SetArmyIdFieldValue(ByVal val As ColumnValue)
|
|
Me.SetValue(val, TableUtils.ArmyIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Sub SetArmyIdFieldValue(ByVal val As String)
|
|
Me.SetString(val, TableUtils.ArmyIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Sub SetArmyIdFieldValue(ByVal val As Double)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmyIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Sub SetArmyIdFieldValue(ByVal val As Decimal)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmyIdColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Sub SetArmyIdFieldValue(ByVal val As Int64)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmyIdColumn)
|
|
End Sub
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmSName field.
|
|
''' </summary>
|
|
Public Function GetArmSNameValue() As ColumnValue
|
|
Return Me.GetValue(TableUtils.ArmSNameColumn)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmSName field.
|
|
''' </summary>
|
|
Public Function GetArmSNameFieldValue() As String
|
|
Return CType(Me.GetValue(TableUtils.ArmSNameColumn).ToString(), String)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmSName field.
|
|
''' </summary>
|
|
Public Sub SetArmSNameFieldValue(ByVal val As ColumnValue)
|
|
Me.SetValue(val, TableUtils.ArmSNameColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmSName field.
|
|
''' </summary>
|
|
Public Sub SetArmSNameFieldValue(ByVal val As String)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmSNameColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmName field.
|
|
''' </summary>
|
|
Public Function GetArmNameValue() As ColumnValue
|
|
Return Me.GetValue(TableUtils.ArmNameColumn)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.ArmName field.
|
|
''' </summary>
|
|
Public Function GetArmNameFieldValue() As String
|
|
Return CType(Me.GetValue(TableUtils.ArmNameColumn).ToString(), String)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmName field.
|
|
''' </summary>
|
|
Public Sub SetArmNameFieldValue(ByVal val As ColumnValue)
|
|
Me.SetValue(val, TableUtils.ArmNameColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.ArmName field.
|
|
''' </summary>
|
|
Public Sub SetArmNameFieldValue(ByVal val As String)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmNameColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.Party field.
|
|
''' </summary>
|
|
Public Function GetPartyValue() As ColumnValue
|
|
Return Me.GetValue(TableUtils.PartyColumn)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that provides direct access to the value of the record's Arm_.Party field.
|
|
''' </summary>
|
|
Public Function GetPartyFieldValue() As String
|
|
Return CType(Me.GetValue(TableUtils.PartyColumn).ToString(), String)
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.Party field.
|
|
''' </summary>
|
|
Public Sub SetPartyFieldValue(ByVal val As ColumnValue)
|
|
Me.SetValue(val, TableUtils.PartyColumn)
|
|
End Sub
|
|
|
|
''' <summary>
|
|
''' This is a convenience method that allows direct modification of the value of the record's Arm_.Party field.
|
|
''' </summary>
|
|
Public Sub SetPartyFieldValue(ByVal val As String)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.PartyColumn)
|
|
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 Arm_.ArmId field.
|
|
''' </summary>
|
|
Public Property ArmId() As Int32
|
|
Get
|
|
Return CType(Me.GetValue(TableUtils.ArmIdColumn).ToInt32(), Int32)
|
|
End Get
|
|
Set (ByVal val As Int32)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmIdColumn)
|
|
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 ArmIdSpecified() As Boolean
|
|
Get
|
|
Dim val As ColumnValue = Me.GetValue(TableUtils.ArmIdColumn)
|
|
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 ArmIdDefault() As String
|
|
Get
|
|
Return TableUtils.ArmIdColumn.DefaultValue
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' This is a convenience property that provides direct access to the value of the record's Arm_.ArmyId field.
|
|
''' </summary>
|
|
Public Property ArmyId() As Byte
|
|
Get
|
|
Return CType(Me.GetValue(TableUtils.ArmyIdColumn).ToByte(), Byte)
|
|
End Get
|
|
Set (ByVal val As Byte)
|
|
Dim colValue As ColumnValue = New ColumnValue(val)
|
|
Me.SetValue(colValue, TableUtils.ArmyIdColumn)
|
|
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 ArmyIdSpecified() As Boolean
|
|
Get
|
|
Dim val As ColumnValue = Me.GetValue(TableUtils.ArmyIdColumn)
|
|
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 ArmyIdDefault() As String
|
|
Get
|
|
Return TableUtils.ArmyIdColumn.DefaultValue
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' This is a convenience property that provides direct access to the value of the record's Arm_.ArmSName field.
|
|
''' </summary>
|
|
Public Property ArmSName() As String
|
|
Get
|
|
Return CType(Me.GetValue(TableUtils.ArmSNameColumn).ToString(), String)
|
|
End Get
|
|
Set (ByVal Value As String)
|
|
Me.SetString(value, TableUtils.ArmSNameColumn)
|
|
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 ArmSNameSpecified() As Boolean
|
|
Get
|
|
Dim val As ColumnValue = Me.GetValue(TableUtils.ArmSNameColumn)
|
|
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 ArmSNameDefault() As String
|
|
Get
|
|
Return TableUtils.ArmSNameColumn.DefaultValue
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' This is a convenience property that provides direct access to the value of the record's Arm_.ArmName field.
|
|
''' </summary>
|
|
Public Property ArmName() As String
|
|
Get
|
|
Return CType(Me.GetValue(TableUtils.ArmNameColumn).ToString(), String)
|
|
End Get
|
|
Set (ByVal Value As String)
|
|
Me.SetString(value, TableUtils.ArmNameColumn)
|
|
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 ArmNameSpecified() As Boolean
|
|
Get
|
|
Dim val As ColumnValue = Me.GetValue(TableUtils.ArmNameColumn)
|
|
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 ArmNameDefault() As String
|
|
Get
|
|
Return TableUtils.ArmNameColumn.DefaultValue
|
|
End Get
|
|
End Property
|
|
|
|
''' <summary>
|
|
''' This is a convenience property that provides direct access to the value of the record's Arm_.Party field.
|
|
''' </summary>
|
|
Public Property Party() As String
|
|
Get
|
|
Return CType(Me.GetValue(TableUtils.PartyColumn).ToString(), String)
|
|
End Get
|
|
Set (ByVal Value As String)
|
|
Me.SetString(value, TableUtils.PartyColumn)
|
|
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 PartySpecified() As Boolean
|
|
Get
|
|
Dim val As ColumnValue = Me.GetValue(TableUtils.PartyColumn)
|
|
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 PartyDefault() As String
|
|
Get
|
|
Return TableUtils.PartyColumn.DefaultValue
|
|
End Get
|
|
End Property
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
End Class
|
|
End Namespace
|