Esempio n. 1
0
        public bool validate(HomeLoan home)
        {
            if (BusinessLogicUtil.validate(home.CustomerID) == false)
            {
                throw new InvalidStringException("Invalid Customer ID");
            }

            if (home.AmountApplied >= 2000001)
            {
                throw new InvalidAmountException("Maximum loan amount is Rs.20 lakh");
            }

            if (home.RepaymentPeriod >= 16)
            {
                throw new InvalidRangeException("Repayment period can be maximum of 15 years");
            }

            if (home.SalaryDeductions >= home.GrossIncome)
            {
                throw new InvalidAmountException("Salary deduction can't be greater than or equal to Gross salary");
            }

            if (home.ServiceYears < 5)
            {
                throw new InvalidRangeException("Service experience must be minimum of 5 years");
            }

            return(true);
        }
Esempio n. 2
0
        public bool validate(EduLoan edu)
        {
            if (BusinessLogicUtil.validate(edu.CustomerID) == false)
            {
                throw new InvalidStringException("Invalid Customer ID");
            }

            if (edu.AmountApplied >= 2000001)
            {
                throw new InvalidAmountException("Maximum Education loan amount is Rs.20 lakh");
            }

            if (edu.RepaymentPeriod >= 11)
            {
                throw new InvalidRangeException("Repayment period can be maximum of 10 years");
            }

            if (Regex.IsMatch(edu.InstituteName, "[a-zA-Z,]$") == false)
            {
                throw new InvalidStringException("Institute name can contains alphabets and comma(,) only");
            }

            if (Regex.IsMatch(edu.StudentID, "[a-zA-Z0-9]$") == false)
            {
                throw new InvalidStringException("Student can consists of alphabets and digits only");
            }


            return(true);
        }
Esempio n. 3
0
        public EduLoan GetLoanByLoanID_BL(string loanID)
        {
            if (BusinessLogicUtil.validate(loanID) == false)
            {
                throw new InvalidStringException("Invalid loan ID");
            }

            EduLoanDAL EduLoanDALobj = new EduLoanDAL();

            return(EduLoanDALobj.GetLoanByLoanID_DAL(loanID));
        }
Esempio n. 4
0
        public EduLoan ApproveLoanBL(string loanID, LoanStatus updatedStatus)
        {
            if (BusinessLogicUtil.validate(loanID) == false)
            {
                throw new InvalidStringException("Invalid loan ID");
            }

            EduLoanDAL EduLoanDALobj = new EduLoanDAL();

            return(EduLoanDALobj.ApproveLoanDAL(loanID, updatedStatus));
        }
Esempio n. 5
0
        public LoanStatus GetLoanStatusBL(string loanID)
        {
            if (BusinessLogicUtil.validate(loanID) == false)
            {
                throw new InvalidStringException("Invalid Loan ID");
            }

            HomeLoanDAL homeloanDALobj = new HomeLoanDAL();

            return(homeloanDALobj.GetLoanStatusDAL(loanID));
        }
Esempio n. 6
0
        public HomeLoan GetLoanByCustomerID_BL(string customerID)
        {
            if (BusinessLogicUtil.validate(customerID) == false)
            {
                throw new InvalidStringException("Invalid Customer ID");
            }

            HomeLoanDAL homeloanDALobj = new HomeLoanDAL();

            return(homeloanDALobj.GetLoanByCustomerID_DAL(customerID));
        }
Esempio n. 7
0
        public LoanStatus GetLoanStatusBL(string loanID)
        {
            if (BusinessLogicUtil.validate(loanID) == false)
            {
                throw new InvalidStringException("Invalid loan ID");
            }

            CarLoanDAL carDAL = new CarLoanDAL();

            return(carDAL.GetLoanStatusDAL(loanID));
        }
Esempio n. 8
0
        public CarLoan GetLoanByLoanID_BL(string loanID)
        {
            if (BusinessLogicUtil.validate(loanID) == false)
            {
                throw new InvalidStringException("Invalid loan ID");
            }

            CarLoanDAL CarDAL = new CarLoanDAL();

            return(CarDAL.GetLoanByLoanID_DAL(loanID));
        }
Esempio n. 9
0
        public CarLoan GetLoanByCustomerID_BL(string customerID)
        {
            if (BusinessLogicUtil.validate(customerID) == false)
            {
                throw new InvalidStringException("Invalid customer ID");
            }

            CarLoanDAL carDAL = new CarLoanDAL();

            return(carDAL.GetLoanByCustomerID_DAL(customerID));
        }
Esempio n. 10
0
        public CarLoan ApproveLoanBL(string loanID, LoanStatus updatedStatus)
        {
            if (BusinessLogicUtil.validate(loanID) == false)
            {
                throw new InvalidStringException("Invalid loan ID");
            }

            CarLoanDAL carDAL = new CarLoanDAL();

            return(carDAL.ApproveLoanDAL(loanID, updatedStatus));
        }
Esempio n. 11
0
        public bool validate(CarLoan car)
        {
            if (BusinessLogicUtil.validate(car.CustomerID) == false)
            {
                throw new InvalidStringException("Invalid Customer ID");
            }

            if (car.AmountApplied >= 2000001)
            {
                throw new InvalidAmountException("Maximum loan amount is Rs.20 lakh");
            }

            if (car.RepaymentPeriod >= 11)
            {
                throw new InvalidRangeException("Repayment period can be maximum of 10 years");
            }

            if (car.SalaryDeductions >= car.GrossIncome)
            {
                throw new InvalidAmountException("Salary deduction can't be greater than or equal to Gross salary");
            }

            return(true);
        }