Exemple #1
0
        private void CreateBabyAccount()
        {
            string      name       = Validation.ValidateName("\nWhat would you like the name on the account to be?");
            decimal     balance    = Validation.ValidateDecimal("How much money would you like initially deposited into the account?", 0, 10000);
            string      parentName = Validation.ValidateName("What would you like the parent name on the account to be?");
            BabyAccount newAccount = new BabyAccount(name, balance, parentName);

            Console.WriteLine("\nAccount summary: \n" + newAccount.ToString());
            ourBank.StoreAccount(newAccount);
        }
Exemple #2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if (radNorm.Checked == true)
            {
                Account check = new Account();
                check.obalance = Convert.ToDecimal(txtBalance.Text);
                check.amount   = Convert.ToDecimal(txtDeWith.Text);
                check.Calc(check.dewith, check.amount);

                if (radDeposit.Checked == true)
                {
                    check.dewith = true;
                }
                else
                {
                    check.dewith = false;
                }

                check.baby  = false;
                lblOut.Text = check.ToString();
            }
            else
            {
                BabyAccount baby = new BabyAccount();
                baby.obalance = Convert.ToDecimal(txtBalance.Text);
                baby.amount   = Convert.ToDecimal(txtDeWith.Text);
                baby.Calc(baby.dewith, baby.amount);

                if (radDeposit.Checked == true)
                {
                    baby.dewith = true;
                }
                else
                {
                    baby.dewith = false;
                }
                baby.baby   = true;
                lblOut.Text = baby.ToString();
            }
        }