public void InsertGoogleProductRecord(GoogleProductRecord record) { if (record == null) throw new ArgumentNullException("googleProductRecord"); _gpRepository.Insert(record); }
private string Size(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Size.HasValue()) return googleProduct.Size; return Settings.Size; }
private string ProductCategory(GoogleProductRecord googleProduct) { string productCategory = ""; if (googleProduct != null) productCategory = googleProduct.Taxonomy; if (productCategory.IsEmpty()) productCategory = Settings.DefaultGoogleCategory; return productCategory; }
private string Pattern(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Pattern.HasValue()) return googleProduct.Pattern; return Settings.Pattern; }
private string Material(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.Material.HasValue()) return googleProduct.Material; return Settings.Material; }
private string ItemGroupId(GoogleProductRecord googleProduct) { if (googleProduct != null && googleProduct.ItemGroupId.HasValue()) return googleProduct.ItemGroupId; return ""; }
private string Gender(GoogleProductRecord googleProduct) { if (Settings.Gender.IsCaseInsensitiveEqual(PluginHelper.NotSpecified)) return ""; if (googleProduct != null && googleProduct.Gender.HasValue()) return googleProduct.Gender; return Settings.Gender; }
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(PluginHelper.NotSpecified)) return ""; if (googleProduct != null && googleProduct.AgeGroup.HasValue()) return googleProduct.AgeGroup; return Settings.AgeGroup; }
public void UpdateInsert(int pk, string name, string value) { if (pk == 0 || name.IsEmpty()) return; var product = GetGoogleProductRecord(pk); bool insert = (product == null); var utcNow = DateTime.UtcNow; if (product == null) { product = new GoogleProductRecord { ProductId = pk, CreatedOnUtc = utcNow }; } switch (name) { case "Taxonomy": product.Taxonomy = value; break; case "Gender": product.Gender = value; break; case "AgeGroup": product.AgeGroup = value; break; case "Color": product.Color = value; break; case "Size": product.Size = value; break; case "Material": product.Material = value; break; case "Pattern": product.Pattern = value; break; case "Exporting": product.Export = value.ToBool(true); break; } product.UpdatedOnUtc = utcNow; product.IsTouched = product.IsTouched(); if (!insert && !product.IsTouched) { _gpRepository.Delete(product); return; } if (insert) { _gpRepository.Insert(product); } else { _gpRepository.Update(product); } }
public void UpdateGoogleProductRecord(GoogleProductRecord record) { if (record == null) throw new ArgumentNullException("record"); _gpRepository.Update(record); }