private void InsertGoogleProductRecord(GoogleProductRecord googleProductRecord) { if (googleProductRecord == null) throw new ArgumentNullException("googleProductRecord"); _gpRepository.Insert(googleProductRecord); }
private string ItemGroupId(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.ItemGroupId.HasValue()) return googleProduct.ItemGroupId; return ""; }
public virtual void UpdateInsert(int pk, string name, string value) { if (pk == 0 || name.IsNullOrEmpty()) return; var product = GetByProductId(pk); bool insert = (product == null); if (insert) { product = new GoogleProductRecord() { ProductId = pk }; } switch(name) { case "GoogleCategory": product.Taxonomy = value; break; case "Gender": product.Gender = value; break; case "AgeGroup": product.AgeGroup = value; break; case "Color": product.Color = value; break; case "GoogleSize": product.Size = value; break; } if (insert) { InsertGoogleProductRecord(product); } else { UpdateGoogleProductRecord(product); } }
private string Material(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Material.HasValue()) return googleProduct.Material; return Settings.Material; }
private string Pattern(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Pattern.HasValue()) return googleProduct.Pattern; return Settings.Pattern; }
private string Size(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Size.HasValue()) return googleProduct.Size; return Settings.Size; }
private string Color(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Color.HasValue()) return googleProduct.Color; return Settings.Color; }
private string AgeGroup(GoogleProductRecord googleProduct) { if (Settings.AgeGroup.IsCaseInsensitiveEqual(PluginHelperBase.NotSpecified)) return ""; if (googleProduct != null && googleProduct.AgeGroup.HasValue()) return googleProduct.AgeGroup; return Settings.AgeGroup; }
private string Gender(GoogleProductRecord googleProduct) { if (Settings.Gender.IsCaseInsensitiveEqual(PluginHelperBase.NotSpecified)) return ""; if (googleProduct != null && googleProduct.Gender.HasValue()) return googleProduct.Gender; return Settings.Gender; }
private string ProductCategory(GoogleProductRecord googleProduct) { string productCategory = ""; if (googleProduct != null) productCategory = googleProduct.Taxonomy; if (productCategory.IsNullOrEmpty()) productCategory = Settings.DefaultGoogleCategory; return productCategory; }