public JsonResult Delete(string staffCode) { StaffDao staffDao = new StaffDao(); var result = Json(staffDao.Delete(staffCode)); return(result); }
public ActionResult Delete(int id) { StaffDao dao = new StaffDao(); staff exists_sta = dao.GetById(id); var image_old = Path.Combine(Server.MapPath("~/Areas/Admins/Content/Photo/Staff/"), System.IO.Path.GetFileName(exists_sta.sta_image)); if (System.IO.File.Exists(image_old)) { System.IO.File.Delete(image_old); } dao.Delete(id); return(RedirectToAction("Index")); }