public IHttpActionResult Delete(int id) { try { StudentDBHandle sdb = new StudentDBHandle(); if (sdb.DeleteStudent(id)) { return(Ok("Student Record Deleted Successfully")); } return(NotFound()); } catch { return(BadRequest()); } }
// 4. ************* DELETE STUDENT DETAILS ****************** // GET: Student/Delete/5 public ActionResult Delete(int id) { try { StudentDBHandle sdb = new StudentDBHandle(); if (sdb.DeleteStudent(id)) { ViewBag.AlertMsg = "Student Deleted Successfully"; } return(RedirectToAction("Index")); } catch { return(View()); } }
// GET: Student/Delete/5 public ActionResult Delete(int id) { try { // TODO: Add delete logic here StudentDBHandle dBHandle = new StudentDBHandle(); if (dBHandle.DeleteStudent(id)) { ViewBag.AlertMsg = "STUDENT REMOVE SUCCESSFULLY."; } return(RedirectToAction("Index")); } catch { return(View()); } }