Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
E.PrimaryKeyValue undefined in HookParentRetrieved
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
E.PrimaryKeyValue undefined in HookParentRetrieved
Miscellaneous
Thread ID:
01037966
Message ID:
01037966
Views:
79
I have two bizobjs (mdc_main and mdc_seg) - mdc_seg is a child of mdc_main
public class frmDataCard : mmBusinessForm
{

	public frmDataCard()
	{
		MDC_MAIN = (mdc_main) this.RegisterPrimaryBizObj(new mdc_main());
		MDC_SEG =  (mdc_seg)  this.RegisterBizObj(new mdc_seg());
		MDC_MAIN.RegisterChildBizObj(MDC_SEG);

		InitializeComponent();
	...
	}
}

mdc_main
	public class mdc_main:ABusinessObject
	{
		public mdc_main()
		{
			this.TableName = "MDC_MAIN";
			this.PrimaryKey = "DDCNO";
			
		}

		public DataSet GetByListId(int iListId)
		{
			return this.GetDataSet("SELECT * FROM MDCDownload_MDC_MAIN WHERE DDCNO="+iListId.ToString());
		}

		public DataSet GetByListName(string sListName)
		{
			return GetByListName(sListName,false);
		}

		public DataSet GetByListName(string sListName,bool bContains)
		{
			if(bContains)
				return this.GetDataSet("SELECT DDCNO,DTTL FROM MDCDownload_MDC_MAIN WHERE DTTL LIKE '%"+sListName.ToUpper()+"%'");
			else
				return this.GetDataSet("SELECT DDCNO,DTTL FROM MDCDownload_MDC_MAIN WHERE DTTL LIKE '"+sListName.ToUpper()+"%'");
		}

	}


mdc_seg
	public class mdc_seg:ABusinessObject
	{
		public mdc_seg()
		{
			this.TableName = "MDC_SEG";
			this.PrimaryKey = "SGDCNO";
		}

		public DataSet GetByListId(int iListId)
		{
			return this.GetDataSet("SELECT * FROM MDCDownload_MDC_SEG WHERE SGDCNO="+iListId.ToString() + " ORDER BY SGSQNO");
		}

		protected override void HookParentNavigated(mmBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
		{
			this.GetByListId((int)e.PrimaryKeyValue);
		}	

		protected override void HookParentRetrieved(mmBusinessObject bizObj, mmBusinessStateChangeEventArgs e)
		{
			this.GetByListId((int)e.PrimaryKeyValue);
		}


	}
In the form, I call mdc_main's GetByListId(), which fires the Hook methods. But when it gets to the hook methods, e.PrimaryKeyValue is undefined (null?), and causes them to bomb.

Any ideas?
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Next
Reply
Map
View

Click here to load this message in the networking platform