private void bt_account_edit_Click(object sender, EventArgs e) { if (dataGrid_accounts.SelectedRows.Count == 1) { var sel = dataGrid_accounts.SelectedRows[0].DataBoundItem as Accounts; AccountEdit edit = new AccountEdit(sel); edit.ShowDialog(); dataGrid_accounts.Refresh(); } else { MessageBox.Show("must select account!"); } }
private void bt_account_add_Click(object sender, EventArgs e) { DelegateServers delegateAccount = new DelegateServers(); delegateAccount.account = new Accounts(); delegateAccount.account.enableMonitor = false; delegateServers.Add(delegateAccount); BindAccounts(); AccountEdit edit = new AccountEdit(delegateAccount.account); edit.ShowDialog(); dataGrid_accounts.Refresh(); }