| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace test { class Program { static void Main(string[] args) { baseObjectType newvalue = new baseObjectType(); newvalue = BaseObjectTypeDAO.setvalue<baseObjectType>(newvalu e); Console.WriteLine(newvalue.X.ToString()); PayObjectType newb = new PayObjectType(); newb.X = 101; newb.Y = 101; //returns a payobject on a for a given id newb = BaseObjectTypeDAO.setvalue<PayObjectType>(newb); Console.WriteLine(newb.X.ToString()); Console.WriteLine(newb.Y.ToString()); //return a recipt object for a given id ReceiptObjectType newc = new ReceiptObjectType(); newc.X = 102; newc.Z = 102; newc = BaseObjectTypeDAO.setvalue<ReceiptObjectType>(newc ); Console.WriteLine(newc.X.ToString()); Console.WriteLine(newc.Z.ToString()); Console.Read(); } } //no workflow associated class baseObjectType { int x; public int X { get { return x; } set { x = value; } } } //a workflow is associated to move from checked, cleared and pending. class PayObjectType : baseObjectType { int y; public int Y { get { return y; } set { y = value; } } } //a workflow is associated with new and cleared state changes. class ReceiptObjectType : baseObjectType { int z; public int Z { get { return z; } set { z = value; } } } class BaseObjectTypeDAO { public static T setvalue<T>(T value) { baseObjectType A = value as baseObjectType; A.X = 10; return value; } } } |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.