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