MODULO

Imports System.Data Imports System.Data.OleDb Module coneccion Public Cnn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Neumann\LP2\Bases\reservas_.accdb") Public Adptr As New OleDbDataAdapter Public Comd As New OleDbCommand Public Dtst As DataSet Public Dtrw As DataRow End Module

MENU PRINCIPAL
Public Class FrmMenu Private Sub InformacionDelTurisaToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InformacionDelTurisaToolStripMenuItem.Click FrmTurista.Show() FrmTurista.MdiParent = Me End Sub Private Sub HotelesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HotelesToolStripMenuItem.Click FrmHotel.Show() FrmHotel.MdiParent = Me End Sub Private Sub VuelosToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VuelosToolStripMenuItem1.Click FrmVuelo.Show() FrmVuelo.MdiParent = Me End Sub Private Sub VuelosToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VuelosToolStripMenuItem.Click Close() End End Sub Private Sub AgenciasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AgenciasToolStripMenuItem.Click FrmAgencia.Show() FrmAgencia.MdiParent = Me End Sub Private Sub ReservacionesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReservacionesToolStripMenuItem.Click FrmReservas.Show() FrmReservas.MdiParent = Me End Sub End Class

FORMULACIO AGENCIA
Public Class FrmAgencia Dim npos As Integer Dim ESQL As String Private Sub FrmAgencia_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.inicio() Me.Habilitar(True) Me.fondo() End Sub Private Sub inicio() Dim SSql As String = "select * from agencia order by cod_agencia" Adptr = New OleDb.OleDbDataAdapter(SSql, Cnn) Dtst = New DataSet Cnn.Open() Adptr.Fill(Dtst, "agencia") Cnn.Close() If Dtst.Tables("agencia").Rows.Count - 1 >= 0 Then Me.Mostrar() End If End Sub Private Sub Mostrar() Try 'Para evitar errores Dtrw = Dtst.Tables("agencia").Rows(npos) Me.TxtCodAgencia.Text = Dtrw("cod_agencia") Me.TxtDireccion.Text = Dtrw("direccion") Me.TxtTelefono.Text = Dtrw("telefono") Me.TxtContacto.Text = Dtrw("contacto") Catch ex As Exception ' MessageBox.Show(ex.Message) End Try End Sub Private Sub BtNuevo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtNuevo.Click Me.Limpiar() Me.Habilitar(False) Me.Fondo() Me.TxtCodAgencia.Focus() BtNuevo.Enabled = False End Sub Private Sub Limpiar() 'Limpia las cajas de texto Me.TxtCodAgencia.Clear() Me.TxtDireccion.Clear() Me.TxtTelefono.Clear() Me.TxtContacto.Clear() End Sub Private Sub Habilitar(ByVal PROCESO As Boolean) Me.TxtCodAgencia.ReadOnly = PROCESO Me.TxtDireccion.ReadOnly = PROCESO Me.TxtTelefono.ReadOnly = PROCESO Me.TxtContacto.ReadOnly = PROCESO End Sub

Enabled = False Me. ByVal e As System. "Usted se encuentra en el último registro") . "Usted se encuentra en el primer registro") Else npos -= 1 ErrorProvider1.SetError(LblError...EventArgs) Handles BtPrimero.BackColor = Color. ByVal e As System.TxtDireccion.Click npos = 0 ErrorProvider1. "Busqueda. ByVal e As System.BackColor = Color.Mostrar() End Sub Private Sub BtEditar_Click(ByVal sender As System.Click BtEditar.Focus() End Sub Private Sub BtSalir_Click(ByVal sender As System.Tables("agencia").Count .SetError(LblError.Click If npos = 0 Then LblError.EventArgs) Handles BtSiguiente.White End Sub Private Sub BtBuscar_Click(ByVal sender As System.White Me. "agencia") Cnn.Rows. "") Me.fondo() Me.Click Close() End Sub Private Sub BtPrimero_Click(ByVal sender As System.TxtContacto. Cnn) Dtst = New DataSet Cnn.Close() Me.Enabled = False BtNuevo.Mostrar() End Sub Private Sub BtAnterior_Click(ByVal sender As System.Enabled = False Me.Object.Fill(Dtst.BackColor = Color.SetError(LblError.Open() Adptr.1) Then ErrorProvider1.TxtCodAgencia.TxtTelefono.Habilitar(False) Me.Object.EventArgs) Handles BtBuscar. "") Me. ByVal e As System.Mostrar() End If End Sub Private Sub BtSiguiente_Click(ByVal sender As System.Private Sub fondo() Me.BackColor = Color.Object.Visible = True ErrorProvider1.White Me.Object.") BSql = "select * from agencia where ucase(cod_agencia)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.Object.Object.SetError(LblError.EventArgs) Handles BtSalir.EventArgs) Handles BtAnterior.TxtCodAgencia.Click Dim BSql As String Dim Busca As String Busca = InputBox("Ingrese el codigo de agencia a consultar".OleDbDataAdapter(BSql.EventArgs) Handles BtEditar.TxtDireccion.Click If npos = (Dtst. ByVal e As System.White Me. ByVal e As System.

Windows.7 Then ESQL = "insert into agencia(cod_agencia. Cnn) Comd. contacto)values('" & TxtCodAgencia.Information) . "") Me.KeyChar) = 13 Then If BtEditar. direccion.Connection.1 ErrorProvider1.Text & "' . "Grabar". telefono='" & TxtTelefono. ByVal e As System.Close() End If Me.Question) .Connection.OleDbCommand(ESQL.Show("¿Desea grabar este registro?".Show("¿Desea actualizar este registro?".Mostrar() . MessageBoxButtons.Forms.inicio() Me.YesNo.Text & "' where cod_agencia='" & TxtCodAgencia.Open() Try Comd.Message) End Try Comd.SetError(LblError.Show(ex.Close() End If Me. Cnn) Comd. MessageBoxIcon.Text & "' .Text & "' .Connection.Text & "'.Mostrar() End Sub Private Sub TxtContacto_KeyPress(ByVal sender As Object.Mostrar() End If End Sub Private Sub BtUltimo_Click(ByVal sender As System. '" & TxtDireccion. '" & TxtContacto.Enabled = False Then If MessageBox.SetError(LblError.Enabled = False Then If MessageBox.Text & "' )" BtNuevo. '" & TxtTelefono.YesNo.Text & "'.ExecuteNonQuery() Catch ex As Exception MessageBox.Enabled = True Comd = New OleDb.KeyPress If Asc(e. contacto='" & TxtContacto. ByVal e As System.Object. MessageBoxButtons.7 Then ESQL = "update agencia set direccion='" & TxtDireccion. "Actualización".OleDbCommand(ESQL.Habilitar(True) Comd = New OleDb.Tables("agencia").Connection.Click npos = Dtst.Open() Try Comd.Enabled = True BtEditar. "") Me. telefono.KeyPressEventArgs) Handles TxtContacto.Count .Message) End Try Comd.Else npos += 1 ErrorProvider1.Enabled = True Me.EventArgs) Handles BtUltimo.Text & "' " BtNuevo.Show(ex.ExecuteNonQuery() Catch ex As Exception MessageBox.Rows.Mostrar() Else If BtNuevo. MessageBoxIcon.inicio() Me.

EventArgs) Handles TxtDireccion.TextChanged End Sub Private Sub TxtTelefono_KeyPress(ByVal sender As Object.EventArgs) Handles TxtCodAgencia.TextChanged End Sub End Class .KeyChar) = 13 Then TxtContacto.KeyChar) = 13 Then TxtDireccion.Forms.Object.Focus() End Sub Private Sub TxtTelefono_TextChanged(ByVal sender As System.Object.EventArgs) Handles TxtTelefono. ByVal e As System.KeyPressEventArgs) Handles TxtCodAgencia.Windows.Windows.Focus() End If End If End If End Sub Private Sub TxtContacto_TextChanged(ByVal sender As System.KeyPressEventArgs) Handles TxtDireccion.Object.TextChanged End Sub Private Sub TxtCodAgencia_KeyPress(ByVal sender As Object.KeyPress If Asc(e. ByVal e As System.Focus() End Sub Private Sub TxtCodAgencia_TextChanged(ByVal sender As System.Else BtSalir.Forms.Forms.KeyChar) = 13 Then TxtTelefono. ByVal e As System.Focus() End Sub Private Sub TxtDireccion_TextChanged(ByVal sender As System.Windows. ByVal e As System.Object.EventArgs) Handles TxtContacto.KeyPressEventArgs) Handles TxtTelefono. ByVal e As System. ByVal e As System. ByVal e As System.KeyPress If Asc(e.KeyPress If Asc(e.TextChanged End Sub Private Sub TxtDireccion_KeyPress(ByVal sender As Object.

ReadOnly = PROCESO .Habilitar(True) Me.Text = Dtrw("telefono") Me.TxtNombre.EventArgs) Handles BtNuevo.Close() If Dtst.ReadOnly = PROCESO Me.Clear() Me.fondo() End Sub Private Sub inicio() Dim SSql As String = "select * from hotel order by cod_hotel" Adptr = New OleDb.OleDbDataAdapter(SSql. ByVal e As System.TxtCod_Hotel.Text = Dtrw("plaza") Catch ex As Exception ' MessageBox.TxtTelefono.TxtDireccion.Clear() Me.Focus() BtNuevo.Limpiar() Me.Enabled = False End Sub Private Sub Limpiar() 'Limpia las cajas de texto Me.Click Me.Tables("hotel").1 >= 0 Then Me.TxtNombre.Object.Habilitar(False) Me.TxtTelefono.TxtCod_Hotel.inicio() Me. "hotel") Cnn.TxtCod_Hotel.Clear() Me.Message) End Try End Sub Private Sub BtNuevo_Click(ByVal sender As System.TxtNombre.FORMULRIO HOTEL Public Class FrmHotel Dim npos As Integer Dim ESQL As String Private Sub FrmTurista_Load(ByVal sender As System.Tables("hotel").Text = Dtrw("cod_hotel") Me.TxtPlaza.Load Me.TxtCiudad.TxtPlaza.Text = Dtrw("nombre") Me.Count .Clear() Me.Object.TxtCod_Hotel.Clear() Me.Fondo() Me.Mostrar() End If End Sub Private Sub Mostrar() Try 'Para evitar errores Dtrw = Dtst.Text = Dtrw("ciudad") Me.Rows. ByVal e As System.EventArgs) Handles MyBase.Open() Adptr.ReadOnly = PROCESO Me.TxtCiudad.TxtDireccion.Show(ex.TxtDireccion.ReadOnly = PROCESO Me. Cnn) Dtst = New DataSet Cnn.Clear() End Sub Private Sub Habilitar(ByVal PROCESO As Boolean) Me.Rows(npos) Me.Text = Dtrw("direccion") Me.Fill(Dtst.TxtCiudad.

Click Dim BSql As String Dim Busca As String Busca = InputBox("Ingrese el codigo del hotel a seleccionar".Open() Adptr.TxtTelefono.BackColor = Color.Object.Visible = True ErrorProvider1.Click npos = 0 ErrorProvider1.EventArgs) Handles BtPrimero.ReadOnly = PROCESO End Sub Private Sub fondo() Me.EventArgs) Handles BtAnterior. ByVal e As System. ByVal e As System.Windows.Mostrar() End Sub Private Sub BtAnterior_Click(ByVal sender As System..BackColor = Color. "hotel") Cnn.TxtDireccion.Click Close() End Sub Private Sub BtPrimero_Click(ByVal sender As System.Object.Me.KeyPress If Asc(e.TxtPlaza.Focus() End Sub Private Sub BtSalir_Click(ByVal sender As System.TxtNombre.Fill(Dtst. ByVal e As System.White Me.White Me.KeyPressEventArgs) Handles TxtTelefono.TxtCiudad.TxtCod_Hotel.TxtNombre.EventArgs) Handles BtSalir. ByVal e As System.White Me.TxtPlaza.EventArgs) Handles BtBuscar. "Usted se encuentra en el primer registro") .Object.Habilitar(False) Me. "") Me.Focus() End Sub Private Sub BtBuscar_Click(ByVal sender As System.OleDbDataAdapter(BSql.BackColor = Color.BackColor = Color.") BSql = "select * from hotel where ucase(cod_hotel)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.Close() Me. ByVal e As System.SetError(LblError.Click BtEditar.White Me.BackColor = Color. ByVal e As System.TxtTelefono.Forms..SetError(LblError.Object.Click If npos = 0 Then LblError.Enabled = False Me. Cnn) Dtst = New DataSet Cnn.Enabled = False BtNuevo.Enabled = False Me.TxtCod_Hotel.Mostrar() End Sub Private Sub BtEditar_Click(ByVal sender As System.BackColor = Color.White Me.White End Sub Private Sub TxtTelefono_KeyPress(ByVal sender As Object.ReadOnly = PROCESO Me.fondo() Me.EventArgs) Handles BtEditar. "Busqueda.Object.KeyChar) = 13 Then TxtPlaza.

Object. "Actualización".Text & "'. ByVal e As System.Tables("hotel"). '" & TxtNombre.Message) End Try Comd.KeyPressEventArgs) Handles TxtPlaza.Show("¿Desea grabar este registro?".OleDbCommand(ESQL.Text & "' .Text & "' where cod_hotel='" & TxtCod_Hotel. plaza='" & TxtPlaza.Text & "' " BtNuevo. "Usted se encuentra en el último registro") Else npos += 1 ErrorProvider1.Forms.Text & "' .Object. telefono='" & TxtTelefono.ExecuteNonQuery() Catch ex As Exception MessageBox. MessageBoxIcon. MessageBoxIcon. telefono.SetError(LblError. "") Me. MessageBoxButtons.SetError(LblError. ByVal e As System.Show(ex.Tables("hotel").Click If npos = (Dtst. MessageBoxButtons. ciudad.SetError(LblError.Text & "'.Enabled = True BtEditar.SetError(LblError.Text & "'.Information) .Click npos = Dtst.Text & "'.Rows.Close() End If Me.Connection. ciudad='" & TxtCiudad.Enabled = True Me.1 ErrorProvider1.YesNo.Enabled = False Then If MessageBox.1) Then ErrorProvider1.Connection. '" & TxtDireccion. "Grabar".Enabled = False Then If MessageBox.7 Then ESQL = "insert into hotel(cod_hotel.Habilitar(True) Comd = New OleDb.Mostrar() Else If BtNuevo.Question) .KeyChar) = 13 Then If BtEditar. "") Me.Count .7 Then ESQL = "update hotel set nombre='" & TxtNombre.Count . Cnn) Comd.Windows. '" & . plaza)values('" & TxtCod_Hotel.Show("¿Desea actualizar este registro?".Else npos -= 1 ErrorProvider1.EventArgs) Handles BtSiguiente.inicio() Me. direccion='" & TxtDireccion. nombre. direccion.Mostrar() End If End Sub Private Sub BtSiguiente_Click(ByVal sender As System.EventArgs) Handles BtUltimo.KeyPress If Asc(e.Mostrar() End If End Sub Private Sub BtUltimo_Click(ByVal sender As System. ByVal e As System. "") Me.Text & "' .Mostrar() End Sub Private Sub TxtPlaza_KeyPress(ByVal sender As Object.YesNo.Rows.Open() Try Comd.

'" & TxtPlaza.Focus() End If End If End If End Sub Private Sub TxtCod_Hotel_KeyPress(ByVal sender As Object.Focus() End Sub Private Sub TxtDireccion_TextChanged(ByVal sender As System.Windows.Connection. Cnn) Comd.Windows.Close() End If Me.KeyPressEventArgs) Handles TxtCod_Hotel.KeyPress If Asc(e.KeyPressEventArgs) Handles TxtDireccion.TextChanged End Sub Private Sub TxtCiudad_KeyPress(ByVal sender As Object.KeyChar) = 13 Then TxtTelefono.Focus() End Sub Private Sub TxtNombre_TextChanged(ByVal sender As System.KeyChar) = 13 Then TxtNombre.Enabled = True Comd = New OleDb.OleDbCommand(ESQL.Forms.inicio() Me.Message) End Try Comd. ByVal e As System.KeyChar) = 13 Then TxtDireccion.ExecuteNonQuery() Catch ex As Exception MessageBox.Focus() End Sub Private Sub TxtCod_Hotel_TextChanged(ByVal sender As System. ByVal e As System.KeyPressEventArgs) Handles TxtNombre. ByVal e As System.Object.EventArgs) Handles TxtNombre.KeyPress If Asc(e.Open() Try Comd. ByVal e As System. ByVal e As System. ByVal e As System.Windows.KeyPress If Asc(e.Windows.EventArgs) Handles TxtCod_Hotel.Text & "' )" BtNuevo.Text & "' .KeyChar) = 13 Then TxtCiudad.Mostrar() Else BtSalir.Focus() End Sub .KeyPress If Asc(e.KeyPressEventArgs) Handles TxtCiudad.TextChanged End Sub Private Sub TxtNombre_KeyPress(ByVal sender As Object.TextChanged End Sub Private Sub TxtDireccion_KeyPress(ByVal sender As Object.Object.TxtCiudad. '" & TxtTelefono. ByVal e As System.Object.Show(ex.Text & "' .Forms.Connection.Forms.Forms.EventArgs) Handles TxtDireccion.

Show(ex.LblApellidos.Rows(npos) Me.Text = Dtrw("ciudad") Catch ex As Exception ' MessageBox.LblNombres.Text = Dtrw("direccion") Me.Text = Dtrw("nombre") Me.EventArgs) Handles TxtTelefono.Text = Dtrw("telefono") Me.Forms.Text BUSCA_TURISTA_SQL = "select * from turista where ucase(cod_turista)like '%" & UCase(Busca) & "%' " Adptr = New OleDb. ByVal e As System.Text = Dtrw("nombres") Me.KeyPressEventArgs) Handles TxtCodTurista. ByVal e As System.Message) End Try End Sub Private Sub TxtCodTurista_KeyPress(ByVal sender As Object.Object.Message) End Try End Sub Private Sub Mostrar_hotel() 'Funcion que muestra la informacion de los hoteles Try 'Para evitar errores Dtrw = Dtst.Rows(npos) Me.Private Sub TxtCiudad_TextChanged(ByVal sender As System.TxtCodTurista.TextChanged End Sub Private Sub TxtTelefono_TextChanged(ByVal sender As System. Cnn) Dtst = New DataSet .Tables("hotel").EventArgs) Handles TxtPlaza.TxtCodHotel. ByVal e As System.Object.EventArgs) Handles TxtCiudad.LblCiudad.Show(ex.LblNombre.TextChanged End Sub Private Sub TxtPlaza_TextChanged(ByVal sender As System.Tables("turista").Text = Dtrw("cod_turista") Me.LblDireccion.LblTelefono. ByVal e As System.Text = Dtrw("apellidos") Catch ex As Exception ' MessageBox.Text = Dtrw("cod_hotel") Me.KeyPress If Asc(e.Object.Windows.TextChanged End Sub End Class FORMULARIO RESERVAS Public Class FrmReservas Dim npos As Integer Dim ESQL As String Dim GRARRE As String 'Variable que grabará la reserva Private Sub Mostrar_turista() 'Funcion que muestra la informacion del turista Try 'Para evitar errores Dtrw = Dtst.OleDbDataAdapter(BUSCA_TURISTA_SQL.KeyChar) = 13 Then Dim BUSCA_TURISTA_SQL As String Dim Busca As String Busca = TxtCodTurista.

Items.Fill(Dtst.Visible = False GroupBox3.Text = Dtrw("telefono") Me.KeyPress If Asc(e.Object.Message) End Try End Sub Private Sub FrmReservas_Load(ByVal sender As System.OleDbDataAdapter(BSql.Rows(npos) Me.LblDireccion.LblTelefono.LblNombre.Object.Show(ex.Visible = False Calendar. ByVal e As System.EventArgs) Handles TxtFechaEntrada.Object.Visible = False BtGrabar.Open() Adptr.Cnn.Windows.Text = Dtrw("nombre") Me.Focus() End If End Sub Private Sub TxtFechaEntrada_KeyPress(ByVal sender As Object. "hotel") Cnn.TextChanged Dim BSql As String Dim Busca As String Busca = TxtCodHotel.Visible = True TxtCodHotel.Enabled = False GroupBox2.Show() 'Busca disponibildiad de vuelos .Enabled = False GroupBox2.Forms.Text BSql = "select * from hotel where ucase(cod_hotel)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.Items.EventArgs) Handles MyBase.Click Calendar.Items.Tables("hotel").KeyChar) = 13 Then TxtFechaSalida.Mostrar_turista() TxtCodTurista. Cnn) Dtst = New DataSet Cnn.Add("CONVENIO") CmbRegimen.Focus() End Sub Private Sub TxtFechaEntrada_TextChanged(ByVal sender As System. "turista") Cnn.Add("MEDIA") CmbRegimen.Text = Dtrw("direccion") Me.Fill(Dtst. ByVal e As System.Enabled = True TxtCodHotel.Open() Adptr.Close() Me.Close() Try 'Para evitar errores Dtrw = Dtst.Text = Dtrw("ciudad") Catch ex As Exception ' MessageBox.Add("ESTUDIANTE") End Sub Private Sub BtOculta_Click(ByVal sender As System.Items.LblCiudad.Load TxtCodHotel.Hide() BtMuestra.KeyPressEventArgs) Handles TxtFechaEntrada.Add("COMPLETA") CmbRegimen.Hide() BtOculta.Visible = False CmbRegimen. ByVal e As System. ByVal e As System.EventArgs) Handles BtOculta.

EventArgs) Handles BtMuestra. destino.DateChanged LblFecha.Click.KeyPressEventArgs) Handles TxtCant.Focus() End If End Sub Private Sub TxtCant_TextChanged(ByVal sender As System.LblNroVuelo.Visible = True LblTotal.Hide() BtOculta. ByVal e As System.EventArgs) Handles TxtCant. Cnn) Dtst = New DataSet Cnn.Forms. ByVal e As System.Fill(Dtst.Show() End Sub Private Sub Calendar_DateChanged(ByVal sender As System.Open() Adptr.LblPrecio.Close() Try 'Para evitar errores Dtrw = Dtst.Message) End Try TxtCant.Text = TxtCant. BtSalir. ByVal e As System.LblDestino.Start End Sub Private Sub TxtCant_KeyPress(ByVal sender As Object.Text = Dtrw("destino") Me.Click Calendar.Close() End Sub .Focus() End Sub Private Sub BtMuestra_Click(ByVal sender As Object.Show(ex. "vuelo") Cnn.Object. precio.Text = Dtrw("precio") Me.KeyPress If Asc(e.Tables("vuelo").Text BtGrabar.Windows.Dim BSql As String Dim Busca As String Busca = LblFecha.Object. ByVal e As System.KeyChar) = 13 Then BtGrabar.TextChanged End Sub Private Sub BtSalir_Click(ByVal sender As System.LblOrigen.DateRangeEventArgs) Handles Calendar. origen.Windows.Text * LblPrecio.OleDbDataAdapter(BSql.Forms.Rows(npos) Me.Object.Text = Dtrw("hora") Me.Text = Dtrw("origen") Me.LblHora.Text BSql = "select hora. nro_vuelo from vuelo where Ucase(fecha)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.Show() BtMuestra. ByVal e As System.Text = e.EventArgs) Handles BtSalir.Text = Dtrw("nro_vuelo") Catch ex As Exception ' MessageBox.Click Close() Cnn.

Windows.Forms. '" & CmbRegimen. ByVal e As System.Visible = True BtMuestra. cod_hotel. ByVal e As System. ByVal e As System.SelectedIndexChanged GroupBox3. '" & TxtFechaEntrada.Text & "'.Text & "' )" Comd = New OleDb.Windows.Mostrar_hotel() . regimen_pension)values('" & TxtCodTurista.KeyChar) = 13 Then Dim BUSCA_HOTEL_SQL As String Dim Busca As String Busca = TxtCodHotel.EventArgs) Handles CmbRegimen.Close() End If Close() Cnn.Text & "' . nro_vuelo. fecha_salida. "Grabar".Open() Try Comd.Connection.EventArgs) Handles TxtFechaSalida.Object.KeyPressEventArgs) Handles TxtCodHotel.EventArgs) Handles BtGrabar.Text & "' .Connection.Private Sub BtGrabar_Click(ByVal sender As System.YesNo.OleDbCommand(GRARRE.Text & "' .Text BUSCA_HOTEL_SQL = "select * from hotel where Ucase(cod_hotel)like '%" & UCase(Busca) & "%' " Adptr = New OleDb. Cnn) Comd.Question) 7 Then GRARRE = "insert into reserva(cod_turista. '" & TxtCodAgencia.Text & "' .Open() Adptr.Forms.Fill(Dtst.OleDbDataAdapter(BUSCA_HOTEL_SQL.Enabled = False End Sub Private Sub TxtFechaSalida_KeyPress(ByVal sender As Object. Cnn) Dtst = New DataSet Cnn. cod_agencia. MessageBoxButtons.Focus() End Sub Private Sub TxtFechaSalida_TextChanged(ByVal sender As System.Close() Me.Click If MessageBox. MessageBoxIcon.Show(ex.KeyPressEventArgs) Handles TxtFechaSalida.Show("¿Desea registrar la reserva para este turista?".ExecuteNonQuery() Catch ex As Exception MessageBox. "hotel") Cnn. '" & TxtCodHotel. ByVal e As System.KeyPress If Asc(e.KeyPress If Asc(e.Message) End Try Comd. '" & LblNroVuelo.Text & "' .KeyChar) = 13 Then CmbRegimen.Object. '" & TxtFechaSalida.Close() End Sub Private Sub CmbRegimen_SelectedIndexChanged(ByVal sender As System. fecha_entrada.TextChanged End Sub Private Sub TxtCodHotel_KeyPress(ByVal sender As Object. ByVal e As System.Object.Focus() TxtCodHotel.

TxtCodAgencia. ByVal e As System.KeyPressEventArgs) Handles TxtCodAgencia. ByVal e As System.Object.Show(ex.KeyPress If Asc(e.Focus() End If End Sub Private Sub TxtCodHotel_TextChanged(ByVal sender As System.Enabled = False TxtFechaEntrada.TextChanged End Sub End Class FORMULARIO TURISTA Public Class FrmTurista Dim npos As Integer Dim ESQL As String Private Sub FrmTurista_Load(ByVal sender As System.Rows(npos) Me.EventArgs) Handles TxtCodAgencia.EventArgs) Handles TxtCodTurista.Object.EventArgs) Handles MyBase.KeyChar) = 13 Then Dim BUSCA_AGENCIA_SQL As String Dim Busca As String Busca = TxtCodAgencia.Close() Me.inicio() Me.Object.Open() Adptr.Mostrar_hotel() Try 'Para evitar errores Dtrw = Dtst. "agencia ") Cnn.TxtCodHotel.OleDbDataAdapter(BUSCA_AGENCIA_SQL.Object.Load Me. ByVal e As System.Text = Dtrw("cod_agencia") Catch ex As Exception ' MessageBox.Tables("agencia"). ByVal e As System.Message) End Try End If End Sub Private Sub TxtCodAgencia_TextChanged(ByVal sender As System.EventArgs) Handles TxtCodHotel.fondo() End Sub Private Sub inicio() . Cnn) Dtst = New DataSet Cnn.Text BUSCA_AGENCIA_SQL = "select * from agencia where Ucase(cod_agencia)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.TextChanged End Sub Private Sub TxtCodTurista_TextChanged(ByVal sender As System.TextChanged End Sub Private Sub TxtCodAgencia_KeyPress(ByVal sender As Object.Forms.Fill(Dtst.Windows. ByVal e As System.Habilitar(True) Me.

"turista") Cnn. Cnn) Dtst = New DataSet Cnn.ReadOnly = PROCESO Me.Clear() Me.Clear() Me.TxtDireccion.TxtCodTurista.BackColor = Color.Enabled = False Then .Tables("turista").TxtDireccion.White Me. ByVal e As System.BackColor = Color.Tables("turista").Forms.Object.Windows.TxtNombre.TxtDireccion.White Me.EventArgs) Handles BtNuevo.White End Sub Private Sub TxtTelefono_KeyPress(ByVal sender As Object.Habilitar(False) Me.TxtApellido.Clear() Me.Fill(Dtst.Message) End Try End Sub Private Sub BtNuevo_Click(ByVal sender As System.TxtApellido.Clear() End Sub Private Sub Habilitar(ByVal PROCESO As Boolean) Me.White Me.TxtCodTurista.Text = Dtrw("cod_turista") Me.Rows(npos) Me.TxtTelefono.1 >= 0 Then Me.TxtTelefono.Mostrar() End If End Sub Private Sub Mostrar() Try 'Para evitar errores Dtrw = Dtst.Click Me.White Me.ReadOnly = PROCESO Me.KeyPress If Asc(e.Enabled = False End Sub Private Sub Limpiar() 'Limpia las cajas de texto Me.TxtNombre.Text = Dtrw("apellidos") Me.Text = Dtrw("telefono") Catch ex As Exception ' MessageBox.Count .Text = Dtrw("direccion") Me.Focus() BtNuevo.TxtNombre.ReadOnly = PROCESO End Sub Private Sub fondo() Me.ReadOnly = PROCESO Me.TxtNombre.Clear() Me.KeyPressEventArgs) Handles TxtTelefono.TxtCodTurista.Show(ex.Text = Dtrw("nombres") Me.Rows.Fondo() Me.Dim SSql As String = "select * from turista order by cod_turista" Adptr = New OleDb.TxtApellido.TxtDireccion.TxtTelefono.BackColor = Color.KeyChar) = 13 Then If BtEditar.Open() Adptr.TxtCodTurista.OleDbDataAdapter(SSql.Limpiar() Me.TxtCodTurista. ByVal e As System.TxtTelefono.ReadOnly = PROCESO Me.Close() If Dtst.TxtApellido.BackColor = Color.BackColor = Color.

Text & "' . apellidos='" & TxtApellido.Show(ex. Cnn) Comd.Enabled = True Me.Text & "'.Message) End Try Comd. telefono)values('" & TxtCodTurista.7 Then ESQL = "insert into turista(cod_turista. MessageBoxIcon.Focus() End Sub Private Sub TxtNombre_KeyPress(ByVal sender As Object. telefono='" & TxtTelefono.Mostrar() Else BtSalir.Enabled = False Then If MessageBox.OleDbCommand(ESQL. MessageBoxButtons.Windows. '" & TxtTelefono.Text & "'. MessageBoxIcon.Text & "' )" BtNuevo. direccion='" & TxtDireccion.Text & "' where cod_turista='" & TxtCodTurista. MessageBoxButtons.KeyChar) = 13 Then TxtApellido.KeyPressEventArgs) Handles TxtCodTurista. '" & TxtNombre.Text & "'.Habilitar(True) Comd = New OleDb.If MessageBox.Connection. apellidos.Enabled = True BtEditar.Open() Try Comd.YesNo.Focus() End If End If End If End Sub Private Sub TxtCodTurista_KeyPress(ByVal sender As Object.Forms.KeyChar) = 13 Then TxtNombre.OleDbCommand(ESQL.Forms.Text & "' .Connection.Open() Try Comd.inicio() Me.7 Then ESQL = "update turista set nombres='" & TxtNombre.Text & "' .Text & "' .Show("¿Desea actualizar este registro?".Enabled = True Comd = New OleDb. '" & TxtDireccion.KeyPressEventArgs) Handles TxtNombre.KeyPress If Asc(e.Connection.Message) End Try Comd. ByVal e As System.Show("¿Desea grabar este registro?".ExecuteNonQuery() Catch ex As Exception MessageBox.ExecuteNonQuery() Catch ex As Exception MessageBox.Question) .Focus() End Sub Private Sub TxtApellido_KeyPress(ByVal sender As Object.Forms.Text & "' " BtNuevo.Windows. nombres.YesNo. "Grabar".Connection. Cnn) Comd.Windows.Close() End If Me.Show(ex.KeyPress . "Actualización".Mostrar() Else If BtNuevo.KeyPress If Asc(e.KeyPressEventArgs) Handles TxtApellido. ByVal e As System. ByVal e As System. direccion. '" & TxtApellido.Information) .Close() End If Me.inicio() Me.

TxtNombre.Object.1) Then .Click npos = 0 ErrorProvider1.Click If npos = (Dtst.EventArgs) Handles BtBuscar.Count .Open() Adptr.Focus() End Sub Private Sub BtSalir_Click(ByVal sender As System. ByVal e As System.KeyPressEventArgs) Handles TxtDireccion.Click Dim BSql As String Dim Busca As String Busca = InputBox("Ingrese el codigo de turista".Object.Click Close() End Sub Private Sub BtPrimero_Click(ByVal sender As System.EventArgs) Handles BtSalir.TxtCodTurista. "Usted se encuentra en el primer registro") Else npos -= 1 ErrorProvider1. ByVal e As System.Windows.Enabled = False BtNuevo.SetError(LblError.Mostrar() End Sub Private Sub BtEditar_Click(ByVal sender As System.Object.KeyChar) = 13 Then TxtDireccion.SetError(LblError.Object. ByVal e As System.EventArgs) Handles BtSiguiente.Mostrar() End If End Sub Private Sub BtSiguiente_Click(ByVal sender As System. "Busqueda.Habilitar(False) Me. "") Me.KeyChar) = 13 Then TxtTelefono.Focus() End Sub Private Sub BtBuscar_Click(ByVal sender As System.Object. Cnn) Dtst = New DataSet Cnn.Enabled = False Me. "") Me.Enabled = False Me.Mostrar() End Sub Private Sub BtAnterior_Click(ByVal sender As System. ByVal e As System.SetError(LblError.EventArgs) Handles BtEditar.Forms. ByVal e As System.KeyPress If Asc(e.") BSql = "select * from turista where ucase(cod_turista)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.fondo() Me.EventArgs) Handles BtAnterior.Rows.OleDbDataAdapter(BSql.Tables("turista").Click BtEditar.. ByVal e As System. "turista") Cnn.Fill(Dtst.Focus() End Sub Private Sub TxtDireccion_KeyPress(ByVal sender As Object.Object.If Asc(e.Visible = True ErrorProvider1.EventArgs) Handles BtPrimero..Close() Me.Click If npos = 0 Then LblError. ByVal e As System.

Count .Text = Dtrw("origen") Me.Count .Habilitar(True) Me.TxtDestino.Text = Dtrw("nro_vuelo") Me.1 ErrorProvider1.OleDbDataAdapter(SSql.ErrorProvider1.Text = Dtrw("hora") Me.SetError(LblError.Click npos = Dtst.Mostrar() End If End Sub Private Sub Mostrar() Try 'Para evitar errores Dtrw = Dtst.Mostrar() End If End Sub Private Sub BtUltimo_Click(ByVal sender As System.Message) .1 >= 0 Then Me. ByVal e As System.SetError(LblError. "") Me.Open() Adptr.TextChanged End Sub End Class FORMULARIO VUELO Public Class FrmVuelo Dim npos As Integer Dim ESQL As String Private Sub FrmVuelo_Load(ByVal sender As System.Object.Rows(npos) Me.Tables("vuelo").Text = Dtrw("dispon_por_clase") Catch ex As Exception ' MessageBox.TxtOrigen.TxtDispoClase. "vuelo") Cnn.Tables("turista"). "") Me.TxtFecha.EventArgs) Handles MyBase.inicio() Me.Object. ByVal e As System.Rows.Show(ex.Close() If Dtst.Rows.TxtDispoTotal.SetError(LblError.Tables("vuelo").Text = Dtrw("destino") Me.Fill(Dtst.EventArgs) Handles TxtTelefono. "Usted se encuentra en el último registro") Else npos += 1 ErrorProvider1. Cnn) Dtst = New DataSet Cnn.Load Me.Text = Dtrw("fecha") Me.TxtNro.Text = Dtrw("dispon_total") Me.Mostrar() End Sub Private Sub TxtTelefono_TextChanged(ByVal sender As System. ByVal e As System.EventArgs) Handles BtUltimo.TxtHora.fondo() End Sub Private Sub inicio() Dim SSql As String = "select * from vuelo order by nro_vuelo" Adptr = New OleDb.Object.

Enabled = False .BackColor = Color.Clear() Me.Show() BtMuestra.Close() Me.TxtOrigen.TxtDispoTotal.White Me.White Me.Clear() Me.Click.White Me. BtMuestra.TxtDestino.BackColor = Color.ReadOnly = PROCESO End Sub Private Sub fondo() Me.ReadOnly = PROCESO Me.") BSql = "select * from vuelo where ucase(nro_vuelo)like '%" & UCase(Busca) & "%' " Adptr = New OleDb.Object.TxtNro.TxtNro.Click Dim BSql As String Dim Busca As String Busca = InputBox("Ingrese el número de vuelo a consultar".TxtHora.Hide() BtOculta.Habilitar(False) Me.TxtFecha.BackColor = Color.ReadOnly = PROCESO Me. ByVal e As System.TxtDispoClase. "Busqueda.BackColor = Color.OleDbDataAdapter(BSql.TxtHora.BackColor = Color.Clear() Me.Enabled = False Me.TxtDestino.BackColor = Color.Click BtEditar.Click Calendar.TxtOrigen.ReadOnly = PROCESO Me. ByVal e As System.. ByVal e As System.Mostrar() End Sub Private Sub BtEditar_Click(ByVal sender As System.Enabled = False BtNuevo.End Try End Sub Private Sub BtMuestra_Click(ByVal sender As System. Cnn) Dtst = New DataSet Cnn.Object. "vuelo") Cnn.TxtOrigen.TxtNro..BackColor = Color.ReadOnly = PROCESO Me.White Me.Fill(Dtst.TxtHora.Show() End Sub Private Sub Limpiar() 'Limpia las cajas de texto Me.EventArgs) Handles BtMuestra.Clear() Me.White End Sub Private Sub BtBuscar_Click(ByVal sender As System.TxtNro.Clear() Me.ReadOnly = PROCESO Me.ReadOnly = PROCESO Me.Clear() Me.TxtDispoTotal.TxtDispoTotal.White Me.EventArgs) Handles BtBuscar.Object.Open() Adptr.TxtDispoClase.TxtDispoClase.fondo() Me.EventArgs) Handles BtEditar.White Me.TxtFecha.TxtDestino.TxtFecha.Clear() End Sub Private Sub Habilitar(ByVal PROCESO As Boolean) Me.

Visible = True ErrorProvider1.Windows. origen='" & TxtOrigen.KeyPressEventArgs) Handles TxtDispoClase.Text & "'.SetError(LblError.SetError(LblError.SetError(LblError. "Usted se encuentra en el primer registro") Else npos -= 1 ErrorProvider1.Text & "' " BtNuevo.YesNo.Text & "' where nro_vuelo='" & TxtNro.Me.EventArgs) Handles BtSiguiente.KeyChar) = 13 Then If BtEditar.7 Then ESQL = "update vuelo set fecha='" & TxtFecha.Count . "Actualización".Count . ByVal e As System.Text & "'.Mostrar() End If End Sub Private Sub BtSiguiente_Click(ByVal sender As System.Click If npos = 0 Then LblError.EventArgs) Handles BtAnterior.Rows. dispon_por_clase='" & TxtDispoClase.Forms.Object.Click Close() End Sub Private Sub BtPrimero_Click(ByVal sender As System.SetError(LblError.Click npos = Dtst.Tables("vuelo").Tables("vuelo").1 ErrorProvider1.Mostrar() End Sub Private Sub TxtDispoClase_KeyPress(ByVal sender As Object.Object.Object.1) Then ErrorProvider1. "") Me.Enabled = False Then If MessageBox. hora='" & TxtHora. ByVal e As System. destino='" & TxtDestino.Object.Click npos = 0 ErrorProvider1. "Usted se encuentra en el último registro") Else npos += 1 ErrorProvider1.TxtFecha.Text & "'.SetError(LblError. "") Me. MessageBoxIcon.KeyPress If Asc(e. ByVal e As System.EventArgs) Handles BtPrimero.Show("¿Desea actualizar el vuelo?".Enabled = True .Mostrar() End Sub Private Sub BtAnterior_Click(ByVal sender As System.EventArgs) Handles BtSalir.Focus() End Sub Private Sub BtSalir_Click(ByVal sender As System. "") Me.Text & "'.Rows. "") Me.SetError(LblError.Object.Information) .Click If npos = (Dtst.Enabled = True BtEditar. ByVal e As System. MessageBoxButtons.EventArgs) Handles BtUltimo.Text & "'.Mostrar() End If End Sub Private Sub BtUltimo_Click(ByVal sender As System. ByVal e As System. dispon_total='" & TxtDispoTotal. ByVal e As System.

dispon_por_clase)values('" & TxtNro.YesNo.Message) End Try Comd.Text & "' .KeyPressEventArgs) Handles TxtFecha.Focus() End Sub Private Sub TxtHora_KeyPress(ByVal sender As Object.Hide() BtOculta.Message) End Try Comd.Close() End If Me. dispon_total.Open() Try Comd.ExecuteNonQuery() Catch ex As Exception MessageBox. ByVal e As System.KeyPressEventArgs) Handles TxtHora. Cnn) Comd.Mostrar() Else BtSalir.OleDbCommand(ESQL.Forms. destino.Enabled = True Comd = New OleDb.Text & "' .Object.Forms.Close() End If Me. '" & TxtDispoTotal.Text & "' .Click Calendar.Text & "' .Windows.ExecuteNonQuery() Catch ex As Exception MessageBox. origen.Windows.Show() End Sub Private Sub TxtFecha_KeyPress(ByVal sender As Object. MessageBoxButtons.Hide() BtMuestra.Windows. Cnn) Comd.Mostrar() Else If BtNuevo. '" & TxtFecha. ByVal e As System. ByVal e As System.Me.KeyChar) = 13 Then TxtOrigen.Text & "' )" BtNuevo.Text & "' .EventArgs) Handles BtOculta. "Grabar".KeyPress If Asc(e. '" & TxtDestino.KeyPress If Asc(e.Focus() End If End If End If End Sub Private Sub BtOculta_Click(ByVal sender As System.Connection. hora. '" & TxtHora. '" & TxtOrigen.Question) .Forms. MessageBoxIcon.Show(ex.Show("¿Desea grabar este registro?".KeyPress If Asc(e. fecha.inicio() Me.7 Then ESQL = "insert into vuelo(nro_vuelo. '" & TxtDispoClase.KeyPressEventArgs) Handles TxtNro.Habilitar(True) Comd = New OleDb. ByVal e As System.OleDbCommand(ESQL.Open() Try Comd.Connection.Focus() End Sub Private Sub TxtNro_KeyPress(ByVal sender As Object.Connection.Connection.inicio() Me.Show(ex.KeyChar) = 13 Then TxtHora.KeyChar) = 13 Then TxtFecha.Enabled = False Then If MessageBox.Text & "'.Focus() .

Windows.KeyChar) = 13 Then TxtDispoClase.KeyPress If Asc(e.DateRangeEventArgs) Handles Calendar.KeyPressEventArgs) Handles TxtDestino. ByVal e As System.Focus() End Sub Private Sub TxtDispoTotal_KeyPress(ByVal sender As Object.Forms. ByVal e As System.KeyPressEventArgs) Handles TxtDispoTotal.Habilitar(False) Me.End Sub Private Sub TxtOrigen_KeyPress(ByVal sender As Object.Object.Start End Sub End Class .KeyPressEventArgs) Handles TxtOrigen.Windows.KeyPress If Asc(e. ByVal e As System.Focus() BtNuevo.KeyChar) = 13 Then TxtDispoTotal.Windows.Focus() End Sub Private Sub BtNuevo_Click(ByVal sender As System.Focus() End Sub Private Sub TxtDestino_KeyPress(ByVal sender As Object.TxtNro. ByVal e As System.Forms.EventArgs) Handles BtNuevo.Windows.Text = e.KeyChar) = 13 Then TxtDestino.Object. ByVal e As System.Forms.fondo() Me.Click Me.DateChanged TxtFecha.Forms.Limpiar() Me.Enabled = False End Sub Private Sub Calendar_DateChanged(ByVal sender As System.KeyPress If Asc(e.