Example #1
0
 public void CriarTexto(string conteudo, TipoTexto tipo, int idPost)
 {
     using (var db = CriarConexao())
     {
         db.Execute(string.Format(INSERIR_TEXTO, (int)tipo, idPost, conteudo));
     }
 }
Example #2
0
        private void CriarTexto(string conteudo, TipoTexto tipo, int idPost)
        {
            if (String.IsNullOrEmpty(conteudo))
            {
                if (tipo == TipoTexto.Conteudo)
                {
                    throw new ErroConteudoVazioException("O conteudo não pode estar vazio");
                }

                throw new ErroConteudoVazioException("O link não pode estar vazio");
            }

            _textoRepository.CriarTexto(conteudo, tipo, idPost);
        }
Example #3
0
        private static Object tipoTexto(Dictionary <string, Object> campo)
        {
            try
            {
                TipoTexto tipoTexto = new TipoTexto();
                tipoTexto.id    = (int)campo["id"];
                tipoTexto.label = (string)campo["nombre"];
                tipoTexto.valor = campo["valor"] != null ? (string)campo["valor"] : "";

                return(tipoTexto);
            }
            catch (Exception e)
            {
                CLogger.write("2", "CFormaDinamica.class", e);
                throw;
            }
        }
 public TextBoxMayusculaMinuscula()
 {
     this.TipoDeTexto = TipoTexto.Ninguno;
 }
Example #5
0
 public void ponerTipo(TipoTexto T)
 {
     this.texto = T;
 }
Example #6
0
 private Texto ObterTexto(int idPost, TipoTexto tipo)
 {
     return(_textoRepository.ObterTextosPost(idPost)?.Where(texto => texto.Tipo == tipo).FirstOrDefault());
 }