public bool new_loan(string CustId) { //For loop for matching customer id with list if matches then proceed if not ask them to add in customer Loan Aloan = new Loan(); bool LoanAdded = false; try { LoanList.Add(Aloan); LoanAdded = true; } catch (SystemException ex) { throw new PecuniaException(ex.Message); //pecunia xception class will be linked } switch (Aloan.Loan_type) { case "Car": { CarLoan cl = new CarLoan(); cl.carloan(cl); break; } } return(LoanAdded); }
public static List <CarLoan> employeeList = new List <CarLoan>();//doubt always same list will be appended in case we go out of class during 1 console use public bool carloan(CarLoan carloan) { bool CarAdded = false; try { // we have to write get license here ? employeeList.Add(carloan); CarAdded = true; } catch (SystemException ex) { throw new PecuniaException(ex.Message); } return(CarAdded); }