private static void ReadBase(XmlReader xmlIn, BasicAccount b) { b.AccountNumber = xmlIn.ReadElementContentAsInt(); b.Owner = xmlIn.ReadElementContentAsString(); b.Balance = xmlIn.ReadElementContentAsDecimal(); b.InterestRate = xmlIn.ReadElementContentAsFloat(); }
private void addAccount_button_Click(object sender, EventArgs e) { NewAccountForm accountForm = new NewAccountForm(); BasicAccount newAccount = accountForm.GetNewAccount(); if (newAccount != null) { accounts.Add(newAccount); UpdateList(); } }
private static void WriteBase(BasicAccount account, XmlWriter xmlOut) { xmlOut.WriteElementString("AccountNumber", Convert.ToString(account.AccountNumber)); xmlOut.WriteElementString("Owner", account.Owner); xmlOut.WriteElementString("Balance", Convert.ToString(account.Balance)); xmlOut.WriteElementString("InterestRate", Convert.ToString(account.InterestRate)); }
private void button_add_Click(object sender, EventArgs e) { if (IsValidData()) { if (checkBox_checkingAcc.Checked) { account = new CheckingAccount(Convert.ToInt32(textBox_accountNo.Text), textBox_owner.Text, Convert.ToDecimal(textBox_balance.Text), (float)Convert.ToDouble(textBox_interest.Text), Convert.ToDecimal(textBox_overdraft_minBalance.Text)); } else { account = new SavingsAccount(Convert.ToInt32(textBox_accountNo.Text), textBox_owner.Text, Convert.ToDecimal(textBox_balance.Text), (float)Convert.ToDouble(textBox_interest.Text), Convert.ToDecimal(textBox_overdraft_minBalance.Text)); } this.Close(); } }