Beispiel #1
0
        /// <summary>
        /// this method modifies a hotel rate object into the database
        /// </summary>
        public void ModificarDatos(TarifaHotel tarifaHotel)
        {
            var sql =
                "UPDATE tarifahoteles SET precio = '" + tarifaHotel.Precio + "' WHERE id = '" + tarifaHotel.Identificador + "'";

            _dataAccessBase.ExecuteNonQuery(sql);
        }
Beispiel #2
0
        public void Modificar(TarifaHotel tHotel)
        {
            var validator = new TarifaHotelValidador();

            validator.ValidateAndThrow(tHotel);

            _dataAccess.ModificarDatos(tHotel);
        }
Beispiel #3
0
        public void RegistrarTarifaHotel(TarifaHotel tarifaHotel)
        {
            var validator = new TarifaHotelValidador();

            validator.ValidateAndThrow(tarifaHotel);

            _dataAccess.InsertarDatos(tarifaHotel);
        }
Beispiel #4
0
        /// <summary>
        /// this method inserts a hotel rate object into the database
        /// </summary>
        public void InsertarDatos(TarifaHotel tarifaHotel)
        {
            var sql =
                "INSERT INTO tarifahoteles (id, precio) VALUES ('" + tarifaHotel.Identificador + "', '" + tarifaHotel.Precio +
                "')";

            _dataAccessBase.ExecuteNonQuery(sql);
        }
Beispiel #5
0
        private void InsertarTarifaHotel()
        {
            var tHotel = new TarifaHotel
            {
                Precio = txtPrecio.Text,
            };

            var taHotelBo = new TarifaHotelBO();

            try
            {
                taHotelBo.RegistrarTarifaHotel(tHotel);
                MonstrarMensaje("Tarifa hotel creado satisfactoriamente");
            }
            catch (Exception e)
            {
                MonstrarError(e.Message);
            }
        }
Beispiel #6
0
        private void EliminarTarifaHotel()
        {
            var tHotel = new TarifaHotel
            {
                Precio = txtPrecio.Text,
            };

            var taHotelBo = new TarifaHotelBO();

            try
            {
                if (!txtPrecio.Text.Equals(""))
                {
                    taHotelBo.Eliminar(txtPrecio.Text.Trim());
                    MonstrarMensaje(" Tarifa de Hotel eliminado satisfactoriamente");
                }
            }
            catch (Exception e)
            {
                MonstrarError(e.Message);
            }
        }