private void addAcctButton_Click(object sender, EventArgs e) { ModifyAccount new_Acct = new ModifyAccount(); if (new_Acct.ShowDialog() == DialogResult.OK) { _pm.UserAccountList.Add(new_Acct.mod_acct); addAccounts(); } else { new_Acct.Close(); } }
private void LaunchModifyWindow(UserAccount modified_account) { ModifyAccount _modify = new ModifyAccount(); _modify.PopulateAccountInfo(modified_account); UserAccount backupCopy = new UserAccount(); backupCopy = modified_account; if (_modify.ShowDialog() == DialogResult.OK) { modified_account = _modify.mod_acct; _pm.UserAccountList.Add(modified_account); addAccounts(); } else { _pm.UserAccountList.Add(backupCopy); addAccounts(); _modify.Close(); } }