"Generic" Class to obtain Column Value from "common" multiple tables

Posts   
 
    
normanlc
User
Posts: 62
Joined: 10-Jan-2007
# Posted on: 24-Feb-2008 22:26:36   

Don't know if I'm going to explain this very well, then again someone may catch on very quickly.

In a number of tables (Access 2003 Database) I have the following columns:

AddDateTime (General DateTime) AddUser (String) ModifyDateTime (General DateTime) ModifyUser (String) DeleteDateTime (General DateTime) DeleteUser (String) DeleteReason (String)

I am creating one Window's Form to display this information, but one of the properties of the Window Form is going to be either a System.Object or if LLBLGen Pro has a "Base Class" for all (didn't see that in browsing created code from generator (Factory Classes maybe the place)).

I want to obtain these column values across all table, known at coding time not something that needs to be discovered, so they can be displayed within the Window Form.

i.e.

private System.Object _entity_class = null;

private String AddDateString { get { return ((DateTime)???).Date.ToShortDateString(); } }

The ??? represents how I would get the GetProperty value from the LLBLGen Pro entity class in a generic form...

I'm sure this can be done and spent some time researching, but I'm coming up with nothing or I'm having several bad days with using search engines...

Any assistance would be appreciated - thanks!

Norman

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Feb-2008 03:44:59   

I think that is possible. You can use the IEntityCollection(2) to bind to the grid. Then you could use the someActualEntity.Fields["somefield"].CurrentValue. But if you are building the grid at design-time you could bind to a XCollection and specify the columns. Then at runtime you can change the datasource.

What llblgen version are you using? What template set (adpater, selfServicing) are you using?

David Elizondo | LLBLGen Support Team
normanlc
User
Posts: 62
Joined: 10-Jan-2007
# Posted on: 25-Feb-2008 16:35:40   

daelmo wrote:

I think that is possible. You can use the IEntityCollection(2) to bind to the grid. Then you could use the someActualEntity.Fields["somefield"].CurrentValue. But if you are building the grid at design-time you could bind to a XCollection and specify the columns. Then at runtime you can change the datasource.

What llblgen version are you using? What template set (adpater, selfServicing) are you using?

Thank you for responding.

I am not using a grid or any type of data binding for that matter. I am using LLBLGEN Pro v2.5 and SelfServicing template set.

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 25-Feb-2008 18:24:27   

Then, the WinForm's property could be a IEntity (if you are passing an Entity) or a IEntityCollection (if you are passing a Collection).