Example #1
0
        public IActionResult Delete(int id)
        {
            _collaboratorRepository.Delete(id);

            TempData["MSG_S"] = Message.MSG_S002;

            return(RedirectToAction(nameof(Index)));
        }
        public IComandResult Handle(DeleteCollaboratorComand comand)
        {
            DeleteCollaboratorCommandResult comandResult = new DeleteCollaboratorCommandResult();

            try
            {
                _collaboratorRepository.Delete(comand.Id);
            }
            catch (Exception ex)
            {
                AddNotification("Erro Delete", $"Erro ao excluir o usuário. Detalhe: {ex.Message}");
            }
            return(comandResult);
        }
Example #3
0
        public IActionResult Delete(int id)
        {
            Models.Collaborator loggedInCollaborator      = collaboratorSession.GetLoggedInCollaborator();
            bool isTheLoggedInCollaboratorTheSameToDelete = loggedInCollaborator.Id == id;

            if (isTheLoggedInCollaboratorTheSameToDelete)
            {
                TempData["MSG_ERROR"] = Message.MSG_ERROR_008;
            }
            else
            {
                collaboratorRepository.Delete(id);
                TempData["MSG_OK"] = Message.MSG_OK_003;
            }

            return(RedirectToAction(nameof(Index)));
        }
Example #4
0
 public void Delete(long id)
 {
     _collaboratorRepository.Delete(id);
 }
 public void DeleteCollaborator(Guid collaboratorId)
 {
     collaboratorRepository.Delete(x => x.CollaboratorId == collaboratorId);
     SaveCollaborator();
 }
Example #6
0
 [ValidateHttpReferer]//Filtro para verificar a origem da ação
 public IActionResult Delete(int id)
 {
     _cRepo.Delete(id);
     return(RedirectToAction(nameof(Index)));
 }