Property Use
Posted: Tue Dec 11, 2018 11:40 am
I have been looking at how to populate the field “Property Use”, but I can’t locate it in the SDK help. Can you point me in the right direction?
Free support for custom code within SoftPro's products, monitored by SoftPro employees with a 24-48 hr expected turn time on business days.
https://devforum.softprocorp.com/
Code: Select all
/// <summary>
/// Get the IPropertyUse IEnum and set the first property to the "1 - 4 family residential" value.
/// </summary>
/// <param name="package">The package.</param>
/// <param name="order">The order.</param>
/// <exception cref="NotSupportedException">Description not found!</exception>
public Dev_IEnumValue(Package package, IOrder order)
{
// Get the desired dynamic enumeration (IPropertyUse) from the Server.
SelectServer ss = (SelectServer)package.GetService(typeof(SelectServer));
IEnumManager enumMgr = (IEnumManager)ss.GetService(typeof(IEnumManager));
IEnum<IPropertyUse> puEnum = enumMgr.GetEnum<IPropertyUse>();
// Search for value from dynamic enumeration.
IPropertyUse pu
= puEnum.Values.Where(t => t.Description == "1 - 4 family residential" && t.Enabled).FirstOrDefault();
if (pu == null)
{
throw new NotSupportedException("Description not found!");
}
// Set order model property on first Property.
IList props = (IList)order["Properties"];
IOrderItem prop0 = (IOrderItem)props[0];
prop0.SetProperty("Use", pu);
}