Example #1
0
        public static List <Fase> ListarFase(int codBolao)
        {
            string comandoSql = "select cod_fase, cod_bolao, dsc_fase, ind_tipo_fase, ind_status from fase where cod_bolao = ?";

            SqlStatement sql = DatabaseUtil.Connector.BindSql(comandoSql).ToParam("@Bolao", codBolao);

            using (IDataReader reader = sql.AsDataReader()) {
                List <Fase> fases = new List <Fase>();

                while (reader.Read())
                {
                    fases.Add(
                        new Fase {
                        CodigoFase  = reader.GetValue <int>("cod_fase"),
                        CodigoBolao = reader.GetValue <int>("cod_bolao"),
                        NomeFase    = reader.GetValue <string>("dsc_fase"),
                        TipoFase    = reader.GetValue <string>("ind_tipo_fase"),
                        Status      = reader.GetValue <string>("ind_status")
                    }
                        );
                }

                return(fases);
            }
        }