Advice wanted for common Manager functions

Posts   
 
    
Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 04-Jul-2006 19:10:32   

Hi,

I'm using V2 beta (upgrading tomorrow), VB, Adapter:

I have many Lookup tables maintained within dataviewgrids, and each is supported by Manager functions located in one LookupManager.vb class. One example for entity WorkType follows:

    Function GetAllWorkTypes() As EntityCollection(Of WorkTypeEntity)
        Dim adapter As New DataAccessAdapter
        Try
            Dim allWorkTypes As New EntityCollection(Of WorkTypeEntity)(New WorkTypeEntityFactory())
            adapter.FetchEntityCollection(allWorkTypes, Nothing)
            allWorkTypes.AllowRemove = True
            Return allWorkTypes
        Finally
            adapter.Dispose()
        End Try
    End Function

Is there some way of passing the names of the different lookup tables into a common function, given that ‘WorkTypeEntity and WorkTypeEntityFactory are predefined in my DAL?

Or is there some other way of approaching this disappointed

Thanks for any advice.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jul-2006 07:16:33   

You might want to use Reflection or .Net Class activator, please refer to the folowing thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=6304

Also the following thread was discussing dealing with lookups: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=5528

Markiemac
User
Posts: 132
Joined: 25-Apr-2006
# Posted on: 06-Jul-2006 12:13:02   

Thanks Walaa. There's a lot there to play with stuck_out_tongue_winking_eye