コード例 #1
0
 private void btnFind_Click(object sender, EventArgs e)
 {
     try
     {
         var accountId = int.Parse(txtId.Text);
         _currentAccount = _manager.Lookup(accountId);
         lblFullName.Text = string.Format("Account {0}:  {1}, {2}", _currentAccount.Id, _currentAccount.LastName,
             _currentAccount.FirstName);
         UpdateBalance();
         grpTransaction.Enabled = true;
     }
     catch (FormatException)
     {
         MessageBox.Show("Enter a Number, Please.");
     }
     catch (NoSuchAccountException)
     {
         MessageBox.Show("No Such Account");
     }
     finally
     {
         txtId.SelectAll();
         txtId.Focus();
     }
 }
コード例 #2
0
 public void Update(Account account)
 {
     _context.SaveChanges();
 }