Esempio n. 1
0
        }         // DecisionName

        protected override bool MakeAndVerifyDecision(AutoApproveInputRow oRow)
        {
            var agent = new Agent(oRow.CustomerId, null, null, Tag, DB, Log);

            agent.Init().MakeAndVerifyDecision();

            return(!agent.WasException && !agent.WasMismatch);
        } // MakeAndVerifyDecision
Esempio n. 2
0
        }         // DecisionName

        protected override bool MakeAndVerifyDecision(AutoApproveInputRow oRow)
        {
            var a = new Approval(
                oRow.CustomerId,
                null,
                null,
                oRow.OfferedLoanAmount,
                oRow.GetMedal(),
                oRow.GetMedalType(),
                oRow.GetTurnoverType(),
                Tag,
                DB,
                Log
                ).Init();

            a.MakeAndVerifyDecision();

            return(!a.WasMismatch);
        } // MakeAndVerifyDecision
Esempio n. 3
0
        }         // Name

        public override void Execute()
        {
            Log.Debug("Strategy context is: {0}.", Context);

            this.allCustomers = AutoApproveInputRow.Load(DB, this.topCount, this.lastCheckedCustomerID);

            this.dispatcher.AllCustomersCount = this.allCustomers.Count;

            List <AutoApproveInputRow>[] lst = new List <AutoApproveInputRow> [3];

            if (lst.Length > 1)
            {
                for (int i = 0; i < lst.Length; i++)
                {
                    lst[i] = new List <AutoApproveInputRow>();
                }

                int j = 0;

                foreach (AutoApproveInputRow row in this.allCustomers)
                {
                    lst[j].Add(row);

                    j++;

                    if (j == lst.Length)
                    {
                        j = 0;
                    }
                }                 // for each

                lst.AsParallel().ForAll(DoOneRowList);
            }
            else
            {
                DoOneRowList(this.allCustomers);
            }
        }         // Execute
Esempio n. 4
0
        private string VerifyOne(AutoApproveInputRow oRow)
        {
            try {
                string sResult;

                if (MakeAndVerifyDecision(oRow))
                {
                    sResult = "match";
                    this.dispatcher.AddMatch();
                }
                else
                {
                    sResult = "mismatch";
                    this.dispatcher.AddMismatch();
                }                 // if

                return(sResult);
            } catch (Exception e) {
                Log.Debug(e, "Exception caught.");
                this.dispatcher.AddException();
                return("exception");
            }     // try
        }         // VerifyOne
Esempio n. 5
0
        }         // constructor

        protected abstract bool MakeAndVerifyDecision(AutoApproveInputRow oRow);