/// <summary> /// Method to Match new property with properties in DB /// </summary> /// <param name="agencyProperty"></param> /// <returns></returns> public override MatchResult IsMatch(Property agencyProperty, List<Property> databaseProperty) { var lstProperty = databaseProperty; MatchResult result = new MatchResult(); MatchRuleEngineFactory matchRuleEngine; StringBuilder errorSb = new StringBuilder(); #region Agency:OTBRE if (agencyProperty.AgencyCode.Equals(Agency.OTBRE.ToString())) { try { matchRuleEngine = new PunctuationRuleConcrete(); result.IsValidMatch = matchRuleEngine.AbstractMatchPropertyDetails(agencyProperty, lstProperty); } catch (Exception ex) { errorSb.Append("*****************************Error Processing Agency: The Best Real Estate*****************************"); errorSb.Append("Exception Message:" + ex.Message.ToString()); errorSb.Append(Environment.NewLine); errorSb.Append("Exception Stack:" + ex.StackTrace.ToString()); errorSb.Append(Environment.NewLine); } } #endregion #region Error if (errorSb.ToString() != string.Empty) { result.IsException = true; result.ExceptionMessage = errorSb.ToString(); result.IsValidMatch = false; } #endregion return result; }
/// <summary> /// Method to Match new property with properties in DB /// </summary> /// <param name="agencyProperty"></param> /// <returns></returns> public override MatchResult IsMatch(Property agencyProperty, List <Property> databaseProperty) { var lstProperty = databaseProperty; MatchResult result = new MatchResult(); MatchRuleEngineFactory matchRuleEngine; StringBuilder errorSb = new StringBuilder(); #region Agency:OTBRE if (agencyProperty.AgencyCode.Equals(Agency.OTBRE.ToString())) { try { matchRuleEngine = new PunctuationRuleConcrete(); result.IsValidMatch = matchRuleEngine.AbstractMatchPropertyDetails(agencyProperty, lstProperty); } catch (Exception ex) { errorSb.Append("*****************************Error Processing Agency: The Best Real Estate*****************************"); errorSb.Append("Exception Message:" + ex.Message.ToString()); errorSb.Append(Environment.NewLine); errorSb.Append("Exception Stack:" + ex.StackTrace.ToString()); errorSb.Append(Environment.NewLine); } } #endregion #region Error if (errorSb.ToString() != string.Empty) { result.IsException = true; result.ExceptionMessage = errorSb.ToString(); result.IsValidMatch = false; } #endregion return(result); }