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

📄 dataset1.vb

📁 东软内部材料(三)程序设计导论
💻 VB
📖 第 1 页 / 共 2 页
字号:
        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 LeaveIDColumn As DataColumn
            Get
                Return Me.columnLeaveID
            End Get
        End Property
        
        Friend ReadOnly Property EmployeeIDColumn As DataColumn
            Get
                Return Me.columnEmployeeID
            End Get
        End Property
        
        Friend ReadOnly Property SubmitTimeColumn As DataColumn
            Get
                Return Me.columnSubmitTime
            End Get
        End Property
        
        Friend ReadOnly Property StartTimeColumn As DataColumn
            Get
                Return Me.columnStartTime
            End Get
        End Property
        
        Friend ReadOnly Property EndTimeColumn As DataColumn
            Get
                Return Me.columnEndTime
            End Get
        End Property
        
        Friend ReadOnly Property ReasonColumn As DataColumn
            Get
                Return Me.columnReason
            End Get
        End Property
        
        Friend ReadOnly Property HoursColumn As DataColumn
            Get
                Return Me.columnHours
            End Get
        End Property
        
        Friend ReadOnly Property StatusColumn As DataColumn
            Get
                Return Me.columnStatus
            End Get
        End Property
        
        Friend ReadOnly Property ApproverIDColumn As DataColumn
            Get
                Return Me.columnApproverID
            End Get
        End Property
        
        Friend ReadOnly Property ApproverNameColumn As DataColumn
            Get
                Return Me.columnApproverName
            End Get
        End Property
        
        Public Default ReadOnly Property Item(ByVal index As Integer) As viwAllLeaveReqRow
            Get
                Return CType(Me.Rows(index),viwAllLeaveReqRow)
            End Get
        End Property
        
        Public Event viwAllLeaveReqRowChanged As viwAllLeaveReqRowChangeEventHandler
        
        Public Event viwAllLeaveReqRowChanging As viwAllLeaveReqRowChangeEventHandler
        
        Public Event viwAllLeaveReqRowDeleted As viwAllLeaveReqRowChangeEventHandler
        
        Public Event viwAllLeaveReqRowDeleting As viwAllLeaveReqRowChangeEventHandler
        
        Public Overloads Sub AddviwAllLeaveReqRow(ByVal row As viwAllLeaveReqRow)
            Me.Rows.Add(row)
        End Sub
        
        Public Overloads Function AddviwAllLeaveReqRow(ByVal EmployeeID As Integer, ByVal SubmitTime As Date, ByVal StartTime As Date, ByVal EndTime As Date, ByVal Reason As String, ByVal Hours As Integer, ByVal Status As String, ByVal ApproverID As Integer, ByVal ApproverName As String) As viwAllLeaveReqRow
            Dim rowviwAllLeaveReqRow As viwAllLeaveReqRow = CType(Me.NewRow,viwAllLeaveReqRow)
            rowviwAllLeaveReqRow.ItemArray = New Object() {Nothing, EmployeeID, SubmitTime, StartTime, EndTime, Reason, Hours, Status, ApproverID, ApproverName}
            Me.Rows.Add(rowviwAllLeaveReqRow)
            Return rowviwAllLeaveReqRow
        End Function
        
        Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
            Return Me.Rows.GetEnumerator
        End Function
        
        Public Overrides Function Clone() As DataTable
            Dim cln As viwAllLeaveReqDataTable = CType(MyBase.Clone,viwAllLeaveReqDataTable)
            cln.InitVars
            Return cln
        End Function
        
        Protected Overrides Function CreateInstance() As DataTable
            Return New viwAllLeaveReqDataTable
        End Function
        
        Friend Sub InitVars()
            Me.columnLeaveID = Me.Columns("LeaveID")
            Me.columnEmployeeID = Me.Columns("EmployeeID")
            Me.columnSubmitTime = Me.Columns("SubmitTime")
            Me.columnStartTime = Me.Columns("StartTime")
            Me.columnEndTime = Me.Columns("EndTime")
            Me.columnReason = Me.Columns("Reason")
            Me.columnHours = Me.Columns("Hours")
            Me.columnStatus = Me.Columns("Status")
            Me.columnApproverID = Me.Columns("ApproverID")
            Me.columnApproverName = Me.Columns("ApproverName")
        End Sub
        
        Private Sub InitClass()
            Me.columnLeaveID = New DataColumn("LeaveID", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnLeaveID)
            Me.columnEmployeeID = New DataColumn("EmployeeID", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnEmployeeID)
            Me.columnSubmitTime = New DataColumn("SubmitTime", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnSubmitTime)
            Me.columnStartTime = New DataColumn("StartTime", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnStartTime)
            Me.columnEndTime = New DataColumn("EndTime", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnEndTime)
            Me.columnReason = New DataColumn("Reason", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnReason)
            Me.columnHours = New DataColumn("Hours", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnHours)
            Me.columnStatus = New DataColumn("Status", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnStatus)
            Me.columnApproverID = New DataColumn("ApproverID", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnApproverID)
            Me.columnApproverName = New DataColumn("ApproverName", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columnApproverName)
            Me.columnLeaveID.AutoIncrement = true
            Me.columnLeaveID.AllowDBNull = false
            Me.columnLeaveID.ReadOnly = true
            Me.columnEmployeeID.AllowDBNull = false
            Me.columnSubmitTime.AllowDBNull = false
            Me.columnStartTime.AllowDBNull = false
            Me.columnEndTime.AllowDBNull = false
            Me.columnHours.AllowDBNull = false
            Me.columnApproverName.AllowDBNull = false
        End Sub
        
        Public Function NewviwAllLeaveReqRow() As viwAllLeaveReqRow
            Return CType(Me.NewRow,viwAllLeaveReqRow)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New viwAllLeaveReqRow(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(viwAllLeaveReqRow)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.viwAllLeaveReqRowChangedEvent) Is Nothing) Then
                RaiseEvent viwAllLeaveReqRowChanged(Me, New viwAllLeaveReqRowChangeEvent(CType(e.Row,viwAllLeaveReqRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.viwAllLeaveReqRowChangingEvent) Is Nothing) Then
                RaiseEvent viwAllLeaveReqRowChanging(Me, New viwAllLeaveReqRowChangeEvent(CType(e.Row,viwAllLeaveReqRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.viwAllLeaveReqRowDeletedEvent) Is Nothing) Then
                RaiseEvent viwAllLeaveReqRowDeleted(Me, New viwAllLeaveReqRowChangeEvent(CType(e.Row,viwAllLeaveReqRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.viwAllLeaveReqRowDeletingEvent) Is Nothing) Then
                RaiseEvent viwAllLeaveReqRowDeleting(Me, New viwAllLeaveReqRowChangeEvent(CType(e.Row,viwAllLeaveReqRow), e.Action))
            End If
        End Sub
        
        Public Sub RemoveviwAllLeaveReqRow(ByVal row As viwAllLeaveReqRow)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class viwAllLeaveReqRow
        Inherits DataRow
        
        Private tableviwAllLeaveReq As viwAllLeaveReqDataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tableviwAllLeaveReq = CType(Me.Table,viwAllLeaveReqDataTable)
        End Sub
        
        Public Property LeaveID As Integer
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.LeaveIDColumn),Integer)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.LeaveIDColumn) = value
            End Set
        End Property
        
        Public Property EmployeeID As Integer
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.EmployeeIDColumn),Integer)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.EmployeeIDColumn) = value
            End Set
        End Property
        
        Public Property SubmitTime As Date
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.SubmitTimeColumn),Date)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.SubmitTimeColumn) = value
            End Set
        End Property
        
        Public Property StartTime As Date
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.StartTimeColumn),Date)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.StartTimeColumn) = value
            End Set
        End Property
        
        Public Property EndTime As Date
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.EndTimeColumn),Date)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.EndTimeColumn) = value
            End Set
        End Property
        
        Public Property Reason As String
            Get
                Try 
                    Return CType(Me(Me.tableviwAllLeaveReq.ReasonColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.ReasonColumn) = value
            End Set
        End Property
        
        Public Property Hours As Integer
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.HoursColumn),Integer)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.HoursColumn) = value
            End Set
        End Property
        
        Public Property Status As String
            Get
                Try 
                    Return CType(Me(Me.tableviwAllLeaveReq.StatusColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.StatusColumn) = value
            End Set
        End Property
        
        Public Property ApproverID As Integer
            Get
                Try 
                    Return CType(Me(Me.tableviwAllLeaveReq.ApproverIDColumn),Integer)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.ApproverIDColumn) = value
            End Set
        End Property
        
        Public Property ApproverName As String
            Get
                Return CType(Me(Me.tableviwAllLeaveReq.ApproverNameColumn),String)
            End Get
            Set
                Me(Me.tableviwAllLeaveReq.ApproverNameColumn) = value
            End Set
        End Property
        
        Public Function IsReasonNull() As Boolean
            Return Me.IsNull(Me.tableviwAllLeaveReq.ReasonColumn)
        End Function
        
        Public Sub SetReasonNull()
            Me(Me.tableviwAllLeaveReq.ReasonColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsStatusNull() As Boolean
            Return Me.IsNull(Me.tableviwAllLeaveReq.StatusColumn)
        End Function
        
        Public Sub SetStatusNull()
            Me(Me.tableviwAllLeaveReq.StatusColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsApproverIDNull() As Boolean
            Return Me.IsNull(Me.tableviwAllLeaveReq.ApproverIDColumn)
        End Function
        
        Public Sub SetApproverIDNull()
            Me(Me.tableviwAllLeaveReq.ApproverIDColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class viwAllLeaveReqRowChangeEvent
        Inherits EventArgs
        
        Private eventRow As viwAllLeaveReqRow
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As viwAllLeaveReqRow, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As viwAllLeaveReqRow
            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 + -