📄 emprds.vb
字号:
MyBase.OnRowChanged(e)
If (Not (Me.ePayrollRowChangedEvent) Is Nothing) Then
RaiseEvent ePayrollRowChanged(Me, New ePayrollRowChangeEvent(CType(e.Row,ePayrollRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.ePayrollRowChangingEvent) Is Nothing) Then
RaiseEvent ePayrollRowChanging(Me, New ePayrollRowChangeEvent(CType(e.Row,ePayrollRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.ePayrollRowDeletedEvent) Is Nothing) Then
RaiseEvent ePayrollRowDeleted(Me, New ePayrollRowChangeEvent(CType(e.Row,ePayrollRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.ePayrollRowDeletingEvent) Is Nothing) Then
RaiseEvent ePayrollRowDeleting(Me, New ePayrollRowChangeEvent(CType(e.Row,ePayrollRow), e.Action))
End If
End Sub
Public Sub RemoveePayrollRow(ByVal row As ePayrollRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class ePayrollRow
Inherits DataRow
Private tableePayroll As ePayrollDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableePayroll = CType(Me.Table,ePayrollDataTable)
End Sub
Public Property __Amount As Decimal
Get
Try
Return CType(Me(Me.tableePayroll.__AmountColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableePayroll.__AmountColumn) = value
End Set
End Property
Public Property emp_fname As String
Get
Try
Return CType(Me(Me.tableePayroll.emp_fnameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableePayroll.emp_fnameColumn) = value
End Set
End Property
Public Property emp_idno As String
Get
Try
Return CType(Me(Me.tableePayroll.emp_idnoColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableePayroll.emp_idnoColumn) = value
End Set
End Property
Public Property netPay As Integer
Get
Try
Return CType(Me(Me.tableePayroll.netPayColumn),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableePayroll.netPayColumn) = value
End Set
End Property
Public Property payDate As String
Get
Try
Return CType(Me(Me.tableePayroll.payDateColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableePayroll.payDateColumn) = value
End Set
End Property
Public Property payID As Integer
Get
Return CType(Me(Me.tableePayroll.payIDColumn),Integer)
End Get
Set
Me(Me.tableePayroll.payIDColumn) = value
End Set
End Property
Public Property wHours As Integer
Get
Try
Return CType(Me(Me.tableePayroll.wHoursColumn),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableePayroll.wHoursColumn) = value
End Set
End Property
Public Function Is__AmountNull() As Boolean
Return Me.IsNull(Me.tableePayroll.__AmountColumn)
End Function
Public Sub Set__AmountNull()
Me(Me.tableePayroll.__AmountColumn) = System.Convert.DBNull
End Sub
Public Function Isemp_fnameNull() As Boolean
Return Me.IsNull(Me.tableePayroll.emp_fnameColumn)
End Function
Public Sub Setemp_fnameNull()
Me(Me.tableePayroll.emp_fnameColumn) = System.Convert.DBNull
End Sub
Public Function Isemp_idnoNull() As Boolean
Return Me.IsNull(Me.tableePayroll.emp_idnoColumn)
End Function
Public Sub Setemp_idnoNull()
Me(Me.tableePayroll.emp_idnoColumn) = System.Convert.DBNull
End Sub
Public Function IsnetPayNull() As Boolean
Return Me.IsNull(Me.tableePayroll.netPayColumn)
End Function
Public Sub SetnetPayNull()
Me(Me.tableePayroll.netPayColumn) = System.Convert.DBNull
End Sub
Public Function IspayDateNull() As Boolean
Return Me.IsNull(Me.tableePayroll.payDateColumn)
End Function
Public Sub SetpayDateNull()
Me(Me.tableePayroll.payDateColumn) = System.Convert.DBNull
End Sub
Public Function IswHoursNull() As Boolean
Return Me.IsNull(Me.tableePayroll.wHoursColumn)
End Function
Public Sub SetwHoursNull()
Me(Me.tableePayroll.wHoursColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class ePayrollRowChangeEvent
Inherits EventArgs
Private eventRow As ePayrollRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As ePayrollRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As ePayrollRow
Get
Return Me.eventRow
End Get
End Property
Public ReadOnly Property Action As DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class tblEmployeeDataTable
Inherits DataTable
Implements System.Collections.IEnumerable
Private columnemp_addr As DataColumn
Private columnemp_age As DataColumn
Private columnemp_dob As DataColumn
Private columnemp_fname As DataColumn
Private columnemp_idno As DataColumn
Private columnemp_lname As DataColumn
Private columnemp_mname As DataColumn
Private columnemp_pass As DataColumn
Private columnemp_pos As DataColumn
Private columnemp_stat As DataColumn
Friend Sub New()
MyBase.New("tblEmployee")
Me.InitClass
End Sub
Friend Sub New(ByVal table As DataTable)
MyBase.New(table.TableName)
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
Me.DisplayExpression = table.DisplayExpression
End Sub
<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count As Integer
Get
Return Me.Rows.Count
End Get
End Property
Friend ReadOnly Property emp_addrColumn As DataColumn
Get
Return Me.columnemp_addr
End Get
End Property
Friend ReadOnly Property emp_ageColumn As DataColumn
Get
Return Me.columnemp_age
End Get
End Property
Friend ReadOnly Property emp_dobColumn As DataColumn
Get
Return Me.columnemp_dob
End Get
End Property
Friend ReadOnly Property emp_fnameColumn As DataColumn
Get
Return Me.columnemp_fname
End Get
End Property
Friend ReadOnly Property emp_idnoColumn As DataColumn
Get
Return Me.columnemp_idno
End Get
End Property
Friend ReadOnly Property emp_lnameColumn As DataColumn
Get
Return Me.columnemp_lname
End Get
End Property
Friend ReadOnly Property emp_mnameColumn As DataColumn
Get
Return Me.columnemp_mname
End Get
End Property
Friend ReadOnly Property emp_passColumn As DataColumn
Get
Return Me.columnemp_pass
End Get
End Property
Friend ReadOnly Property emp_posColumn As DataColumn
Get
Return Me.columnemp_pos
End Get
End Property
Friend ReadOnly Property emp_statColumn As DataColumn
Get
Return Me.columnemp_stat
End Get
End Property
Public Default ReadOnly Property Item(ByVal index As Integer) As tblEmployeeRow
Get
Return CType(Me.Rows(index),tblEmployeeRow)
End Get
End Property
Public Event tblEmployeeRowChanged As tblEmployeeRowChangeEventHandler
Public Event tblEmployeeRowChanging As tblEmployeeRowChangeEventHandler
Public Event tblEmployeeRowDeleted As tblEmployeeRowChangeEventHandler
Public Event tblEmployeeRowDeleting As tblEmployeeRowChangeEventHandler
Public Overloads Sub AddtblEmployeeRow(ByVal row As tblEmployeeRow)
Me.Rows.Add(row)
End Sub
Public Overloads Function AddtblEmployeeRow(ByVal emp_addr As String, ByVal emp_age As Integer, ByVal emp_dob As Date, ByVal emp_fname As String, ByVal emp_idno As String, ByVal emp_lname As String, ByVal emp_mname As String, ByVal emp_pass As String, ByVal emp_pos As String, ByVal emp_stat As String) As tblEmployeeRow
Dim rowtblEmployeeRow As tblEmployeeRow = CType(Me.NewRow,tblEmployeeRow)
rowtblEmployeeRow.ItemArray = New Object() {emp_addr, emp_age, emp_dob, emp_fname, emp_idno, emp_lname, emp_mname, emp_pass, emp_pos, emp_stat}
Me.Rows.Add(rowtblEmployeeRow)
Return rowtblEmployeeRow
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -