예제 #1
0
        private void MapOutput_BorrowerInformation(BorrowerAndLoanInformation obj)
        {
            if (inYears.IsChecked == true || inMonths.IsChecked == true)
            {
                if (inYears.IsChecked == true)
                {
                    loanTermOutput.Content = "in years";
                }
                else if (inMonths.IsChecked == true)
                {
                    loanTermOutput.Content = "in months";
                }
            }
            else
            {
                loanTermOutput.Content = "'In years' or 'In months' not selected";
            }

            dateIssued.Content            = obj.Date;
            applicantNameOutput.Content   = obj.ApplicantName;
            applicantStreetOutput.Content = obj.ApplicantStreetAddress;
            applicantCityOutput.Content   = obj.ApplicantStreetAddress;
            propertyStreetOutput.Content  = obj.PbmStreetAddress;
            propertyCityOutput.Content    = obj.PbmCityStateZip;
            salePriceOutput.Content       = obj.SalePrice;
            purposeOutput.Content         = obj.Purpose;
            loanIDOutput.Content          = obj.LoanID;
            //estimatedTax_Insurance.Content = obj.EstimatedTaxesAndInsurance;
            loanAmountOutput.Content       = obj.LoanAmount;
            interestRateOutput.Content     = obj.InterestRate;
            monthlyPrincipleOutput.Content = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate), Convert.ToInt32(obj.LoanTerm));
        }
예제 #2
0
 private void MapOuput_AIRTable(BorrowerAndLoanInformation obj1)
 {
     indexMarginOutput.Content     = Convert.ToDouble(obj1.Margin) + "%";
     initialRateOutput.Content     = Convert.ToDouble(obj1.InterestRate) + "%";
     minInterestRateOutput.Content = Convert.ToDouble(obj1.InterestRate) + "%";
     maxInterestRateOutput.Content = Convert.ToDouble(obj1.InterestRate) + 6 + "%";
 }
예제 #3
0
 private void MapOutput_ProjectedPayments(BorrowerAndLoanInformation obj)
 {
     minYearOne.Content    = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate), Convert.ToInt32(obj.LoanTerm));
     minYearSix.Content    = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate), Convert.ToInt32(obj.LoanTerm));
     minYearEleven.Content = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate), Convert.ToInt32(obj.LoanTerm));
     minYearEnd.Content    = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate), Convert.ToInt32(obj.LoanTerm));
     maxYearSix.Content    = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate + 2), Convert.ToInt32(obj.LoanTerm));
     maxYearEleven.Content = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate + 4), Convert.ToInt32(obj.LoanTerm));
     maxYearEnd.Content    = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate + 6), Convert.ToInt32(obj.LoanTerm));
 }
예제 #4
0
        private void MapOutput_loanSchedule(BorrowerAndLoanInformation obj)
        {
            int     periods, loanTerm, num_pay = 12;
            decimal balance, rate;
            var     date = obj.Date2;

            int.TryParse(obj.LoanTerm, out loanTerm);
            decimal.TryParse(obj.LoanAmount, out balance);
            decimal.TryParse(obj.InterestRate, out rate);


            periods = loanTerm * num_pay;

            var loan = new LoanSchedule(balance, periods, rate, date, 12 / num_pay) as LoanSchedule;

            loanGrid.ItemsSource = loan.list;
        }
예제 #5
0
        public static ValidationDetail ValidateLoanInformation(BorrowerAndLoanInformation input)
        {
            ValidationDetail result = new ValidationDetail();

            result.ErrorMessages = new List <string>();

            if (string.IsNullOrEmpty(input.Date))
            {
                result.IsValid = false;
                result.ErrorMessages.Add("Date is empty");
            }

            if (string.IsNullOrWhiteSpace(input.ApplicantName))
            {
                result.IsValid = false;
                result.ErrorMessages.Add("Applicant Name was not entered.");
            }

            if (string.IsNullOrWhiteSpace(input.ApplicantStreetAddress))
            {
                result.IsValid = false;
                result.ErrorMessages.Add("Applicant Street Address was not entered.");
            }

            if (string.IsNullOrWhiteSpace(input.ApplicantCityStateZip))
            {
                result.IsValid = false;
                result.ErrorMessages.Add("Applicant City, State, Zip was not entered");
            }

            if (string.IsNullOrWhiteSpace(input.PbmStreetAddress))
            {
                result.IsValid = false;
                result.ErrorMessages.Add("Property Being Mortgaged - Street Address was not entered.");
            }

            if (string.IsNullOrWhiteSpace(input.SalePrice))
            {
                result.IsValid = false;
                result.ErrorMessages.Add("Sale Price was not entered.");
            }



            return(result);
        }
예제 #6
0
        private void Submit_Click(object sender, RoutedEventArgs e)
        {
            Output.IsSelected = true;

            try
            {
                BorrowerAndLoanInformation borrowData  = MapInput_BorrowerInformation();
                ClosingCostInformation     closingData = MapInput_ClosingInformation();
                ValidationDetail           validation  = ValidationService.ValidateLoanInformation(borrowData);
                MapOutput_BorrowerInformation(borrowData);
                MapOutput_loanSchedule(borrowData);
                MapOutput_LoanCosts(closingData);
                MapOutput_ProjectedPayments(borrowData);
            }
            catch (Exception ex)
            {
                var message = ex.Message;
                MessageBox.Show(message, "Error");
            }
        }
예제 #7
0
        private void MapOutput_BorrowerInformation(BorrowerAndLoanInformation obj)
        {
            if (inYears.IsChecked == true || inMonths.IsChecked == true)
            {
                if (inYears.IsChecked == true)
                {
                    loanTermOutput.Content = loanTerm.Text + " years";
                }
                else if (inMonths.IsChecked == true)
                {
                    loanTermOutput.Content = loanTerm.Text + " months";
                }
            }
            else
            {
                loanTermOutput.Content = "'In years' or 'In months' not selected";
            }

            dateIssued.Content            = obj.Date;
            applicantNameOutput.Content   = obj.ApplicantName;
            applicantStreetOutput.Content = obj.ApplicantStreetAddress;
            applicantCityOutput.Content   = obj.ApplicantStreetAddress;
            propertyStreetOutput.Content  = obj.PbmStreetAddress;
            propertyCityOutput.Content    = obj.PbmCityStateZip;
            salePriceOutput.Content       = obj.SalePrice;
            purposeOutput.Content         = obj.Purpose;
            loanIDOutput.Content          = obj.LoanID;
            loanIDOutput2.Content         = obj.LoanID;
            DateTime date2 = date.SelectedDate ?? DateTime.Now;

            rateLockDateOutput.Content = date2.AddDays(45);
            expireDateOutput.Content   = date2.AddDays(15);
            //estimatedTax_Insurance.Content = obj.EstimatedTaxesAndInsurance;
            loanAmountOutput.Content       = obj.LoanAmount;
            interestRateOutput.Content     = obj.InterestRate;
            monthlyPrincipleOutput.Content = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate), Convert.ToInt32(obj.LoanTerm));
            loanTermsMax.Content           = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate + 6), Convert.ToInt32(obj.LoanTerm));
            maxInterest.Content            = Convert.ToDouble(obj.InterestRate) + 6 + "%";
        }
예제 #8
0
 private void MapOutput_APTable(BorrowerAndLoanInformation obj)
 {
     firstChange.Content = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate + 2), Convert.ToInt32(obj.LoanTerm));
     maxPayment.Content  = PaymentCalculation(Convert.ToDouble(obj.LoanAmount), Convert.ToDouble(obj.InterestRate + 6), Convert.ToInt32(obj.LoanTerm));
 }