/// <summary>
        /// Create a new working order.
        /// </summary>
        /// <param name="workingOrderRow">The WorkingOrderRow of the working order.</param>
        public ConsumerDebtWorkingOrder(WorkingOrderRow workingOrderRow)
            : base(workingOrderRow)
        {
            SecurityRow     securityRow     = workingOrderRow.SecurityRowByFK_Security_WorkingOrder_SecurityId;
            ConsumerDebtRow consumerDebtRow = securityRow.GetConsumerDebtRows()[0];
            ConsumerRow     consumerRow     = consumerDebtRow.ConsumerRow;

            this.consumerDebtRowVersion = consumerDebtRow.RowVersion;
            this.firstName            = consumerRow.IsFirstNameNull() ? null : consumerRow.FirstName;
            this.lastName             = consumerRow.IsLastNameNull() ? null : consumerRow.LastName;
            this.socialSecurityNumber = consumerRow.SocialSecurityNumber;
        }
Beispiel #2
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="consumerRowToFind"></param>
            /// <param name="creditCardRowToFind"></param>
            /// <param name="creditCardMatchInfo"></param>
            /// <param name="socialMatchInfo"></param>
            /// <param name="lastNameMatchInfo"></param>
            public MatchResult(ConsumerRow consumerRowToFind,
                               CreditCardRow creditCardRowToFind,
                               MatchInfo creditCardMatchInfo,
                               MatchInfo socialMatchInfo,
                               MatchInfo lastNameMatchInfo)
            {
                this.consumerRowToFind   = consumerRowToFind;
                this.creditCardRowToFind = creditCardRowToFind;
                this.creditCardMatchInfo = creditCardMatchInfo;
                this.socialMatchInfo     = socialMatchInfo;
                this.lastNameMatchInfo   = lastNameMatchInfo;

                this.ComputeStrength();
            }
 /// <summary>
 ///
 /// </summary>
 /// <param name="row"></param>
 public Consumer(ConsumerRow row)
 {
     this.RowId      = row.ConsumerId;
     this.RowVersion = row.RowVersion;
 }
Beispiel #4
0
        private void GetMatchResultsForSocial(RowLockingWrapper <CreditCardRow> creditCardRowToFind,
                                              RowLockingWrapper <ConsumerRow> consumerRowToFind,
                                              object ccNum, object lastName,
                                              List <MatchResult> results, IEnumerable <MatchInfo> snMiList,
                                              IDataModelTransaction dataModelTransaction, Decimal matchThreshold)
        {
            if (snMiList == null)
            {
                return;
            }

            //!!!RM what is faster using the .Consumer row
            //or using the ConsumerRow Fuz Matcher
            foreach (MatchInfo snMi in snMiList)
            {
                ConsumerRow miConsumerRow = (ConsumerRow)snMi.row;

                RowLockingWrapper <ConsumerRow> miConsumerRowWrapper = new RowLockingWrapper <ConsumerRow>(miConsumerRow, dataModelTransaction);
                MatchInfo ssnLnMi = this.lastNameMatcher.Validate(lastName, miConsumerRowWrapper, dataModelTransaction);

                MatchInfo ssnFnMi = null;

                miConsumerRowWrapper.AcquireReaderLock();
                if (miConsumerRow.RowState == DataRowState.Deleted ||
                    miConsumerRow.RowState == DataRowState.Detached)
                {
                    continue;
                }
                try
                {
                    CreditCardRow[] ccRows = miConsumerRow.GetCreditCardRows_NoLockCheck();

                    if (ccRows.Length > 0)
                    {
                        foreach (CreditCardRow snCcRow in ccRows)
                        {
                            RowLockingWrapper <CreditCardRow> snCcRowWrappper = new RowLockingWrapper <CreditCardRow>(snCcRow, dataModelTransaction);

                            MatchInfo   ssnCcMi = this.cardMatcher.Validate(ccNum, snCcRowWrappper, dataModelTransaction);
                            MatchResult mr      = new MatchResult(consumerRowToFind.TypedRow, creditCardRowToFind.TypedRow, ssnCcMi, snMi, ssnLnMi);
                            //if(mr.Strength < 1M)
                            //{
                            if (ssnFnMi == null)
                            {
                                consumerRowToFind.AcquireReaderLock();
                                try
                                {
                                    ssnFnMi = this.firstNameMatcher.Validate(consumerRowToFind.Row[this.firstNameColumn], miConsumerRowWrapper, dataModelTransaction);
                                }
                                finally
                                {
                                    consumerRowToFind.ReleaseReaderLock();
                                }
                            }
                            mr.AddFirstNameMatchInfo(ssnFnMi);
                            //}

                            if (mr.Strength >= matchThreshold)
                            {
                                results.Add(mr);
                            }
                        }
                    }
                    else
                    {
                        MatchResult mr = new MatchResult(consumerRowToFind.TypedRow, creditCardRowToFind.TypedRow, null, snMi, ssnLnMi);

                        consumerRowToFind.AcquireReaderLock();
                        try
                        {
                            mr.AddFirstNameMatchInfo(this.firstNameMatcher.Validate(consumerRowToFind.Row[this.firstNameColumn], miConsumerRowWrapper, dataModelTransaction));
                        }
                        finally
                        {
                            consumerRowToFind.ReleaseReaderLock();
                        }

                        if (mr.Strength >= matchThreshold)
                        {
                            results.Add(mr);
                        }
                    }
                }
                finally
                {
                    miConsumerRowWrapper.ReleaseReaderLock();
                }
            }
        }