//btn New private void btnNew_Click(object sender, EventArgs e) { using (frmNewEdit frm = new frmNewEdit(null)) { if (frm.ShowDialog() == DialogResult.OK) { eventsTableBindingSource.DataSource = db.EventsTable.ToList(); } RefreshEvents(); } }
//btn Edit private void btnEdit_Click(object sender, EventArgs e) { if (eventsTableBindingSource.Current == null) { return; } using (frmNewEdit frm = new frmNewEdit(eventsTableBindingSource.Current as EventsTable)) { if (frm.ShowDialog() == DialogResult.OK) { eventsTableBindingSource.DataSource = db.EventsTable.ToList(); } RefreshEvents(); } }