ASP.NET/数据访问层和业务逻辑层
外观
< ASP.NET
添加新项: 数据集 打开数据库查看器,将数据库表拖放到数据集查看器中。
从数据集查看器中,您可以右键单击表格,添加新的查询并使用向导根据标准 SQL 配置它们。
添加新项: 类命名约定是在类名后添加 BLL,例如“CustomersBLL”。
Imports OrderingSystemDSTableAdapters
<System.ComponentModel.DataObject()> _
Public Class CustomersBLL
Private _customersAdapater As CustomersTableAdapter = Nothing
Protected ReadOnly Property CustomersAdapater() As CustomersTableAdapter
Get
If _customersAdapater Is Nothing Then
_customersAdapater = New CustomersTableAdapter()
End If
Return _customersAdapater
End Get
End Property
<System.ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Select, True)> _
Public Function getCustomer() As OrderingSystemDS.CustomersDataTable
Return CustomersAdapater.GetCustomers()
End Function
<System.ComponentModel.DataObjectMethod(ComponentModel.DataObjectMethodType.Select, False)> _
Public Function getCustomerByCustomerID(ByVal CustomerID As Integer) As OrderingSystemDS.CustomersDataTable
Return CustomersAdapater.GetCustomerByCustomerID(CustomerID)
End Function
End Class