コード例 #1
0
		public static coreModel.Property ToCoreModel(this webModel.Property property)
		{
			var retVal = new coreModel.Property();
			retVal.InjectFrom(property);
			retVal.Value = property.Value;
			return retVal;
		}
コード例 #2
0
        private static void SetPropertyValue(dataModel.ContactPropertyValue 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;
            }
        }
コード例 #3
0
        public static coreModel.Property ToCoreModel(this webModel.Property property)
        {
            var retVal = new coreModel.Property();

            retVal.InjectFrom(property);
            retVal.Value = property.Value;
            return(retVal);
        }
コード例 #4
0
        public static webModel.Property ToWebModel(this coreModel.Property property)
        {
            var retVal = new webModel.Property();

            retVal.InjectFrom(property);
            if (property.Value != null)
            {
                retVal.Value = property.Value.ToString();
            }
            return(retVal);
        }
コード例 #5
0
        public static coreModel.Property ToCoreModel(this dataModel.ContactPropertyValue 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;
        }
コード例 #6
0
        public static dataModel.ContactPropertyValue ToDataModel(this coreModel.Property property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var retVal = new dataModel.ContactPropertyValue();

            retVal.InjectFrom(property);
            retVal.ValueType = (int)property.ValueType;
            SetPropertyValue(retVal, property);
            return(retVal);
        }
コード例 #7
0
        public static coreModel.Property ToCoreModel(this dataModel.ContactPropertyValue 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);
        }