示例#1
0
        public NotificationResult Salvar(PericiaFicha entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodFicha != 0 && entidade.CodJogador != 0 && entidade.CodPericia != 0)
                {
                    entidade.CodFicha   = entidade.CodFicha;
                    entidade.CodJogador = entidade.CodJogador;
                    entidade.CodPericia = entidade.CodPericia;

                    if (NotificationResult.IsValid)
                    {
                        _periciaFichaRepositorio.Adicionar(entidade);
                        NotificationResult.Add("Cadastrado!");
                    }

                    return(NotificationResult);
                }

                else
                {
                    return(NotificationResult.Add(new NotificationError("Erro no cadastro!", NotificationErrorType.USER)));
                };
            }

            catch (Exception ex)
            {
                return(NotificationResult.Add(new NotificationError(ex.Message)));
            }
        }
示例#2
0
        public NotificationResult Excluir(PericiaFicha entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodFicha != 0 && entidade.CodJogador != 0 && entidade.CodPericia != 0)
                {
                    if (NotificationResult.IsValid)
                    {
                        _periciaFichaRepositorio.Remover(entidade);
                        NotificationResult.Add("Cadastro excluido com Sucesso!");

                        return(NotificationResult);
                    }

                    else
                    {
                        return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
                    }
                }

                else
                {
                    return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
                }
            }

            catch (Exception ex)
            {
                return(NotificationResult.Add(new NotificationError(ex.Message)));
            }
        }
示例#3
0
        public NotificationResult Atualizar(PericiaFicha entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodFicha != 0 && entidade.CodJogador != 0 && entidade.CodPericia != 0)
                {
                    entidade.CodFicha = entidade.CodFicha;
                }
                entidade.CodJogador = entidade.CodJogador;
                entidade.CodPericia = entidade.CodPericia;

                if (NotificationResult.IsValid)
                {
                    _periciaFichaRepositorio.Atualizar(entidade);
                    NotificationResult.Add("Cadastro Alterado com Sucesso!");

                    return(NotificationResult);
                }

                else
                {
                    return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
                }
            }
            catch (Exception)
            {
                return(NotificationResult.Add(new NotificationError("O codigo informado não existe!", NotificationErrorType.USER)));
            }
        }
 public NotificationResult Atualizar(PericiaFicha entidade)
 {
     return(_periciaFichaServico.Atualizar(entidade));
 }
 public NotificationResult Excluir(PericiaFicha entidade)
 {
     return(_periciaFichaServico.Excluir(entidade));
 }
 public NotificationResult Salvar(PericiaFicha entidade)
 {
     return(_periciaFichaServico.Salvar(entidade));
 }