Ejemplo n.º 1
0
        public void Delete(Student student)
        {
            try
            {
                dal.Delete(student);
            }

            catch
            {
                throw new Exception("Delete can not complete");
            }
        }
Ejemplo n.º 2
0
 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());
     }
 }
Ejemplo n.º 3
0
 public void Delete(int id)
 {
     db.Delete(id);
 }
Ejemplo n.º 4
0
 public bool Delete(student student)
 {
     return(studentDAL.Delete(student));
 }