Beispiel #1
0
        public List <Troca> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_TROCA, ID_USUARIO_SOLICITANTE, ID_USUARIO_DETENTOR, DATA_INCLUSAO, DATA_SITUACAO,"
                                                             + "SITUACAO, POSICAO_SOLICITANTE, POSICAO_DETENTOR FROM TROCA", conn))
                {
                    List <Troca> lista = new List <Troca>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Troca t = new Troca();
                        t.Id_Troca = Convert.ToInt32(reader["ID_TROCA"]);
                        t.Id_Usuario_Solicitante = Convert.ToInt32(reader["ID_USUARIO_SOLICITANTE"]);
                        t.Id_Usuario_Detentor    = Convert.ToInt32(reader["ID_USUARIO_DETENTOR"]);
                        t.Data_Inclusao          = Convert.ToDateTime(reader["DATA_INCLUSAO"]);
                        t.Data_Situacao          = Convert.ToDateTime(reader["DATA_SITUACAO"]);
                        t.Situacao            = Convert.ToInt32(reader["SITUACAO"]);
                        t.Posicao_Solicitante = Convert.ToInt32(reader["POSICAO_SOLICITANTE"]);
                        t.Posicao_Detentor    = Convert.ToInt32(reader["POSICAO_DETENTOR"]);
                        lista.Add(t);
                    }
                    return(lista);
                }
            }
        }
Beispiel #2
0
        public List <Usuario> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_USUARIO, NOME, SENHA, DATA_NASCIMENTO, EMAIL, FOTO, FACEBOOK FROM USUARIO", conn))
                {
                    List <Usuario> lista = new List <Usuario>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Usuario u = new Usuario();
                        u.Id_Usuario     = Convert.ToInt32(reader["ID_USUARIO"]);
                        u.Nome           = Convert.ToString(reader["NOME"]);
                        u.Senha          = Convert.ToString(reader["SENHA"]);
                        u.DataNascimento = Convert.ToDateTime(reader["DATA_NASCIMENTO"]);
                        u.Email          = Convert.ToString(reader["EMAIL"]);
                        u.Foto           = Convert.ToString(reader["FOTO"]);
                        u.Facebook       = Convert.ToString(reader["FACEBOOK"]);
                        lista.Add(u);
                    }
                    return(lista);
                }
            }
        }
Beispiel #3
0
        public List <Produto> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_PRODUTO, ID_USUARIO, ID_ROTULO, DESCRICAO, DATA_INCLUSAO, SITUACAO, DATA_SITUACAO,"
                                                             + "FL_ROUPA, DEFAULT_IMAGEM FROM PRODUTO", conn))
                {
                    List <Produto> lista = new List <Produto>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Produto p = new Produto();
                        p.Id_Produto    = Convert.ToInt32(reader["ID_PRODUTO"]);
                        p.Id_Usuario    = Convert.ToInt32(reader["ID_USUARIO"]);
                        p.Id_Rotulo     = Convert.ToInt32(reader["ID_ROTULO"]);
                        p.Descricao     = Convert.ToString(reader["DESCRICAO"]);
                        p.Data_Inclusao = Convert.ToDateTime(reader["DATA_INCLUSAO"]);
                        p.Situacao      = Convert.ToInt32(reader["SITUACAO"]);
                        p.Data_Situacao = Convert.ToDateTime(reader["DATA_SITUACAO"]);
                        p.Fl_Roupa      = Convert.ToChar(reader["FL_ROUPA"]);
                        p.Imagem        = Convert.ToString(reader["IMAGEM"]);
                        lista.Add(p);
                    }
                    return(lista);
                }
            }
        }
Beispiel #4
0
        public List <Desejo> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_USUARIO, ID_ROTULO, ID_FABRICANTE, ID_CATEGORIA, ID_DESEJO FROM DESEJO", conn))
                {
                    List <Desejo> lista = new List <Desejo>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Desejo d = new Desejo();
                        d.Id_Desejo     = Convert.ToInt32(reader["ID_DESEJO"]);
                        d.Id_Usuario    = Convert.ToInt32(reader["ID_USUARIO"]);
                        d.Id_Rotulo     = Convert.ToInt32(reader["ID_ROTULO"]);
                        d.Id_Fabricante = Convert.ToInt32(reader["ID_FABRICANTE"]);
                        lista.Add(d);
                    }
                    return(lista);
                }
            }
        }
Beispiel #5
0
        public List <Categoria> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT C.ID_CATEGORIA, C.NOME, C.ID_CATEGORIA_MAE, CMAE.NOME FROM CATEGORIA C"
                                                             + "JOIN CATEGORIA CMAE ON C.ID_CATEGORIA = CMAE.ID_CATEGORIA", conn))
                {
                    List <Categoria> lista = new List <Categoria>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Categoria c = new Categoria();
                        c.Id_Categoria     = Convert.ToInt32(reader["ID_CATEGORIA"]);
                        c.Nome             = Convert.ToString(reader["NOME"]);
                        c.Id_Categoria_Mae = Convert.ToInt32(reader["ID_CATEGORIA_MAE"]);
                        //c.NomeMae = Convert.ToString(reader["NOME"]); ?
                        lista.Add(c);
                    }
                    return(lista);
                }
            }
        }
