private void CustomerInfoToolStripMenuItem_Click(object sender, EventArgs e) { Customer selectedCustomer = usersGridView.SelectedRows[0].DataBoundItem as Customer; if (selectedCustomer != null) { var customerInfoForm = new CustomerInfoFormAdmin(selectedCustomer, bank); DialogResult res = customerInfoForm.ShowDialog(); if (res == DialogResult.OK) { isDirty = true; } CustomersBindingSource.ResetBindings(false); } }
private void DeleteToolStripMenuItem_Click(object sender, EventArgs e) { Customer toDelete = usersGridView.SelectedRows[0].DataBoundItem as Customer; if (toDelete != null) { DialogResult res = MessageBox.Show( $"Удалить {toDelete.Login}?", "Подтверждение", MessageBoxButtons.OKCancel ); if (res == DialogResult.OK) { bank.Customers.Remove(toDelete); CustomersBindingSource.ResetBindings(false); isDirty = true; } } }
private void LoadToolStripMenuItem_Click(object sender, EventArgs e) { bank.Load(); CustomersBindingSource.ResetBindings(false); }