Class User
Inherits DBLayer
Public Shared Shadows Function TableName() As String
Return "users"
End Function
Public Overrides Function GetTableName() As String
Return User.TableName
End Function
End Class
MustInherit Class DBLayer
MustOverride Function GetTableName() As String
Public Function GetDetail(ByVal UIN As Integer)
Return GetDetail(UIN, GetTableName)
End Function
Public Shared Function GetDetail(ByVal UIN As Integer, ByVal TableName As String)
Dim StrSql As String = String.Format("select * from {0} where uin = {1}", TableName, UIN)
Return StrSql
End Function
End Class
Class DBLayer
Private _tableName As String
Public Property TableName() As String
Get
Return _tableName
End Get
Set(ByVal value As String)
_tableName = value
End Set
End Property
Public Sub New(ByVal tableName As String)
_tableName = tableName
End Sub
Public Function GetDetail(ByVal UIN As Integer)
Return GetDetail(UIN, Me.TableName)
End Function
Public Shared Function GetDetail(ByVal UIN As Integer, ByVal TableName As String)
Dim StrSql As String = String.Format("select * from {0} where uin = {1}", TableName, UIN)
End Function
End Class