public void Delete(Student student) { try { dal.Delete(student); } catch { throw new Exception("Delete can not complete"); } }
public ActionResult DeletePost(string id) { try { var result = _student.Delete(id); if (result == 1) { TempData["Pesan"] = $"<span class='alert alert-success'>Berhasil mendelete data nim:{id}</span><br/><br />"; return(RedirectToAction("Index")); } else { ViewBag.PesanError = $"<span class='alert alert-danger'>Gagal mendelete data student</span>"; return(View()); } } catch (Exception ex) { ViewBag.PesanError = $"<span class='alert alert-danger'>{ex.Message}</span>"; return(View()); } }
public void Delete(int id) { db.Delete(id); }
public bool Delete(student student) { return(studentDAL.Delete(student)); }