public VentanaGenerarReserva(Sesion sesion) { InitializeComponent(); this.Sesion = sesion; this.funcion = "CreaUsuario"; string hotelloguea = Sesion.hotel.domicilio.pais + "-" + Sesion.hotel.domicilio.ciudad + "-" + Sesion.hotel.domicilio.calle + "-" + Sesion.hotel.domicilio.numeroCalle; List <string> h = new List <string>(); h.Add(hotelloguea); comboBoxCargar(cbxHoteles, h); this.cbxHoteles.Enabled = false; Reserva = new Reserva(); Usuario = Sesion.usuario; this.logo.Visible = false; OcultarErrores(); groupBox3.Enabled = false; groupBox2.Enabled = false; }
private Reserva llenarHabitaciones(Reserva res) { int idReserva = res.idReserva; string consultaBusqueda = String.Format("select idReserva,idHabitacion from mmel.ReservaPorHabitacion where idReserva = {0}", idReserva); string strCo = ConfigurationManager.AppSettings["stringConexion"]; SqlConnection con = new SqlConnection(strCo); SqlCommand cmd = new SqlCommand(consultaBusqueda, con); con.Open(); if (cmd.Connection.State == ConnectionState.Closed) { cmd.Connection.Open(); } SqlDataReader reader = cmd.ExecuteReader(); res.idHabitaciones = new List <int>(); if (reader.HasRows) { while (reader.Read()) { res.idHabitaciones.Add(Int32.Parse(reader["idHabitacion"].ToString())); } reader.Close(); con.Close(); ModificarReserva mr = new ModificarReserva(res); mr.Show(); this.Hide(); } else { MessageBox.Show("Error. El codigo no existe/ya expiró"); reader.Close(); con.Close(); } return(res); }
public InfoReserva(Reserva reserva) { InitializeComponent(); this.reserva = reserva; }
private void button1_Click(object sender, EventArgs e) { int i; if (textBox1.Text == "" || !int.TryParse(textBox1.Text, out i)) { MessageBox.Show("Complete el codigo de la reserva"); return; } string consultaBusqueda = String.Format("select * from mmel.reserva where CodigoReserva = {0} and (EstadoReserva='CO' or EstadoReserva='MO' or EstadoReserva='RINSF' or EstadoReserva='RINCF' )", textBox1.Text); string strCo = ConfigurationManager.AppSettings["stringConexion"]; SqlConnection con = new SqlConnection(strCo); SqlCommand cmd = new SqlCommand(consultaBusqueda, con); con.Open(); if (cmd.Connection.State == ConnectionState.Closed) { cmd.Connection.Open(); } SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { Reserva res = new Reserva(); while (reader.Read()) { res.idReserva = Int32.Parse(reader["idReserva"].ToString()); int idU; if (!int.TryParse((reader["idUsuarioQueProcesoReserva"].ToString()), out idU)) { idU = 0; } res.idUsuarioQueProcesoReserva = idU; res.idHotel = Int32.Parse(reader["idHotel"].ToString()); DateTime dt; if (!DateTime.TryParse((reader["FechaDeReserva"].ToString()), out dt)) { dt = DateTime.Parse("1/1/1900"); } res.FechaDeReserva = dt; //res.FechaDeReserva = DateTime.Parse(reader["FechaDeReserva"].ToString()); res.FechaDesde = DateTime.Parse(reader["FechaDesde"].ToString()); res.FechaHasta = DateTime.Parse(reader["FechaHasta"].ToString()); //res.idHabitacion = Int32.Parse(reader["idHabitacion"].ToString()); res.idRegimen = Int32.Parse(reader["idRegimen"].ToString()); res.idHuesped = Int32.Parse(reader["idHuesped"].ToString()); res.EstadoReserva = (reader["idHuesped"].ToString())[0]; res.CodigoReserva = Int32.Parse(reader["CodigoReserva"].ToString()); if (LoginData.Rol.idRol == 2) { if (res.idHotel != LoginData.Hotel.IdHotel) { MessageBox.Show("La reserva no pertenece a este hotel", "X", MessageBoxButtons.OK); return; } } } reader.Close(); con.Close(); res = llenarHabitaciones(res); } else { MessageBox.Show("Error. El codigo no existe/ya expiró"); reader.Close(); con.Close(); return; } }
public ListadoClienteReserva(Reserva reserva) : base() { this.reserva = reserva; }
public GenerarReserva(Reserva reserva, Cliente cliente) : base(reserva) { this.cliente = cliente; }
public ElegirTipoCliente(Reserva reserva) { InitializeComponent(); this.reserva = reserva; }
private void button1_Click(object sender, EventArgs e) { reservaEncontrada = reservaCtrl.getReservaConID(Convert.ToInt32(codReservaBox.Text)); reservaEncontrada.id_hotel = reservaCtrl.getIDHotelDeReserva(reservaEncontrada.id_reserva); this.DialogResult = DialogResult.OK; }
public ModificarReserva(Reserva reserva) : base(reserva) { }