/// <summary>Add/update a preference range on Buyer b.</summary> public void UpsertPreference(Buyer b, MetaProduct metaProduct, MetaAttribute ma, string formattedLowerBound, string formattedUpperBound) { Preference pref = null; if (b.HasPreferenceFor(ma.Id)) { pref = b.GetPreference(ma.Id); if (IsEmptyRange(formattedLowerBound, formattedUpperBound)) { saver.MarkForDeletion(pref); return; } } else { if (IsEmptyRange(formattedLowerBound, formattedUpperBound)) return; pref = _buyerRepo.CreatePreference(b, ma); } pref.SetRange(new ValueRange(formattedLowerBound, formattedUpperBound, ma.DataTypeEnum, FormattedOrRaw.FORMATTED)); }
/// <summary>Add/update a preference set on Buyer b.</summary> /// <param name="b"></param><param name="metaProduct"></param><param name="ma"></param><param name="rawValues"></param> public void UpsertPreference(Buyer b, MetaProduct metaProduct, MetaAttribute ma, string rawValues) { Preference pref = null; if (b.HasPreferenceFor(ma.Id)) { pref = b.GetPreference(ma.Id); if (String.IsNullOrEmpty(rawValues)) { saver.MarkForDeletion(pref); return; } } else { if (String.IsNullOrEmpty(rawValues)) return; pref = _buyerRepo.CreatePreference(b, ma); } pref.SetSet(new ValueSet(rawValues, ma.DataTypeEnum)); }
public ProductBuilder WithMetaProduct(MetaProduct metaProduct) { defaultMetaProduct = metaProduct; return this; }
public void UpdateSuburbs(MetaProduct metaProduct) { if (metaProduct == null) return; var suburbAtt = metaProduct.GetMetaAttribute("Suburb"); suburbAtt.Choices = SuburbList.Trim(new char[] {' ',','}); }
private void AssertMetaProductAttribtues(MetaProduct mp) { Assert.AreEqual("Real Estate", mp.Name); Assert.AreEqual(String.Empty, mp.Description); }
public EditData(Product p, MetaProduct metaProduct, bool imageUploadAllowed) { Product = p; CurrentMetaProduct = metaProduct; CurrentMetaProductName = metaProduct.Name; ImageUploadAllowed = imageUploadAllowed; }
public EditData(Buyer b, MetaProduct mp) { Buyer = b; CurrentMetaProduct = mp; }
partial void DeleteMetaProduct(MetaProduct instance);
partial void UpdateMetaProduct(MetaProduct instance);
partial void InsertMetaProduct(MetaProduct instance);
private void detach_MetaProducts(MetaProduct entity) { this.SendPropertyChanging(); entity.Agency = null; }