예제 #1
0
        public async Task <ActionResult> Delete(Guid id)
        {
            var aula = await _aulaRepository.GetByIdNoTracking(id);

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

            await _aulaService.Delete(id);

            return(CustomResponse());
        }
예제 #2
0
        public IActionResult DeleteAula(long id)
        {
            if (_aulaService.Delete(id))
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                TempData.Put("Aula", _aulaService.Get(id));

                return(RedirectToAction("Delete", id));
            }
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        public IActionResult DeleteAula(long id)
        {
            _aulaService.Delete(id);

            return(RedirectToAction("Index"));
        }
예제 #5
0
 public IActionResult Delete(int id)
 {
     return(Ok(
                _aulaService.Delete(id)
                ));
 }