public ActionResult Delete(int id) { var assignTask = TaskBO.AssignTaskGetById(id); if (assignTask == null) { return(RedirectToAction("NotFound", "Home")); } TaskBO.AssignTaskDelete(id); AlertBO.Delete(id, (int)AlertType.AssignTask); return(RedirectToAction("Index", new { id = assignTask.TaskId })); }