Beispiel #6
0
        public List <Rotulo> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_ROTULO, ID_FABRICANTE, ID_CATEGORIA, NOME, FL_TIPO_ROTULO FROM ROTULO", conn))
                {
                    List <Rotulo> lista = new List <Rotulo>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Rotulo r = new Rotulo();
                        r.Id_Rotulo      = Convert.ToInt32(reader["ID_ROTULO"]);
                        r.Id_Fabricante  = Convert.ToInt32(reader["ID_FABRICANTE"]);
                        r.Id_Categoria   = Convert.ToInt32(reader["ID_CATEGORIA"]);
                        r.Nome           = Convert.ToString(reader["NOME"]);
                        r.Fl_Tipo_Rotulo = Convert.ToChar(reader["FL_TIPO_ROTULO"]);
                        lista.Add(r);
                    }
                    return(lista);
                }
            }
        }
Beispiel #7
0
        public List <Jogo> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_JOGO, NOME FROM JOGO", conn))
                {
                    List <Jogo> lista = new List <Jogo>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Jogo j = new Jogo();

                        j.Id_Rotulo     = Convert.ToInt32(reader["ID_ROTULO"]);
                        j.Marca         = Convert.ToString(reader["MARCA"]);
                        j.Recursos      = Convert.ToString(reader["RECURSOS"]);
                        j.Faixa_Etaria  = Convert.ToString(reader["FAIXA_ETARIA"]);
                        j.Id_Plataforma = Convert.ToInt32(reader["ID_PLATAFORMA"]);
                        j.Id_Genero     = Convert.ToInt32(reader["ID_GENERO"]);
                        lista.Add(j);
                    }
                    return(lista);
                }
            }
        }
