private void EditButton_Click(object sender, EventArgs e) { _selectedClient = ClientsDataGridView.SelectedRows[0].DataBoundItem as CLIENTS; var form = new EditForm(this, _selectedClient); form.ShowDialog(); }
public EditForm(IParent parent, CLIENTS clientToEdit) { _parent = parent; _client = clientToEdit; InitializeComponent(); NameTextBox.Text = clientToEdit.C_NAME; SurnameTextBox.Text = clientToEdit.SURNAME; PhoneNrTextBox.Text = clientToEdit.PHONE_NUMBER.ToString(); AddressTextBox.Text = clientToEdit.ADRESS; }
private void RemoveButton_Click(object sender, EventArgs e) { _selectedClient = ClientsDataGridView.SelectedRows[0].DataBoundItem as CLIENTS; DialogResult result = MessageBox.Show("Client will be permanently removed from the database.", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result == DialogResult.OK) { _db.RemoveClient(_selectedClient); LoadData(); } }
public void NewClientCreated(CLIENTS newClient) { _db.AddClient(newClient.C_NAME, newClient.SURNAME, (int)newClient.PHONE_NUMBER, newClient.ADRESS); LoadData(); }