Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Grade grade = gradeService.Get(id);

            gradeService.Delete(grade);
            return(RedirectToAction("Index"));
        }
Пример #2
0
        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 }));
        }
Пример #3
0
        public virtual ActionResult Delete(int id)
        {
            var result = _gradeService.Delete(id);

            if (result)
            {
                return(Ok());
            }
            return(NotFound());
        }
Пример #4
0
        public IActionResult DeleteCar(int id)
        {
            var result = _gradeService.Delete(id);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Пример #5
0
        public async Task <IActionResult> DeleteGrade(Guid id)
        {
            var grade = await gradeService.FindById(id);

            if (grade == null)
            {
                return(NotFound());
            }

            await gradeService.Delete(id);

            return(NoContent());
        }
Пример #6
0
 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 }));
     }
 }
Пример #7
0
        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 }));
            }
        }
Пример #8
0
        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));
            }
        }
Пример #9
0
 public IActionResult Delete(int id)
 {
     _gradeService.Delete(id);
     return(Ok());
 }