Beispiel #8
0
        public void Upd(Produto u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("PRODUTO_tapi.upd", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_PRODUTO", u.Id_Produto);
                    cmd.Parameters.Add("p_ID_USUARIO", u.Id_Usuario);
                    cmd.Parameters.Add("p_ID_ROTULO", u.Id_Rotulo);
                    cmd.Parameters.Add("p_DESCRICAO", u.Descricao);
                    cmd.Parameters.Add("p_DATA_INCLUSAO", u.Data_Inclusao);
                    cmd.Parameters.Add("p_SITUACAO", u.Situacao);
                    cmd.Parameters.Add("p_DATA_SITUACAO", u.Data_Situacao);
                    cmd.Parameters.Add("p_FL_ROUPA", u.Fl_Roupa);
                    cmd.Parameters.Add("p_IMAGEM", u.Imagem);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #9
0
        public void Ins(Usuario u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando

                //using (OracleCommand cmd = new OracleCommand("USUARIO_tapi.ins", conn))
                using (OracleCommand cmd = new OracleCommand("INSERT INTO USUARIO VALUES (p_ID_USUARIO, p_NOME, p_SENHA, p_DATA_NASCIMENTO, p_EMAIL, p_FOTO, p_FACEBOOK)", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_USUARIO", u.Id_Usuario);
                    cmd.Parameters.Add("p_NOME", u.Nome);
                    cmd.Parameters.Add("p_SENHA", u.Senha);
                    cmd.Parameters.Add("p_DATA_NASCIMENTO", u.DataNascimento);
                    cmd.Parameters.Add("p_EMAIL", u.Email);
                    cmd.Parameters.Add("p_FOTO", u.Foto);
                    cmd.Parameters.Add("p_FACEBOOK", u.Facebook);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #10
0
        public void Upd(Troca u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("TROCA_tapi.upd", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_TROCA", u.Id_Troca);
                    cmd.Parameters.Add("p_ID_USUARIO_SOLICITANTE", u.Id_Usuario_Solicitante);
                    cmd.Parameters.Add("p_ID_USUARIO_DETENTOR", u.Id_Usuario_Detentor);
                    cmd.Parameters.Add("p_DATA_INCLUSAO", u.Data_Inclusao);
                    cmd.Parameters.Add("p_DATA_SITUACAO", u.Data_Situacao);
                    cmd.Parameters.Add("p_SITUACAO", u.Situacao);
                    cmd.Parameters.Add("p_POSICAO_SOLICITANTE", u.Posicao_Solicitante);
                    cmd.Parameters.Add("p_POSICAO_DETENTOR", u.Posicao_Detentor);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #11
0
        public void Upd(Jogo u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("JOGO_tapi.upd", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_ROTULO", u.Id_Rotulo);
                    cmd.Parameters.Add("p_MARCA", u.Marca);
                    cmd.Parameters.Add("p_RECURSOS", u.Recursos);
                    cmd.Parameters.Add("p_FAIXA_ETARIA", u.Faixa_Etaria);
                    cmd.Parameters.Add("p_ID_PLATAFORMA", u.Id_Plataforma);
                    cmd.Parameters.Add("p_ID_GENERO", u.Id_Genero);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (SqlException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #12
0
        public void Upd(Rotulo u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("ROTULO_tapi.upd", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_ROTULO", u.Id_Rotulo);
                    cmd.Parameters.Add("p_ID_FABRICANTE", u.Id_Fabricante);
                    cmd.Parameters.Add("p_ID_CATEGORIA", u.Id_Categoria);
                    cmd.Parameters.Add("p_NOME", u.Nome);
                    cmd.Parameters.Add("p_FL_TIPO_ROTULO", u.Fl_Tipo_Rotulo);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #13
0
        public void Upd(Desejo u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("DESEJO_tapi.upd", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_DESEJO", u.Id_Desejo);
                    cmd.Parameters.Add("p_ID_USUARIO", u.Id_Usuario);
                    cmd.Parameters.Add("p_ID_ROTULO", u.Id_Rotulo);
                    cmd.Parameters.Add("p_ID_FABRICANTE", u.Id_Fabricante);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (SqlException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #14
0
        public void Ins(Categoria u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("CATEGORIA_tapi.ins", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_CATEGORIA", u.Id_Categoria);
                    cmd.Parameters.Add("p_ID_CATEGORIA_MAE", u.Id_Categoria_Mae);
                    cmd.Parameters.Add("p_NOME", u.Nome);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #15
0
        public void Upd(Editora u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("EDITORA_tapi.upd", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_EDITORA", u.Id_Editora);
                    cmd.Parameters.Add("p_NOME", u.Nome);

                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (SqlException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #16
0
        public void Del(Fabricante u)
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("FABRICANTE_tapi.del", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    //Define parametros
                    cmd.Parameters.Add("p_ID_FABRICANTE", u.Id_Fabricante);


                    //Executa
                    try
                    {
                        conn.Open();
                        cmd.ExecuteNonQuery();
                    }
                    catch (OracleException ex)
                    {
                        throw new Exception("Ocorreu o erro(BD): " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        throw new Exception("Erro: " + ex.Message);
                    }
                    finally
                    {
                        if (conn.State == ConnectionState.Open)
                        {
                            conn.Close();
                        }
                    }
                }
            }
        }
Beispiel #17
0
        public List <Assunto> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_ASSUNTO, NOME FROM ASSUNTO", conn))
                {
                    List <Assunto> lista = new List <Assunto>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Assunto a = new Assunto();
                        a.Id_Assunto = Convert.ToInt32(reader["ID_ASSUNTO"]);
                        a.Nome       = Convert.ToString(reader["NOME"]);
                        lista.Add(a);
                    }
                    return(lista);
                }
            }
        }
Beispiel #18
0
        public List <Plataforma> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_PLATAFORMA, NOME FROM PLATAFORMA", conn))
                {
                    List <Plataforma> lista = new List <Plataforma>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Plataforma p = new Plataforma();
                        p.Id_Plataforma = Convert.ToInt32(reader["ID_PLATAFORMA"]);
                        p.Nome          = Convert.ToString(reader["NOME"]);
                        lista.Add(p);
                    }
                    return(lista);
                }
            }
        }
Beispiel #19
0
        public List <Editora> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_EDITORA, NOME FROM EDITORA", conn))
                {
                    List <Editora> lista = new List <Editora>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Editora e = new Editora();
                        e.Id_Editora = Convert.ToInt32(reader["ID_EDITORA"]);
                        e.Nome       = Convert.ToString(reader["NOME"]);
                        lista.Add(e);
                    }
                    return(lista);
                }
            }
        }
Beispiel #20
0
        public List <Idioma> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_IDIOMA, NOME FROM IDIOMA", conn))
                {
                    List <Idioma> lista = new List <Idioma>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Idioma i = new Idioma();
                        i.Id_Idioma = Convert.ToInt32(reader["ID_IDIOMA"]);
                        i.Nome      = Convert.ToString(reader["NOME"]);
                        lista.Add(i);
                    }
                    return(lista);
                }
            }
        }
Beispiel #21
0
        public List <Fabricante> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_FABRICANTE, NOME FROM FABRICANTE", conn))
                {
                    List <Fabricante> lista = new List <Fabricante>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Fabricante f = new Fabricante();
                        f.Id_Fabricante = Convert.ToInt32(reader["ID_FABRICANTE"]);
                        f.Nome          = Convert.ToString(reader["NOME"]);
                        lista.Add(f);
                    }
                    return(lista);
                }
            }
        }
Beispiel #22
0
        public List <Genero> Get()
        {
            using (OracleConnection conn = BaseDAO.GetConnection())
            {
                //Define o comando
                using (OracleCommand cmd = new OracleCommand("SELECT ID_GENERO, NOME FROM GENERO", conn))
                {
                    List <Genero> lista = new List <Genero>();
                    cmd.CommandType = CommandType.Text;

                    //Executando o select
                    OracleDataReader reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        Genero g = new Genero();
                        g.Id_Genero = Convert.ToInt32(reader["ID_GENERO"]);
                        g.Nome      = Convert.ToString(reader["NOME"]);
                        lista.Add(g);
                    }
                    return(lista);
                }
            }
        }