public static webModel.PropertyValue ToWebModel(this moduleModel.PropertyValue propValue) { var retVal = new webModel.PropertyValue(); retVal.Id = propValue.Id; retVal.LanguageCode = propValue.LanguageCode; retVal.PropertyId = propValue.PropertyId; retVal.PropertyName = propValue.PropertyName; retVal.ValueId = propValue.ValueId; retVal.ValueType = propValue.ValueType; if (propValue.Property != null) { retVal.PropertyId = propValue.Property.Id; } if(propValue.ValueType == Domain.Catalog.Model.PropertyValueType.DateTime && propValue.Value != null) { retVal.Value = DateTime.SpecifyKind(((DateTime)propValue.Value), DateTimeKind.Utc).ToString("yyyy-MM-ddTHH:mm:ss.fffZ"); } else { retVal.Value = (propValue.Value ?? string.Empty).ToString(); } return retVal; }
public static moduleModel.PropertyValue ToCoreModel(this webModel.PropertyValue propValue) { var retVal = new moduleModel.PropertyValue(); retVal.InjectFrom(propValue); retVal.Value = propValue.Value; retVal.ValueType = (moduleModel.PropertyValueType)(int)propValue.ValueType; return retVal; }
public static webModel.PropertyValue ToWebModel(this moduleModel.PropertyValue propValue) { var retVal = new webModel.PropertyValue(); retVal.InjectFrom(propValue); retVal.Value = propValue.Value; retVal.ValueType = propValue.ValueType; return retVal; }
public static webModel.PropertyValue ToWebModel(this moduleModel.PropertyValue propValue) { var retVal = new webModel.PropertyValue(); retVal.InjectFrom(propValue); retVal.Value = propValue.Value; retVal.ValueType = propValue.ValueType; return(retVal); }
public static webModel.PropertyValue ToWebModel(this moduleModel.PropertyValue propValue) { var retVal = new webModel.PropertyValue(); retVal.InjectFrom(propValue); if(propValue.Property != null) { retVal.PropertyId = propValue.Property.Id; } retVal.Value = (propValue.Value ?? String.Empty).ToString(); retVal.ValueType = propValue.ValueType; return retVal; }
public static webModel.PropertyValue ToWebModel(this moduleModel.PropertyValue propValue) { var retVal = new webModel.PropertyValue(); retVal.InjectFrom(propValue); if (propValue.Property != null) { retVal.PropertyId = propValue.Property.Id; } retVal.Value = (propValue.Value ?? String.Empty).ToString(); retVal.ValueType = propValue.ValueType; return(retVal); }
public IHttpActionResult GetPropertyValues(string propertyId, [FromUri]string keyword = null) { //Need to return PropertyValue as it's more convenient in UI var retVal = new List<webModel.PropertyValue>(); var dictValues = _propertyService.SearchDictionaryValues(propertyId, keyword); foreach(var dictValue in dictValues) { var propValue = new webModel.PropertyValue { Value = dictValue.Value, Alias = dictValue.Alias, ValueId = dictValue.Id, LanguageCode = dictValue.LanguageCode }; retVal.Add(propValue); } return Ok(retVal.ToArray()); }
public IHttpActionResult GetPropertyValues(string propertyId, [FromUri] string keyword = null) { //Need to return PropertyValue as it's more convenient in UI var retVal = new List <webModel.PropertyValue>(); var dictValues = _propertyService.SearchDictionaryValues(propertyId, keyword); foreach (var dictValue in dictValues) { var propValue = new webModel.PropertyValue { Value = dictValue.Value, Alias = dictValue.Alias, ValueId = dictValue.Id, LanguageCode = dictValue.LanguageCode }; retVal.Add(propValue); } return(Ok(retVal.ToArray())); }
public static webModel.PropertyValue ToWebModel(this moduleModel.PropertyValue propValue) { var retVal = new webModel.PropertyValue(); retVal.Id = propValue.Id; retVal.LanguageCode = propValue.LanguageCode; retVal.PropertyId = propValue.PropertyId; retVal.PropertyName = propValue.PropertyName; retVal.ValueId = propValue.ValueId; retVal.ValueType = propValue.ValueType; if (propValue.Property != null) { retVal.PropertyId = propValue.Property.Id; retVal.PropertyMultivalue = propValue.Property.Multivalue; } retVal.Value = propValue.Value; return(retVal); }