Esempio n. 1
0
        public static webModel.Property ToWebModel(this coreModel.Property property)
        {
            var retVal = new webModel.Property();

            retVal.InjectFrom(property);
            return(retVal);
        }
		public static coreModel.Property ToCoreModel(this dataModel.DynamicContentItemProperty entity)
		{
			if (entity == null)
				throw new ArgumentNullException("entity");

			var retVal = new coreModel.Property();
			retVal.InjectFrom(entity);
			retVal.ValueType = (coreModel.PropertyValueType)entity.ValueType;
			retVal.Value = GetPropertyValue(entity);

			return retVal;
		}
Esempio n. 3
0
        public static dataModel.DynamicContentItemProperty ToDataModel(this coreModel.Property property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var retVal = new dataModel.DynamicContentItemProperty();

            retVal.InjectFrom(property);
            retVal.ValueType = (int)property.ValueType;
            SetPropertyValue(retVal, property);
            return(retVal);
        }
Esempio n. 4
0
        public static coreModel.Property ToCoreModel(this dataModel.DynamicContentItemProperty entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            var retVal = new coreModel.Property();

            retVal.InjectFrom(entity);
            retVal.ValueType = (coreModel.PropertyValueType)entity.ValueType;
            retVal.Value     = GetPropertyValue(entity);

            return(retVal);
        }
		public static coreModel.Property ToCoreModel(this webModel.Property property)
		{
			var retVal = new coreModel.Property();
			retVal.InjectFrom(property);
			return retVal;
		}
Esempio n. 6
0
        private static void SetPropertyValue(dataModel.DynamicContentItemProperty retVal, coreModel.Property property)
        {
            switch (property.ValueType)
            {
            case coreModel.PropertyValueType.Boolean:
                retVal.BooleanValue = Convert.ToBoolean(property.Value);
                break;

            case coreModel.PropertyValueType.DateTime:
                retVal.DateTimeValue = Convert.ToDateTime(property.Value);
                break;

            case coreModel.PropertyValueType.Decimal:
                retVal.DecimalValue = Convert.ToDecimal(property.Value);
                break;

            case coreModel.PropertyValueType.Integer:
                retVal.IntegerValue = Convert.ToInt32(property.Value);
                break;

            case coreModel.PropertyValueType.LongText:
                retVal.LongTextValue = Convert.ToString(property.Value);
                break;

            case coreModel.PropertyValueType.ShortText:
                retVal.ShortTextValue = Convert.ToString(property.Value);
                break;
            }
        }