private void buttonDeleteJob_Click(object sender, EventArgs e) { var Result = MessageBox.Show("Etes-vous sûr de vouloir supprimer le job n°" + jobRow.job_id + "?", "Veuillez confirmer:", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (Result == DialogResult.OK) { EntrepriseManager.DeleteJob(jobRow.job_id); refreshDataGrid(); } }
private void buttonDeleteJob_Click(object sender, EventArgs e) { if (dataGridViewListingJob.SelectedRows.Count == 1) { int value; Int32.TryParse(dataGridViewListingJob.SelectedCells[0].Value.ToString(), out value); var Result = MessageBox.Show("Etes-vous sûr de vouloir supprimer le job n°" + value.ToString() + "?", "Veuillez confirmer:", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (Result == DialogResult.OK) { EntrepriseManager.DeleteJob(value); PopulateAndBind(); } } }