Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        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;
                }
            }
        }
Esempio n. 3
0
 private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
 {
     bank.Load();
     CustomersBindingSource.ResetBindings(false);
 }