public JsonResult DeleteGrade(int gradeId) { Grade grade = new Grade(); UnitOfWork unitOfWork = new UnitOfWork(); GradeRepository gradeRepository = new GradeRepository(); grade = gradeRepository.GetById(gradeId); gradeRepository.Delete(grade); unitOfWork.Commit(); return Json("successfully deleted", JsonRequestBehavior.AllowGet); }
public ActionResult DeleteConfirmed(int id) { var grade = gradeRepository.FindById(id); if (grade != null) { gradeRepository.Delete(grade); } return(RedirectToAction("Index")); }
public JsonResult DeleteGrade(int gradeId) { Grade grade = new Grade(); UnitOfWork unitOfWork = new UnitOfWork(); GradeRepository gradeRepository = new GradeRepository(); grade = gradeRepository.GetById(gradeId); gradeRepository.Delete(grade); unitOfWork.Commit(); return(Json("successfully deleted", JsonRequestBehavior.AllowGet)); }
public async Task <IActionResult> Delete(int id) { var user = await gradeRepository.Get(id); if (user == null) { return(NotFound(new { status = ResultStatus.STATUS_NOT_FOUND, message = "Không tìm thấy khối" })); } await gradeRepository.Delete(id); return(Ok(new { status = ResultStatus.STATUS_OK, message = "Xóa thành công!" })); }
//[TeacherAuthorization] public IHttpActionResult DeleteGrade([FromUri] int id, [FromUri] int id2, [FromUri] int id3) { graderepo.Delete(id3); return(StatusCode(HttpStatusCode.NoContent)); }