StrataFrame Forum

Reading BO that is a property of a class

http://forum.strataframe.net/Topic28881.aspx

By Ian Johnston - 11/1/2010

Is there a way to use a BO as a property on a class and read the data? I thought I saw a constuct like   string pn = ((this.LightBOname)+".light_com_port");

where LightBOName is a property on the subclass of System.IO.Ports.SerialPort

pn is assigned the string "LightBO1.light_com_port" instead of Com9.

 

By Greg McGuffey - 11/1/2010

You would just create a property that has the type of your BO.
public LightBO LightBOname { get; set; }

They you have a strongly typed property that you can use like:
string pn = this.LightBOname.light_com_port;


You'd have to do the fill of the BO at the right time of course, but when doing that you again just access the fill method directly:
this.LightBOname.MyFillMethod();
By Ian Johnston - 11/1/2010

Had to declare it as

public
BusinessObjects.Light_controlBO LightBOname

Worked great.

Thanks

 

By Greg McGuffey - 11/1/2010

Glad you got it working!