Ejemplo n.º 1
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            if (optVoo.Checked == true)
            {
                VoosDAO voo = new VoosDAO();
                DataTable voos = voo.consulta();
                foreach (DataRow dr in voos.Rows)
                {
                    txtData.Text = dr[2].ToString();
                    txtOrigem.Text = dr[3].ToString();
                    txtDestino.Text = dr[4].ToString();
                }
            }

            if (optAviao.Checked == true)
            {
                AviaoDAO aviao = new AviaoDAO();
                DataTable avioes = aviao.consulta();
                foreach (DataRow dr in avioes.Rows)
                {
                    txtModelo.Text = dr[1].ToString();
                }
            }

            if (optAeroporto.Checked == true)
            {
                AeroportoDAO aeroporto = new AeroportoDAO();
                DataTable aeroportos = aeroporto.consulta();
                foreach (DataRow dr in aeroportos.Rows)
                {
                    txtNomeAeroporto.Text = dr[1].ToString();
                    txtCidadeAeroporto.Text = dr[2].ToString();
                }
            }

            if (optPiloto.Checked == true)
            {
                PilotoDAO piloto = new PilotoDAO();
                DataTable pilotos = piloto.consulta();
                foreach (DataRow dr in pilotos.Rows)
                {
                    txtNomePiloto.Text = dr[1].ToString();
                    txtIdade.Text = dr[2].ToString();
                }
            }

            if (optCliente.Checked == true)
            {
                ClienteDAO cliente = new ClienteDAO();
                DataTable clientes = cliente.consulta();
                foreach (DataRow dr in clientes.Rows)
                {
                    txtNomeCliente.Text = dr[1].ToString();
                    txtCidade.Text = dr[2].ToString();
                }
            }
        }
Ejemplo n.º 2
0
 private FrmAviao()
 {
     InitializeComponent();
     aviaoDAO = new AviaoDAO();
 }