Exemplo n.º 1
0
        public bool HasSufficientSavings(Customer c, int amount)
        {
            Console.WriteLine("Check bank for" + c.Name);

            //here we can have method which check customer balance
            return true;
        }
Exemplo n.º 2
0
        private static void Main()
        {
            var morgage = new Mortgage();
            var customer = new Customer("Ivan Peshov Geshov");

            bool eligible = morgage.IsEligible(customer, 125000);
            Console.WriteLine("{0} has been {1}", customer.Name, (eligible ? "Approved" : "Rejected"));
        }
Exemplo n.º 3
0
        public bool IsEligible(Customer customer, int requestAmount)
        {
            Console.WriteLine("{0} applies for {1:C} loan \n", customer.Name, requestAmount);

            bool eligible = true;

            if (!this.bank.HasSufficientSavings(customer, requestAmount))
            {
                eligible = false;
            }
            else if (!this.loan.HasNoBadLoans(customer))
            {
                eligible = false;
            }
            else if (!this.credit.HasGoodCredit(customer))
            {
                eligible = false;
            }

            return eligible;
        }
Exemplo n.º 4
0
 public bool HasNoBadLoans(Customer customer)
 {
     Console.WriteLine("Check loans for " + customer.Name);
     return true;
 }
Exemplo n.º 5
0
 public bool HasGoodCredit(Customer c)
 {
     Console.WriteLine("Check credit for " + c.Name);
     return true;
 }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            Customer customer = new Customer("Martin");

            bool mortage = new Mortgage().IsEligible(customer, 250);

            Console.ReadKey();
        }
Exemplo n.º 7
0
        public bool IsEligible(Customer cust, int amount)
        {
            Console.WriteLine("{0} applies for {1:C} loan\n",
                cust.Name, amount);

            bool eligible = true;
            // Check creditworthyness of applicant
            if (!_bank.HasSufficientSavings(cust, amount))
            {
                eligible = false;
            }
            else if (!_loan.HasNoBadLoans(cust))
            {
                eligible = false;
            }
            else if (!_credit.HasGoodCredit(cust))
            {
                eligible = false;
            }

            return eligible;
        }
Exemplo n.º 8
0
 public bool HasSufficientSavings(Customer customer, int amout)
 {
     Console.WriteLine("Check bank for " + customer.Name);
     return true;
 }