Example #1
0
        public void ModificarDatos(ReservasHotel Rhotel)
        {
            var sql =
                "UPDATE reservaHotel SET destino= '" + Rhotel.destino + "', entrada= '" + Rhotel.entrada + "', salida = '" + Rhotel.salida
                + "', habitaciones = '" + Rhotel.habitaciones + "' WHERE id = '" +
                Rhotel.id_Hotels + "'";

            _dataAccessBase.ExecuteNonQuery(sql);
        }
Example #2
0
        public void InsertarDatos(ReservasHotel Rhotel)
        {
            var sql =
                "INSERT INTO reservaHotel ( destino, entrada, salida, habitaciones,  id_Hotel) VALUES ('" + Rhotel.destino + "', '" +
                Rhotel.destino + "', '" +
                Rhotel.entrada + "', '" +
                Rhotel.salida + "', '" +
                Rhotel.habitaciones + "', '" +
                Rhotel.id_Hotels + "')";

            _dataAccessBase.ExecuteNonQuery(sql);
        }
        private void InsertarReservaH()
        {
            var reservaH = new ReservasHotel
            {
                destino      = textBox4.Text,
                entrada      = dateTimePicker3.Value.ToString("dd/MM/yyyy"),
                salida       = dateTimePicker4.Value.ToString("dd/MM/yyyy"),
                habitaciones = textBox5.Text,
                id_Hotels    = dataGridView2.CurrentRow.Cells[0].Value.ToString()
            };

            var rHotel = new ReservaHotel();

            try
            {
                rHotel.InsertarDatos(reservaH);
                MonstrarMensaje("Reserva Hotel creado satisfactoriamente");
            }
            catch (Exception e)
            {
                MonstrarError(e.Message);
            }
        }