示例#1
0
        private void btn_actualizar_Click(object sender, EventArgs e)
        {
            string ocupado = "Ocupado";
            string sql1    = @"UPDATE Habitacion 
                       SET estado = '" + ocupado + "'"
                             + " WHERE id_habitacion = " + this.txtHabitacionHuesped.Text.ToString();

            _DB.Grabar_Modificar(sql1);
            string sql2 = @"UPDATE Huespedes
            SET habitacion ='" + txtHabitacionHuesped.Text.Trim() + "'"
                          + ", hotel = '" + this.cmb_hotel.SelectedValue.ToString() + "'"
                          + " WHERE id_huesped = " + this.txtNumHuesped.Text.ToString();

            _DB.Grabar_Modificar(sql2);

            string sqlregistro = @" INSERT INTO Registro 
                         ( id_huesped, id_habitacion, id_servicio, id_instalacion, id_hotel) VALUES (" +
                                 huespedr + ", " +
                                 habitacionr + ", " +
                                 servicior + ", " +
                                 instalacionr + ", " +
                                 hotelr + ")";

            _DB.Grabar_Modificar(sqlregistro);

//            string sql3 = @"INSERT INTO HuespedXHabitacion
//            (id_habitacion, id_tipo_doc, num_doc, fecha_hospedaje, id_hotel)
//                           VALUES ("+this.txtHabitacionHuesped.Text.ToString() +","+ "'1'"+","+this.txtNumHuesped.Text.ToString()+","+"22/05/2019"+","+this.cmb_hotel.SelectedValue.ToString()+")";
//            _DB.Grabar_Modificar(sql3);

            this.grilla_habitacion(-1);
            this.lbl_estado.Text = "Transacción en Proceso";
        }
示例#2
0
        //INSERTAR registro

        public void grabar_registro()
        {
            string SqlInsert = "";

            SqlInsert = @" INSERT INTO Registro 
                         ( id_huesped, id_habitacion, id_servicio, id_instalacion, id_hotel) VALUES (" +
                        this._id_huesped.ToString() + ", '" +
                        this._id_habitacion.ToString() + ", '" +
                        this._id_servicio.ToString() + ", '" +
                        this._id_instalacion.ToString() + ", '" +
                        this._id_hotel.ToString() + "')";

            MessageBox.Show("Los datos Ingresados son \n" + SqlInsert);

            _DB.Grabar_Modificar(SqlInsert);
        }
示例#3
0
        //INSERTAR registro

        public void grabar_detalle()
        {
            string SqlInsert = "";

            SqlInsert = @" INSERT INTO detalle_factura 
                         ( n_factura, n_detalle, cantidad, codigo, descipcion, unitario, d_total) VALUES (" +
                        this._n_factura.ToString() + ", " +
                        this._n_detalle.ToString() + ", " +
                        this._cantidad.ToString() + ", " +
                        this._codigo.ToString() + ", '" +
                        this._descripcion.ToString() + "', " +
                        this._unitario.ToString() + ", " +
                        this._total_detalle.ToString() + ")";

            //MessageBox.Show("Los datos Ingresados son \n" + SqlInsert);

            _DB.Grabar_Modificar(SqlInsert);
        }
示例#4
0
        //INSERTAR factura

        public void grabar_factura()
        {
            string SqlInsert = "";

            if (validar_factua() == true)
            {
                SqlInsert = @" INSERT INTO factura 
                         ( id_huesped, n_factura, descuento, f_factura, total) VALUES (" +
                            this._id_huesped.ToString() + ", " +
                            this._n_factura.ToString() + ", " +
                            this._descuento.ToString() + ", '" +
                            this._f_factura.ToString() + "', " +
                            this._total.ToString() + ")";

                //MessageBox.Show("Los datos Ingresados son \n" + SqlInsert);

                _DB.Grabar_Modificar(SqlInsert);
            }
        }