Esempio n. 1
0
 public ActionResult Delete(InstructionViewModel model)
 {
     try
     {
         _service.Delete(model.ToBll());
     }
     catch (ServiceException ex)
     {
         return(Json(new { answer = ex.Message, success = false }));
     }
     return(Json(new { answer = "Instruction deleted successfully.", success = true }));
 }
        public IHttpActionResult Delete(int id)
        {
            var instructionDto = instructionService.Get(id);

            if (instructionDto == null)
            {
                try
                {
                    instructionService.Delete(id);
                }
                catch
                {
                    return(InternalServerError());
                }
                return(Ok("Item was deleted"));
            }
            return(NotFound());
        }
        public ActionResult Delete(int instructionDtoId)
        {
            instructionService.Delete(instructionDtoId);

            return(RedirectToAction("Index", "Instructions"));
        }