// Pretend that we have preformed some exotic
// credit validation here...
Random r = new Random();
int value = r.Next(500);
if (value > 300)
CreditOK = true;
else
CreditOK = false;
}
Next, add an IfElse activity named CreditCheckPassedActivity with two branches named
CreditCheckOK and CreditCheckFailed. Configure the left branch to be evaluated using a new
declarative rule condition using the following conditional expression:
this.CreditOK == true
If the user fails the credit check, our goal is to remove them from the Customers table and add
them to the CreditRisks table. Given that Chapter 22 already accounted for this possibility using the
ProcessCreditRisk() method of the InventoryDAL type, add a new CodeActivity type within the
CreditCheckFailed branch named ProcessCreditRiskActivity mapped to a method named
ProcessCreditRisk(). Implement this method as so:
Do'stlaringiz bilan baham: |