Lots and Taxmaps Collection

Discussions related to custom development with Select.
Post Reply
ddudley3
Posts: 55
Joined: Fri May 03, 2013 9:11 am

Lots and Taxmaps Collection

Post by ddudley3 »

I can get to the Lots Collection under the Property by doing this

var props = (IList) order["Properties"];
var property = (IOrderItem) props[0];
var lotList = (ICollection)property["Lots"];

However if I want to add to this collection .. what is the type I need to define and add?

Also have the same question for
var mapList = (ICollection)property["TaxMaps"];
BobRichards
Posts: 1377
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Lots and Taxmaps Collection

Post by BobRichards »

Our pattern for adding to collections is to get the type from the IOrder then add it to the list.

Code: Select all

// Get a property.
 IOrderItem property = (IOrderItem)((IList)iOrder["Properties"])[0];

// Add a lot.
IList lots = (IList)property["Lots"];
IOrderItem lot = iOrder.CreateNew("Lot");
lot["Number"] = 22;
lots.Add(lot);
Similarily, you can add a new TaxMap:

Code: Select all

IList taxMaps = (IList)property["TaxMaps"];
IOrderItem taxMap = iOrder.CreateNew("TaxMap");
taxMap["Identification"] = "New tax map";
taxMaps.Add(taxMap);
Bob Richards, Senior Software Developer, SoftPro
Post Reply