📄 dsba130.vb
字号:
Friend ReadOnly Property DeliveryAddressColumn As DataColumn
Get
Return Me.columnDeliveryAddress
End Get
End Property
Friend ReadOnly Property InvoiceAddressColumn As DataColumn
Get
Return Me.columnInvoiceAddress
End Get
End Property
Friend ReadOnly Property LastPurchaseDateColumn As DataColumn
Get
Return Me.columnLastPurchaseDate
End Get
End Property
Friend ReadOnly Property PayDaysColumn As DataColumn
Get
Return Me.columnPayDays
End Get
End Property
Friend ReadOnly Property PrepaidColumn As DataColumn
Get
Return Me.columnPrepaid
End Get
End Property
Public Default ReadOnly Property Item(ByVal index As Integer) As SupplierRow
Get
Return CType(Me.Rows(index),SupplierRow)
End Get
End Property
Public Event SupplierRowChanged As SupplierRowChangeEventHandler
Public Event SupplierRowChanging As SupplierRowChangeEventHandler
Public Event SupplierRowDeleted As SupplierRowChangeEventHandler
Public Event SupplierRowDeleting As SupplierRowChangeEventHandler
Public Overloads Sub AddSupplierRow(ByVal row As SupplierRow)
Me.Rows.Add(row)
End Sub
Public Overloads Function AddSupplierRow( _
ByVal SupplierID As String, _
ByVal SupplierAttribName As String, _
ByVal SupplierName As String, _
ByVal InvoiceNo As String, _
ByVal Owner As String, _
ByVal RocID As String, _
ByVal Phone1 As String, _
ByVal Phone2 As String, _
ByVal Fax As String, _
ByVal ContactName1 As String, _
ByVal ContactName2 As String, _
ByVal CompanyAddress As String, _
ByVal DeliveryAddress As String, _
ByVal InvoiceAddress As String, _
ByVal LastPurchaseDate As Date, _
ByVal PayDays As Decimal, _
ByVal Prepaid As Decimal) As SupplierRow
Dim rowSupplierRow As SupplierRow = CType(Me.NewRow,SupplierRow)
rowSupplierRow.ItemArray = New Object() {SupplierID, SupplierAttribName, SupplierName, InvoiceNo, Owner, RocID, Phone1, Phone2, Fax, ContactName1, ContactName2, CompanyAddress, DeliveryAddress, InvoiceAddress, LastPurchaseDate, PayDays, Prepaid}
Me.Rows.Add(rowSupplierRow)
Return rowSupplierRow
End Function
Public Function FindBySupplierID(ByVal SupplierID As String) As SupplierRow
Return CType(Me.Rows.Find(New Object() {SupplierID}),SupplierRow)
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 SupplierDataTable = CType(MyBase.Clone,SupplierDataTable)
cln.InitVars
Return cln
End Function
Friend Sub InitVars()
Me.columnSupplierID = Me.Columns("SupplierID")
Me.columnSupplierAttribName = Me.Columns("SupplierAttribName")
Me.columnSupplierName = Me.Columns("SupplierName")
Me.columnInvoiceNo = Me.Columns("InvoiceNo")
Me.columnOwner = Me.Columns("Owner")
Me.columnRocID = Me.Columns("RocID")
Me.columnPhone1 = Me.Columns("Phone1")
Me.columnPhone2 = Me.Columns("Phone2")
Me.columnFax = Me.Columns("Fax")
Me.columnContactName1 = Me.Columns("ContactName1")
Me.columnContactName2 = Me.Columns("ContactName2")
Me.columnCompanyAddress = Me.Columns("CompanyAddress")
Me.columnDeliveryAddress = Me.Columns("DeliveryAddress")
Me.columnInvoiceAddress = Me.Columns("InvoiceAddress")
Me.columnLastPurchaseDate = Me.Columns("LastPurchaseDate")
Me.columnPayDays = Me.Columns("PayDays")
Me.columnPrepaid = Me.Columns("Prepaid")
End Sub
Private Sub InitClass()
Me.columnSupplierID = New DataColumn("SupplierID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSupplierID)
Me.columnSupplierAttribName = New DataColumn("SupplierAttribName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSupplierAttribName)
Me.columnSupplierName = New DataColumn("SupplierName", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnSupplierName)
Me.columnInvoiceNo = New DataColumn("InvoiceNo", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnInvoiceNo)
Me.columnOwner = New DataColumn("Owner", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnOwner)
Me.columnRocID = New DataColumn("RocID", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnRocID)
Me.columnPhone1 = New DataColumn("Phone1", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPhone1)
Me.columnPhone2 = New DataColumn("Phone2", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPhone2)
Me.columnFax = New DataColumn("Fax", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnFax)
Me.columnContactName1 = New DataColumn("ContactName1", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnContactName1)
Me.columnContactName2 = New DataColumn("ContactName2", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnContactName2)
Me.columnCompanyAddress = New DataColumn("CompanyAddress", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnCompanyAddress)
Me.columnDeliveryAddress = New DataColumn("DeliveryAddress", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnDeliveryAddress)
Me.columnInvoiceAddress = New DataColumn("InvoiceAddress", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnInvoiceAddress)
Me.columnLastPurchaseDate = New DataColumn("LastPurchaseDate", GetType(System.DateTime), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnLastPurchaseDate)
Me.columnPayDays = New DataColumn("PayDays", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPayDays)
Me.columnPrepaid = New DataColumn("Prepaid", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnPrepaid)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columnSupplierID}, true))
Me.columnSupplierID.AllowDBNull = false
Me.columnSupplierID.Unique = true
Me.columnSupplierAttribName.AllowDBNull = false
Me.columnPayDays.AllowDBNull = false
End Sub
Public Function NewSupplierRow() As SupplierRow
Return CType(Me.NewRow,SupplierRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New SupplierRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(SupplierRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.SupplierRowChangedEvent) Is Nothing) Then
RaiseEvent SupplierRowChanged(Me, New SupplierRowChangeEvent(CType(e.Row,SupplierRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.SupplierRowChangingEvent) Is Nothing) Then
RaiseEvent SupplierRowChanging(Me, New SupplierRowChangeEvent(CType(e.Row,SupplierRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.SupplierRowDeletedEvent) Is Nothing) Then
RaiseEvent SupplierRowDeleted(Me, New SupplierRowChangeEvent(CType(e.Row,SupplierRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.SupplierRowDeletingEvent) Is Nothing) Then
RaiseEvent SupplierRowDeleting(Me, New SupplierRowChangeEvent(CType(e.Row,SupplierRow), e.Action))
End If
End Sub
Public Sub RemoveSupplierRow(ByVal row As SupplierRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class SupplierRow
Inherits DataRow
Private tableSupplier As SupplierDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableSupplier = CType(Me.Table,SupplierDataTable)
End Sub
Public Property SupplierID As String
Get
Return CType(Me(Me.tableSupplier.SupplierIDColumn),String)
End Get
Set
Me(Me.tableSupplier.SupplierIDColumn) = value
End Set
End Property
Public Property SupplierAttribName As String
Get
Return CType(Me(Me.tableSupplier.SupplierAttribNameColumn),String)
End Get
Set
Me(Me.tableSupplier.SupplierAttribNameColumn) = value
End Set
End Property
Public Property SupplierName As String
Get
Try
Return CType(Me(Me.tableSupplier.SupplierNameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableSupplier.SupplierNameColumn) = value
End Set
End Property
Public Property InvoiceNo As String
Get
Try
Return CType(Me(Me.tableSupplier.InvoiceNoColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableSupplier.InvoiceNoColumn) = value
End Set
End Property
Public Property Owner As String
Get
Try
Return CType(Me(Me.tableSupplier.OwnerColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableSupplier.OwnerColumn) = value
End Set
End Property
Public Property RocID As String
Get
Try
Return CType(Me(Me.tableSupplier.RocIDColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("無法取得值,因為它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableSupplier.RocIDColumn) = value
End Set
End Property
Public Property Phone1 As String
Get
Try
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -