Example #1
0
        public NotificationResult Salvar(FichaIdioma entidade)
        {
            var NotificationResult = new NotificationResult();

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

                    if (NotificationResult.IsValid)
                    {
                        _fichaIdiomaRepositorio.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)));
            }
        }
Example #2
0
        public NotificationResult Excluir(FichaIdioma entidade)
        {
            var NotificationResult = new NotificationResult();

            try
            {
                if (entidade.CodFicha != 0 && entidade.CodJogador != 0 && entidade.CodIdioma != 0)
                {
                    if (NotificationResult.IsValid)
                    {
                        _fichaIdiomaRepositorio.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)));
            }
        }
Example #3
0
        public NotificationResult Atualizar(FichaIdioma entidade)
        {
            var NotificationResult = new NotificationResult();

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

                if (NotificationResult.IsValid)
                {
                    _fichaIdiomaRepositorio.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)));
            }
        }
Example #4
0
 public NotificationResult Atualizar(FichaIdioma entidade)
 {
     return(_fichaIdiomaServico.Atualizar(entidade));
 }
Example #5
0
 public NotificationResult Excluir(FichaIdioma entidade)
 {
     return(_fichaIdiomaServico.Excluir(entidade));
 }
Example #6
0
 public NotificationResult Salvar(FichaIdioma entidade)
 {
     return(_fichaIdiomaServico.Salvar(entidade));
 }
 public NotificationResult Salvar(FichaIdioma entidade)
 {
     throw new NotImplementedException();
 }