Esempio n. 1
0
        public static List <Participacao> GetParticipacoesEmEventos()
        {
            using (MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.DB))
            {
                conn.Open();
                using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM participacoes_evento_view", conn))
                {
                    MySqlDataReader     reader        = cmd.ExecuteReader();
                    List <Participacao> participacoes = new List <Participacao>();

                    while (reader.Read())
                    {
                        participacoes.Add(Participacao.FromDB(reader));
                    }

                    return(participacoes);
                }
            }
        }
Esempio n. 2
0
        public static List <Participacao> GetParticipacoes(int id)
        {
            using (MySqlConnection conn = new MySqlConnection(Properties.Settings.Default.DB))
            {
                conn.Open();
                using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM participacoes_evento_view where idPessoa=@id", conn))
                {
                    cmd.Parameters.AddWithValue("@id", id);

                    MySqlDataReader     reader        = cmd.ExecuteReader();
                    List <Participacao> participacoes = new List <Participacao>();

                    while (reader.Read())
                    {
                        participacoes.Add(Participacao.FromDB(reader));
                    }

                    return(participacoes);
                }
            }
        }