static void Main(string[] args) { Facade facade = new Facade(); Customer customer = new Customer("Nelson Rodrigues"); bool eligible = facade.IsEligible(customer, 125000); Console.WriteLine("\n" + customer.Name + " has been " + (eligible ? " Approved" : " Rejected")); }
public bool IsEligible(Customer cust, int amout) { Console.WriteLine(" {0} applies for {1:C} loan\n", cust.Name, amout ); bool eligible = true; if (!_bank.HasSufficientSavings(cust, amout)) { eligible = false; } else if (!_Loan.HasNoBadLoans(cust)) { eligible = false; } else if (!_credit.HasGoodCredit(cust)) { eligible = false; } return eligible; }
public bool HasGoodCredit(Customer c) { Console.WriteLine("Check credit for " + c.Name); return true; }
public bool HasNoBadLoans(Customer c) { Console.WriteLine("Check loans for " + c.Name); return true; }
public bool HasSufficientSavings(Customer c, int amount) { Console.WriteLine("Check bank for " + c.Name); return true; }