public JsonResult DeleteRating(int id, string ratName) { int ratId = Convert.ToInt32(id); if (ratId > 0) { var result = _ratMgr.DeleteRating(ratId); if (result.Succeeded == true) { return(Json(new { status = true, message = $" {ratName} has been successfully deleted!", JsonRequestBehavior.AllowGet })); } return(Json(new { status = false, error = result.Message }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = false, error = "Invalid Id" }, JsonRequestBehavior.AllowGet)); }
public ActionResult DeleteRating(int id, Score model) { var result = _ratMgr.GetRatingById(id); if (result == null) { return(View("not found")); } _ratMgr.DeleteRating(id); return(RedirectToAction("Index")); }