public void Update(CsvRow row) { String?sku = row?.GetColumn(Sku).Value; if (MatchingRowIds.ContainsKey(sku)) { WeightCubicVolumeInformation wi = MatchingRowIds[sku]; if (wi != null) { row?.SetColumn("Variant Grams", wi.Grams.ToString(CultureInfo.InvariantCulture)); row?.SetColumn(Weight, wi.Weight.ToString()); } } }
public void RemoveExcludedRows(CsvFile products) { if (MatchingRowIds.Count == 0) { return; } foreach (CsvRow row in products.Rows.Where(r => r.ExcludeMe)) { IFilterValue value = row.GetColumn(Sku); if (MatchingRowIds.ContainsKey(value.Value) == true) { MatchingRowIds.Remove(value.Value); } } }
public void Update(CsvRow row) { if (row != null) { String sku = row.GetColumn(Sku).Value; if (MatchingRowIds.ContainsKey(sku)) { PriceInformation pi = MatchingRowIds[sku]; if (pi != null) { row.SetColumn(VariantCompareToPrice, pi.Msrp); row.SetColumn(Option1Value, "Default Title"); row.SetColumn(CostPerItem, pi.CostPerItem); row.SetColumn(VariantPrice, pi.Price); row.SetColumn(Price, pi.Price); row.SetColumn(Msrp, pi.Msrp); row.SetColumn(Option1Name, "Title"); } } } }
public bool?HasBeenFiltered(IFilterRow row) { return(MatchingRowIds.ContainsKey(row?.Handle.Value)); }
public bool?HasBeenFiltered(IFilterRow row) { IFilterValue?handle = row?.Handle; return(MatchingRowIds.ContainsKey(handle?.Value)); }