Public Interface IDataCaptureReturn Function GetEntityListByDLN(Of EntityType As {New, mmBusinessEntity})(ByVal dln As Int64) As mmBindingList(Of EntityType) End Interface Public Interface IdataCaptureReturnEntity Property DCR_DLN() As Int64 Property DCR_OperatorID As String Property DCR_VoidInd As Boolean End InterfaceBO’s
Partial Public Class DataCaptureReturn Implements IDataCaptureReturn Public Function GetEntityListbyDLN(Of EntityType As {New, mmBusinessEntity})(ByVal dln As Long) As mmBindingList(Of EntityType) Implements IDataCaptureReturn.GetEntityListByDLN Dim paramDLN As IDbDataParameter = Me.CreateParameter("@DLN", dln) ' Me.GetEntityList("DataCaptureReturnByDLN", Me.DatabaseKey, CommandType.StoredProcedure, paramDLN) Return Me.GetEntityList(Of EntityType)("DataCaptureReturnByDLN", Me.DatabaseKey, CommandType.StoredProcedure, paramDLN) Return Me.EntityList End Function End class Partial Public Class DataCaptureReturnEntity Inherits ABusinessEntity Implements IdataCaptureReturnEntity Public Property DCR_DLN() As Int64 Implements IdataCaptureReturnEntity.DCR_DLN Get If Not Me.Row Is Nothing Then Return CType(mmType.GetNonNullableDbValue(Me.Row("DCR_DLN"), "System.Int64"), System.Int64) Else Return Me._DCR_DLN End If End Get Set(ByVal value As Int64) If Not Me.Row Is Nothing Then Me.Row("DCR_DLN") = Value End If Me._DCR_DLN = Value Me.OnPropertyChanged(New PropertyChangedEventArgs("DCR_DLN")) End Set End Property Private _DCR_DLN As Int64 End classAbstract class in base class Lib
Public Class DoStuffBase Dim oDataCap as IDataCaptureReturn Public Sub New() initBO() me.DoStuff EndSub Protected Overidable Public Class DoStuffBase End Sub Private sub DoStuff() Me.oDataCap.GetEntityListbyDLN GetEntityListbyDLN(Of mmBusinessEntity) (1234) ‘this will throw a casting error Dim mmReturnData As mmBusinessObjectGeneric(Of mmBusinessEntity) = CType(Me. oDataCap, mmBusinessObjectGeneric(Of mmBusinessEntity)) Dim oEntity As IdataCaptureReturnEntity = CType(mmReturnData.Entity, IdataCaptureReturnEntity) endsub End classConcrete Class
Imports CTVBusiness Imports Lockbox.Base Public Class DoStuff Inhiertits DoStuffBase Protected overrides sub initBO() Me.oDataCap = new DataCaptureReturn End sub End classIs thier another approach I should be using?