public async Task <ActionResult> Delete(Guid id) { var aula = await _aulaRepository.GetByIdNoTracking(id); if (aula == null) { return(NotFound()); } await _aulaService.Delete(id); return(CustomResponse()); }
public IActionResult DeleteAula(long id) { if (_aulaService.Delete(id)) { return(RedirectToAction("Index")); } else { TempData.Put("Aula", _aulaService.Get(id)); return(RedirectToAction("Delete", id)); } }
public override void DeleteData() { AulaDTO aulaSelecionada = _control.GetAulaSelecionada(); if (aulaSelecionada == null) { MessageBox.Show("Nenhuma Aula selecionada. Selecionar uma Aula antes de solicitar a exclusão"); return; } if (MessageBox.Show("Deseja remover a Aula selecionada?", "", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) { try { _aulaService.Delete(aulaSelecionada.Id); _control.RefreshGrid(); } catch (Exception e) { MessageBox.Show(e.Message); } } }
public IActionResult DeleteAula(long id) { _aulaService.Delete(id); return(RedirectToAction("Index")); }
public IActionResult Delete(int id) { return(Ok( _aulaService.Delete(id) )); }