private static List <ButacaDTO> getButacas(SqlDataReader dataReader) { List <ButacaDTO> ListaButacas = new List <ButacaDTO>(); if (dataReader.HasRows) { while (dataReader.Read()) { ButacaDTO butaca = new ButacaDTO(); butaca.Aeronave = Convert.ToInt32(dataReader["Aeronave"]); butaca.IdButaca = Convert.ToInt32(dataReader["Id"]); butaca.Numero = Convert.ToInt32(dataReader["Numero"]); butaca.Piso = Convert.ToInt32(dataReader["Piso"]); TipoButacaDTO tipoButaca = new TipoButacaDTO(); tipoButaca.IdTipoButaca = Convert.ToInt32(dataReader["Tipo_Butaca"]); tipoButaca.Descripcion = Convert.ToString(dataReader["Descripcion"]); butaca.Habilitada = Convert.ToBoolean(dataReader["Habilitada"]); butaca.Tipo_Butaca = tipoButaca; ListaButacas.Add(butaca); } dataReader.Close(); dataReader.Dispose(); } return(ListaButacas); }
private static List <TipoButacaDTO> readerToListTipoButaca(SqlDataReader dataReader) { List <TipoButacaDTO> listaTipoServicio = new List <TipoButacaDTO>(); if (dataReader.HasRows) { while (dataReader.Read()) { TipoButacaDTO tb = new TipoButacaDTO(); tb.IdTipoButaca = Convert.ToInt32(dataReader["Id"]); tb.Descripcion = Convert.ToString(dataReader["Descripcion"]); listaTipoServicio.Add(tb); } } dataReader.Close(); dataReader.Dispose(); return(listaTipoServicio); }