private void deleteGrade() { try { if (!txtGradeId.Text.Trim().Equals(string.Empty)) { DialogResult dialogResult = MessageBox.Show("Are you sure you want to delete?", "Warning", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { if (oGradeBL.DeleteGrade(Convert.ToInt32(txtGradeId.Text), cmbSubject.SelectedValue.ToString())) { ClearControls(); filterBySubjectId(); MessageBox.Show("Record deleted successfully.!"); } } } else { txtGradeId.Focus(); } } catch (Exception ex) { throw ex; } }
public ActionResult DeleteGrade(int ID) { GradeBL gradeBl = new GradeBL(); int recordaffected = gradeBl.DeleteGrade(ID); return(Json(recordaffected, JsonRequestBehavior.AllowGet)); }