public ActionResult Delete(Int64 id) { var result = false; var file = FileService.GetFileById(id); if (file != null) { try { ActionService.Delete(file.Action.Id); result = true; } catch (Exception e) { Logger.Error(e); } } return(Content(result ? Boolean.TrueString : Boolean.FalseString)); }
public ActionResult Delete(ServiceActionViewModel model) { bool has_error = false; try { ActionService.Delete(model.Id); } catch (DomainException e) { ModelState.AddModelError("", e); has_error = true; } if (!has_error) { return(RedirectToAction("Index", new { date = model.Date.ToString("dd.MM.yyyy"), user_id = model.ExpertId })); } else { return(View()); } }
// GET: Action/Delete/5 public async Task <IActionResult> Delete(int id) { await _actionService.Delete(id); return(RedirectToAction(nameof(Index))); }