⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newempds.vb

📁 humar resourse management
💻 VB
📖 第 1 页 / 共 2 页
字号:
            Me.columnemp_addr = New DataColumn("emp_addr", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_addr)
            Me.columnemp_age = New DataColumn("emp_age", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_age)
            Me.columnemp_dob = New DataColumn("emp_dob", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_dob)
            Me.columnemp_fname = New DataColumn("emp_fname", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_fname)
            Me.columnemp_idno = New DataColumn("emp_idno", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_idno)
            Me.columnemp_lname = New DataColumn("emp_lname", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_lname)
            Me.columnemp_mname = New DataColumn("emp_mname", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_mname)
            Me.columnemp_pass = New DataColumn("emp_pass", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_pass)
            Me.columnemp_pos = New DataColumn("emp_pos", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_pos)
            Me.columnemp_stat = New DataColumn("emp_stat", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnemp_stat)
            Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columnemp_idno}, true))
            Me.columnemp_idno.AllowDBNull = false
            Me.columnemp_idno.Unique = true
        End Sub
        
        Public Function NewtblEmployeeRow() As tblEmployeeRow
            Return CType(Me.NewRow,tblEmployeeRow)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New tblEmployeeRow(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(tblEmployeeRow)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.tblEmployeeRowChangedEvent) Is Nothing) Then
                RaiseEvent tblEmployeeRowChanged(Me, New tblEmployeeRowChangeEvent(CType(e.Row,tblEmployeeRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.tblEmployeeRowChangingEvent) Is Nothing) Then
                RaiseEvent tblEmployeeRowChanging(Me, New tblEmployeeRowChangeEvent(CType(e.Row,tblEmployeeRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.tblEmployeeRowDeletedEvent) Is Nothing) Then
                RaiseEvent tblEmployeeRowDeleted(Me, New tblEmployeeRowChangeEvent(CType(e.Row,tblEmployeeRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.tblEmployeeRowDeletingEvent) Is Nothing) Then
                RaiseEvent tblEmployeeRowDeleting(Me, New tblEmployeeRowChangeEvent(CType(e.Row,tblEmployeeRow), e.Action))
            End If
        End Sub
        
        Public Sub RemovetblEmployeeRow(ByVal row As tblEmployeeRow)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class tblEmployeeRow
        Inherits DataRow
        
        Private tabletblEmployee As tblEmployeeDataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tabletblEmployee = CType(Me.Table,tblEmployeeDataTable)
        End Sub
        
        Public Property emp_addr As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_addrColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_addrColumn) = value
            End Set
        End Property
        
        Public Property emp_age As Integer
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_ageColumn),Integer)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_ageColumn) = value
            End Set
        End Property
        
        Public Property emp_dob As Date
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_dobColumn),Date)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_dobColumn) = value
            End Set
        End Property
        
        Public Property emp_fname As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.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.tabletblEmployee.emp_fnameColumn) = value
            End Set
        End Property
        
        Public Property emp_idno As String
            Get
                Return CType(Me(Me.tabletblEmployee.emp_idnoColumn),String)
            End Get
            Set
                Me(Me.tabletblEmployee.emp_idnoColumn) = value
            End Set
        End Property
        
        Public Property emp_lname As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_lnameColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_lnameColumn) = value
            End Set
        End Property
        
        Public Property emp_mname As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_mnameColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_mnameColumn) = value
            End Set
        End Property
        
        Public Property emp_pass As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_passColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_passColumn) = value
            End Set
        End Property
        
        Public Property emp_pos As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_posColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_posColumn) = value
            End Set
        End Property
        
        Public Property emp_stat As String
            Get
                Try 
                    Return CType(Me(Me.tabletblEmployee.emp_statColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tabletblEmployee.emp_statColumn) = value
            End Set
        End Property
        
        Public Function Isemp_addrNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_addrColumn)
        End Function
        
        Public Sub Setemp_addrNull()
            Me(Me.tabletblEmployee.emp_addrColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_ageNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_ageColumn)
        End Function
        
        Public Sub Setemp_ageNull()
            Me(Me.tabletblEmployee.emp_ageColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_dobNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_dobColumn)
        End Function
        
        Public Sub Setemp_dobNull()
            Me(Me.tabletblEmployee.emp_dobColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_fnameNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_fnameColumn)
        End Function
        
        Public Sub Setemp_fnameNull()
            Me(Me.tabletblEmployee.emp_fnameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_lnameNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_lnameColumn)
        End Function
        
        Public Sub Setemp_lnameNull()
            Me(Me.tabletblEmployee.emp_lnameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_mnameNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_mnameColumn)
        End Function
        
        Public Sub Setemp_mnameNull()
            Me(Me.tabletblEmployee.emp_mnameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_passNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_passColumn)
        End Function
        
        Public Sub Setemp_passNull()
            Me(Me.tabletblEmployee.emp_passColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_posNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_posColumn)
        End Function
        
        Public Sub Setemp_posNull()
            Me(Me.tabletblEmployee.emp_posColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Isemp_statNull() As Boolean
            Return Me.IsNull(Me.tabletblEmployee.emp_statColumn)
        End Function
        
        Public Sub Setemp_statNull()
            Me(Me.tabletblEmployee.emp_statColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class tblEmployeeRowChangeEvent
        Inherits EventArgs
        
        Private eventRow As tblEmployeeRow
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As tblEmployeeRow, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As tblEmployeeRow
            Get
                Return Me.eventRow
            End Get
        End Property
        
        Public ReadOnly Property Action As DataRowAction
            Get
                Return Me.eventAction
            End Get
        End Property
    End Class
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -