Beispiel #1
0
        internal bool UpdateCreditCard(RowLockingWrapper <CreditCardRow> creditCardRowWrapper,
                                       FluidTrade.Core.IDataModelTransaction dataModelTransaction, bool isValid)
        {
            this.cardMatcher.RemoveRowFromMap(creditCardRowWrapper.Row);

            if (isValid == false)
            {
                return(false);
            }

            //System.Diagnostics.Trace.WriteLine(
            //    string.Format("{0}  Updating CreditCard: {1}", System.Threading.Thread.CurrentThread.Name,
            //                        creditCardRowWrapper.TypedRow["OriginalAccountNumber"]));

            creditCardRowWrapper.AcquireReaderLock();
            try
            {
                //if not valid or rowState is delete/detach all can do is remove the row
                if (creditCardRowWrapper.Row.RowState == DataRowState.Deleted ||
                    creditCardRowWrapper.Row.RowState == DataRowState.Detached)
                {
                    return(false);
                }


                this.cardMatcher.AddTableRowToMap(creditCardRowWrapper);
            }
            finally
            {
                creditCardRowWrapper.ReleaseReaderLock();
            }

            return(true);
        }
Beispiel #2
0
        internal bool UpdateConsumer(RowLockingWrapper <ConsumerRow> consumerRowWrapper,
                                     FluidTrade.Core.IDataModelTransaction dataModelTransaction, bool isValid)
        {
            this.socialMatcher.RemoveRowFromMap(consumerRowWrapper.Row);
            this.lastNameMatcher.RemoveRowFromMap(consumerRowWrapper.Row);
            this.firstNameMatcher.RemoveRowFromMap(consumerRowWrapper.Row);

            if (isValid == false)
            {
                return(false);
            }

            consumerRowWrapper.AcquireReaderLock();
            try
            {
                //if not valid or rowState is delete/detach all can do is remove the row
                if (consumerRowWrapper.Row.RowState == DataRowState.Deleted ||
                    consumerRowWrapper.Row.RowState == DataRowState.Detached)
                {
                    return(false);
                }


                this.socialMatcher.AddTableRowToMap(consumerRowWrapper);
                this.lastNameMatcher.AddTableRowToMap(consumerRowWrapper);
                this.firstNameMatcher.AddTableRowToMap(consumerRowWrapper);
            }
            finally
            {
                consumerRowWrapper.ReleaseReaderLock();
            }

            return(true);
        }