예제 #1
0
        // method to check applicants eligibility for loan  
        private void CheckNewApplicantLoan()
        {
            
                try
                {
                    // decimal weeklyNetPay, decimal atb, int repaymentPeriod, string creditRating
                    Loan loan = GetLoanDetailsFromForm();
                    if (validations == true)
                    {
                        decimal atb = loan.ATB;
                        int repayPeriod = loan.RepaymentPeriod;

                        BLLLoanManager BLLMngr = new BLLLoanManager();
                        bool resultOfEligibilityCheck;
                        resultOfEligibilityCheck = BLLMngr.CheckEligibilityOfNewApp(CRN, WNP, atb, repayPeriod, CR);

                        decimal monthlyRepayment = BLLMngr.GetMontlyRepayment(atb, repayPeriod, CR);


                        if (resultOfEligibilityCheck == true)
                        {
                            //public decimal GetMontlyRepayment(decimal atb, int repaymentPeriod, string creditRating)
                            txtMonthlyRepayment.Text = monthlyRepayment.ToString();
                            MessageBox.Show("Eligible for loan");
                            btnSubmit.Enabled = false;
                            btnConfirm.Enabled = true;
                        }
                        else if (resultOfEligibilityCheck == false)
                        {
                            MessageBox.Show("Not eligible for loan");
                        }
                    }

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            
        }
예제 #2
0
        // method for checking is loan update is valid
        private void CheckLoanUpdateValidity()
        {
            bool isValid = GetUpdatedLoanDetails();
            if (isValid)
            {
                decimal atb = LoanToUpdate.ATB;
                int repaymentPeriod = LoanToUpdate.RepaymentPeriod;
                decimal weeklyNetPay = AppSeekingLoanUpdate.WeeklyNetPay;
                int crn = AppSeekingLoanUpdate.CRN;
                string creditRating = AppSeekingLoanUpdate.CreditRating;

                BLLLoanManager BLLMngr = new BLLLoanManager();
                bool resultOfEligibilityCheck;
                resultOfEligibilityCheck = BLLMngr.CheckEligibilityOfNewApp(crn, weeklyNetPay, atb, repaymentPeriod, creditRating);

                decimal monthlyRepayment = BLLMngr.GetMontlyRepayment(atb, repaymentPeriod, creditRating);

                if (resultOfEligibilityCheck == true)
                {
                    //public decimal GetMontlyRepayment(decimal atb, int repaymentPeriod, string creditRating)
                    txtMonthlyRepayment.Text = monthlyRepayment.ToString();
                    MessageBox.Show("Eligible for loan update");
                    btnSubmit.Enabled = false;
                    btnConfirm.Enabled = true;
                }
                else if (resultOfEligibilityCheck == false)
                {
                    MessageBox.Show("Not eligible for loan update");
                }
            }

        }