Example #1
0
 /// <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));
 }
Example #2
0
 /// <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));
 }
Example #3
0
 public ProductBuilder WithMetaProduct(MetaProduct metaProduct)
 {
     defaultMetaProduct = metaProduct;
     return this;
 }
Example #4
0
 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);
 }
Example #6
0
 public EditData(Product p, MetaProduct metaProduct, bool imageUploadAllowed)
 {
     Product = p;
     CurrentMetaProduct = metaProduct;
     CurrentMetaProductName = metaProduct.Name;
     ImageUploadAllowed = imageUploadAllowed;
 }
Example #7
0
 public EditData(Buyer b, MetaProduct mp)
 {
     Buyer = b;
     CurrentMetaProduct = mp;
 }
Example #8
0
 partial void DeleteMetaProduct(MetaProduct instance);
Example #9
0
 partial void UpdateMetaProduct(MetaProduct instance);
Example #10
0
 partial void InsertMetaProduct(MetaProduct instance);
Example #11
0
		private void detach_MetaProducts(MetaProduct entity)
		{
			this.SendPropertyChanging();
			entity.Agency = null;
		}