我有一个充满数据库调用的VB类。每个返回一个数据表。我想实现某种接口,该接口修改每个数据表以向从该数据表返回的任何DateTime添加偏移量。这样,我将不必包装现有的引用。下面是一个示例函数,它是我希望“劫持”的众多函数之一。我相信最好的方法是使用界面,但我不太熟悉它们。任何帮助将不胜感激
Public Shared Function uspAccountGet(ByRef RETURN_VALUE As Int32, ByVal AccountID As Nullable(Of Int32)) As DataTable()
Dim oRetVal As DataTable()
Dim oDBCommand As New cDBCommand
oDBCommand.ConnectionString = BarterMe_ConnStr
With oDBCommand
.AddParam("@RETURN_VALUE", SqlDbType.Int, 0, ParameterDirection.ReturnValue, RETURN_VALUE)
.AddParam("@iAccountID", SqlDbType.Int, 0, ParameterDirection.Input, iAccountID)
End With
oDBCommand.ExecuteReader("uspAccountGet", CommandType.StoredProcedure)
oRetVal = oDBCommand.CreateDataTablesArray()
RETURN_VALUE = CType(oDBCommand.GetParamValue("@RETURN_VALUE"), Int32)
oDBCommand.Close()
oDBCommand = Nothing
Return oRetVal
End Function