예제 #1
0
        /// <summary>
        /// Get Formatted Start Date
        /// </summary>
        /// <param name="allPropertyValues"></param>
        /// <param name="propertyName"></param>
        /// <returns></returns>
        private string GetDateFromProperty(COBieDataPropertySetValues allPropertyValues, string propertyName)
        {
            string startData = "";
            IfcPropertySingleValue ifcPropertySingleValue = allPropertyValues.GetPropertySingleValue(propertyName);

            if (ifcPropertySingleValue != null)
            {
                if (ifcPropertySingleValue.NominalValue != null)
                {
                    startData = ifcPropertySingleValue.NominalValue.ToString();
                }
            }
            else
            {
                startData = allPropertyValues.GetPropertyValue(propertyName, false);
            }

            DateTime frmDate;

            if (DateTime.TryParse(startData, out frmDate))
            {
                startData = frmDate.ToString(Constants.DATE_FORMAT);
            }
            else if (string.IsNullOrEmpty(startData))
            {
                startData = Constants.DEFAULT_STRING;//Context.RunDate;
            }
            return(startData);
        }
예제 #2
0
        /// <summary>
        /// Get the Asset Type from the property set property. If nothing found then default to Moveable/Fixed decided on IfcObjectType
        /// </summary>
        /// <param name="ifcTypeObject">IfcTypeObject Object</param>
        /// <param name="allPropertyValues">COBieDataPropertySetValues object holding the property sets</param>
        /// <returns>String holding Asset Type</returns>
        private string GetAssetType(IfcTypeObject ifcTypeObject, COBieDataPropertySetValues allPropertyValues)
        {
            allPropertyValues.SetAllPropertyValues(ifcTypeObject, "COBie_Asset");
            string value = allPropertyValues.GetPropertyValue("AssetType", false);

            if (value == DEFAULT_STRING)
            {
                allPropertyValues.SetAllPropertyValues(ifcTypeObject, "Pset_Asset");
                value = allPropertyValues.GetPropertySingleValueValue("AssetAccountingType", false);
            }

            if (value == DEFAULT_STRING)
            {
                if (ifcTypeObject is IfcFurnitureType)
                {
                    value = "Moveable";     // Could be NonFixed in US picklists
                }
                else
                {
                    value = "Fixed";
                }
            }
            return(value);
        }