/// <summary> /// Listingses from result. /// </summary> /// <param name="result">The result.</param> public void ListingsFromResult(UPCRMResult result) { List <UPSEListing> listingArray = new List <UPSEListing>(); int count = result.RowCount; for (int i = 0; i < count; i++) { UPCRMResultRow row = (UPCRMResultRow)result.ResultRowAtIndex(i); UPSEListing item = new UPSEListing(row, this.ListingController.ListingMapping, this); listingArray.Add(item); } this.Listings = listingArray; }
/// <summary> /// Listings the matches values. /// </summary> /// <param name="listing">The listing.</param> /// <param name="values">The values.</param> /// <returns></returns> public UPSEListingFieldMatchResult ListingMatchesValues(UPSEListing listing, Dictionary <string, string> values) { UPSEListingFieldMatchResult result = UPSEListingFieldMatchResult.Yes; foreach (string functionName in this.FunctionNames) { string value = values.ValueOrDefault(functionName); string listingValue = listing.ValueDictionary.ValueOrDefault(functionName) as string; if (string.IsNullOrEmpty(value) || value == "0" || string.IsNullOrEmpty(listingValue) || listingValue == "0") { result = UPSEListingFieldMatchResult.Open; } else if (value != listingValue) { return(UPSEListingFieldMatchResult.No); } } return(result); }
/// <summary> /// Initializes a new instance of the <see cref="UPSERow"/> class. /// </summary> /// <param name="resultRow">The result row.</param> /// <param name="listing">The listing.</param> /// <param name="serialEntry">The serial entry.</param> public UPSEPOSRow(UPCRMResultRow resultRow, UPSEListing listing, UPSerialEntry serialEntry) : base(resultRow, listing, serialEntry) { }
/// <summary> /// Rows from source result row. /// </summary> /// <param name="row">The row.</param> /// <param name="listing">The listing.</param> /// <returns></returns> public override UPSERow RowFromSourceResultRow(UPCRMResultRow row, UPSEListing listing) { return(new UPSEPOSRow(row, listing, this)); }