/// <summary> /// 삭제하기 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDelete_Click(object sender, EventArgs e) { DialogResult result = MessageBox.Show("일련번호 '" + dataGridView1.SelectedCells[0].Value + "'의 기록을 정말로 삭제하시겠습니까?", "", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button2); if (result == DialogResult.Yes) { try { sd.DeleteSalary(dataGridView1.SelectedCells[0].Value.ToString()); MessageBox.Show("삭제 성공"); } catch (Exception) { MessageBox.Show("삭제 실패"); } } else { MessageBox.Show("취소되었습니다"); } Salary_Load(null, null); }
public static void DeleteSalary(int salaryID) { SalaryDAO.DeleteSalary(salaryID); }