Exemple #1
0
        ///<summary>
        /// Sets a property of a Business Object given the property name
        /// (or the virtual property name delimited by dashes) and the value.
        ///</summary>
        ///<param name="propertyName">The name of the property to set.</param>
        ///<param name="value">The value to set.</param>
        public void SetDisplayPropertyValue(string propertyName, object value)
        {
            if (_businessObject == null)
            {
                return;
            }
            var propertyMapper = BOPropMapperFactory.CreateMapper(this._businessObject, propertyName);

            propertyMapper.SetPropertyValue(value);
        }
Exemple #2
0
        /// <summary>
        /// Returns a property value in the form it will be displayed in a
        /// user interface (sometimes the underlying value may be stored
        /// differently, as in a lookup-list)
        /// </summary>
        /// <param name="propertyName">The property name</param>
        /// <returns>Returns the formatted object to display</returns>
        public object GetPropertyValueToDisplay(string propertyName)
        {
            if (IsAlternateRelationshipProp(propertyName))
            {
                return(GetAlternateRelationshipValue(propertyName));
            }
            var propertyMapper = BOPropMapperFactory.CreateMapper(this._businessObject, propertyName);

            return(propertyMapper.GetPropertyValue());
        }
Exemple #3
0
        private void ApplyRowCellValueToBOProperty(DataRow row, UIGridColumn uiProperty, IBusinessObject changedBo)
        {
            string columnName = uiProperty.PropertyName;

            if (!uiProperty.Editable)
            {
                return;
            }
            IBOPropertyMapper boPropertyMapper = BOPropMapperFactory.CreateMapper(changedBo, columnName);

            boPropertyMapper.SetPropertyValue(row[columnName]);
            row.SetColumnError(columnName, boPropertyMapper.InvalidReason);
        }