public ActionResult DeleteConfirmed(int id) { Grade grade = gradeService.Get(id); gradeService.Delete(grade); return(RedirectToAction("Index")); }
public ActionResult Delete(int id, int semesterNumber) { var result = _gradeService.Delete(id, semesterNumber); if (!result.Success) { return(Error(result)); } return(RedirectToAction("Index", new { id = id })); }
public virtual ActionResult Delete(int id) { var result = _gradeService.Delete(id); if (result) { return(Ok()); } return(NotFound()); }
public IActionResult DeleteCar(int id) { var result = _gradeService.Delete(id); if (result.Success) { return(Ok(result)); } return(BadRequest(result)); }
public async Task <IActionResult> DeleteGrade(Guid id) { var grade = await gradeService.FindById(id); if (grade == null) { return(NotFound()); } await gradeService.Delete(id); return(NoContent()); }
public IActionResult Delete(int gradeId) { try { _gradeService.Delete(gradeId); return(Ok()); } catch (AppException ex) { // return error message if there was an exception return(BadRequest(new { message = ex.Message })); } }
public IActionResult Delete(Guid id) { var deleteGradeResponse = _gradeService.Delete(new DeleteGradeRequest { ID = id }); if (deleteGradeResponse.IsSuccess == true) { return(View("Index")); } else { return(RedirectToAction("Delete", new { id = id, saveChangesError = true })); } }
public async Task <IActionResult> Delete([FromRoute] int id) { try { VerifyUser(); await _service.Delete(id); return(NoContent()); } catch (Exception ex) { var error = new { statusCode = HttpStatusCode.InternalServerError, error = ex.Message }; return(StatusCode((int)HttpStatusCode.InternalServerError, error)); } }
public IActionResult Delete(int id) { _gradeService.Delete(id); return(Ok()); }