Example #1
0
        private void buttonSubmit_Click(object sender, EventArgs e)
        {
            if (textBoxAccountNumber.Text != null && comboBoxLoanType.Text != null && textBoxInterest.Text != null && textBoxPrincipal.Text != null && textBoxSocialSecurity.Text != null && textBoxCreditScore.Text != null)
            {
                decimal dec_out, dec_out_2;
                if ((new Regex(@"^\d+$").Match(textBoxAccountNumber.Text).Success) && Decimal.TryParse(textBoxInterest.Text, out dec_out) && Decimal.TryParse(textBoxPrincipal.Text, out dec_out_2) && (new Regex(@"^\d+$").Match(textBoxSocialSecurity.Text).Success) && (new Regex(@"^\d+$").Match(textBoxCreditScore.Text).Success))
                {
                    databaseService.AddLoanApplication(new LoanApplicationVO(-1, Convert.ToInt32(textBoxAccountNumber.Text), -1, Convert.ToDouble(textBoxPrincipal.Text), comboBoxLoanType.Text, Convert.ToInt32(textBoxInterest.Text), textBoxSocialSecurity.Text, Convert.ToInt32(textBoxCreditScore.Text), null));

                    WindowManager.navigateToForm(this, this.GetType(), typeof(Homescreen));
                }
            }
            else
            {
                MessageBox.Show("Invalid Loan Info Provided.");
            }
        }