Exemplo n.º 1
0
        public async Task <IActionResult> Delete(int id)
        {
            try {
                await _sellerService.RemoveAsync(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (IntegrityException e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message })); // redirecionando para  a pagina de erro
            }
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _sel.RemoveAsync(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (IntegrityException e)
            {
                return(RedirectToAction(nameof(Error), new { message = "O vendedor possui vendas" }));
            }
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Delete(int Id)
        {
            try
            {
                await _sellerService.RemoveAsync(Id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (IntegrityException e)
            {
                return(RedirectToAction(nameof(Error), new { Message = "Can´t to delete the seller because he/she has sales Record active" }));
            }
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _sllerservice.RemoveAsync(id);

                return(RedirectToAction(nameof(Index)));
            }
            catch (Exception e)
            {
                return(RedirectToAction(nameof(Error), new { message = e.Message }));
            }
        }