public bool removeProject(Project project) { try { DBBroker broker = new DBBroker(); return(broker.removeProject(project)); } catch (Exception) { throw; } }
private void btnDeleteProject_Click(object sender, EventArgs e) { DialogResult dialogResult = MessageBox.Show("Do you want to delete that project", "Delete project", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Project project = (Project)dvgProjects.SelectedRows[0].DataBoundItem; bool pass = broker.removeProject(project); if (pass) { MessageBox.Show("Project deleted successfully"); } else { MessageBox.Show("System can't delete project"); } refreshAdmin(); } else if (dialogResult == DialogResult.No) { return; } }