public void Atualizar(CadastroFilmeDTO dto) { try { bd.Conectar(); string comando = "UPDATE Filmes set titulo = '" + dto.Titulo + "',genero = '" + dto.Genero + "' where id_filme =" + dto.Id; bd.ExecutarComandoSQL(comando); } catch (Exception ex) { throw new Exception("Erro ao Cadastrar Filme" + ex.Message); } finally { } }
public void Inserir(CadastroFilmeDTO dto) { try { bd.Conectar(); string comando = "INSERT INTO Filmes (titulo, genero) VALUES ('" + dto.Titulo + "' , '" + dto.Genero + "')"; bd.ExecutarComandoSQL(comando); } catch (Exception ex) { throw new Exception("Erro ao Cadastrar Filme" + ex.Message); } finally { } }