Beispiel #1
0
        /// <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 : LRE
            if (agencyProperty.AgencyCode.Equals(Agency.LRE.ToString()))
            {
                try
                {
                    matchRuleEngine = new LocationRuleConcrete();
                    result.IsValidMatch = matchRuleEngine.AbstractMatchPropertyDetails(agencyProperty, lstProperty);
                }
                catch (Exception ex)
                {

                    errorSb.Append("*****************************Error Processing Agency: Location 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 : LRE
            if (agencyProperty.AgencyCode.Equals(Agency.LRE.ToString()))
            {
                try
                {
                    matchRuleEngine     = new LocationRuleConcrete();
                    result.IsValidMatch = matchRuleEngine.AbstractMatchPropertyDetails(agencyProperty, lstProperty);
                }
                catch (Exception ex)
                {
                    errorSb.Append("*****************************Error Processing Agency: Location 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);
        }