Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defaults: mmBusinessObject.NewRow(object defaultValues)
Message
From
24/10/2003 18:52:48
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
23/10/2003 11:53:46
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00839959
Message ID:
00842518
Views:
16
One other thing here...

While talking with Kevin about incorporating this into the framework docs, we discovered that my cut/paste skills aren't up to the task.

Both the second and third pieces of code were missing a cast to the appropriate subclass of ADefaultValues.

Second piece of code should have read as follows:
OrderDefaultValues ordDefaults = (OrderDefaultValues)this.OrderObj.DefaultValues;

//Here, we're storing the Product and Customer (selected by our users and stored as static fields) to which our new order belongs.
ordDefaults.ProductID = GlobalData.Product.GetProductID();
ordDefaults.CustID = GlobalData.Customer.GetCustomerID();

this.NewRow(ordDefaults);
This is "new look" 3rd section:
protected override void HookSetDefaultValues(DataRow dr)
{
OrderDefaultValues ordDefaults = (OrderDefaultValues)this.OrderObj.DefaultValues;

   dr["iProductID"] = ordDefaults.ProductID;
   dr["iCustID"] = ordDefaults.CustomerID;
}
Previous
Reply
Map
View

Click here to load this message in the networking platform