public static coreModel.Property ToCoreModel(this webModel.Property property) { var retVal = new coreModel.Property(); retVal.InjectFrom(property); retVal.Value = property.Value; return retVal; }
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; } }
public static coreModel.Property ToCoreModel(this webModel.Property property) { var retVal = new coreModel.Property(); retVal.InjectFrom(property); retVal.Value = property.Value; return(retVal); }
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); }
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; }
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); }
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); }