Пример #1
0
 internal int Adicionar(Categoria novaCategoria)
 {
     ComandoSQL.Parameters.Clear();
     ComandoSQL.CommandText = @"insert into categorias(cat_nome)
         values (@nome)";
     ComandoSQL.Parameters.AddWithValue("@nome", novaCategoria.Nome);
     return ExecutaComando(false);
 }
 public int Adicionar(Categoria novaCategoria)
 {
     if (novaCategoria.Nome.Trim().Length > 0)
     {
         return catBD.Adicionar(novaCategoria);
     }
     else
         return -1;
 }