private void btnAdd_Click(object sender, EventArgs e) { ManageTaskForm addTaskForm = new ManageTaskForm(); addTaskForm.ShowDialog(); PrepareTasksData(); }
private void btnEdit_Click(object sender, EventArgs e) { try { var id = (int)dgvTasks.CurrentRow.Cells[0].Value; ManageTaskForm manageTaskForm = new ManageTaskForm(db.GetTaskModel(id)); manageTaskForm.ShowDialog(); PrepareTasksData(); } catch (Exception err) { MessageBox.Show($"Błąd podczas edycji.\n" + $"{err.Message}", "Błąd"); } }