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);
 }
예제 #2
0
        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));
        }
예제 #4
0
        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!" }));
        }
예제 #5
0
 //[TeacherAuthorization]
 public IHttpActionResult DeleteGrade([FromUri] int id, [FromUri] int id2, [FromUri] int id3)
 {
     graderepo.Delete(id3);
     return(StatusCode(HttpStatusCode.NoContent));
 }