private void button2_Click(object sender, EventArgs e) { OdbcCommand cmd = Conexion.conexion().CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "alter view reporte_folio as select * from folio where habitacion like ('" + textBox7.Text + "%') and Id_reservacion like ('" + textBox1.Text + "%') and Descripcion like ('" + textBox6.Text + "%') and monto like ('" + textBox5.Text + "%') and Nombre like('" + textBox2.Text + "%') and Apellido like('" + textBox3.Text + "%') and Servicio like('" + textBox4.Text + "%') and id_gasto like ('" + textBox8.Text + "%') "; cmd.ExecuteNonQuery(); Conexion.conexion().Close(); ReporteFolio rpt = new ReporteFolio(); rpt.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { OdbcCommand cmd = Conexion.conexion().CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "alter view reporte_habitacion as select * from habitacion where idHabitacion like ('" + textBox1.Text + "%') and tipo like ('" + textBox4.Text + "%') and Descripcion like ('" + textBox2.Text + "%') and costo like ('" + textBox3.Text + "%') and estatusHabitacion like('" + textBox5.Text + "%') "; cmd.ExecuteNonQuery(); Conexion.conexion().Close(); ReporteHabitacion rpt = new ReporteHabitacion(); rpt.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { OdbcCommand cmd = Conexion.conexion().CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "alter view reporte_tipohabitacion as select * from tipohabitacion where idTipoHabitacion like ('" + textBox2.Text + "%') and NombreTipoHabitacion like ('" + textBox1.Text + "%') "; cmd.ExecuteNonQuery(); Conexion.conexion().Close(); GenerarReporteTipoH ir = new GenerarReporteTipoH(); ir.ShowDialog(); }
private void button2_Click(object sender, EventArgs e) { OdbcCommand cmd = Conexion.conexion().CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "alter view reporte_reservacion as select * from reservacion where idReservacion like ('" + textBox4.Text + "%') and tipo like ('" + textBox5.Text + "%') and nombreCliente like ('" + textBox1.Text + "%') and apellidoCliente like ('" + textBox2.Text + "%') and cliente_idCliente like('" + textBox6.Text + "%') and estadoReserva like('" + textBox3.Text + "%') "; cmd.ExecuteNonQuery(); Conexion.conexion().Close(); ReporteReservacioncs rpt = new ReporteReservacioncs(); rpt.ShowDialog(); }
public void mostrar_folio() { try { da = new OdbcDataAdapter("select * from folio", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
public void calculo_folio() { try { da = new OdbcDataAdapter("select SUM(Monto) as Total, Nombre, Apellido, Habitacion from folio where Habitacion = '" + comboBox1.Text + "' group by Nombre, Apellido, Habitacion ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
private void button2_Click(object sender, EventArgs e) { if (radioButton3.Checked) { try { da = new OdbcDataAdapter("select * from folio where Id_reservacion like ('" + textBox1.Text + "%') and TipoCliente like ('" + textBox10.Text + "%') and Habitacion like ('" + comboBox1.Text + "%') and Id_reservacion like ('" + textBox1.Text + "%') and Nombre like ('" + textBox2.Text + "%') and Apellido like ('" + textBox3.Text + "%') and Servicio like ('" + textBox4.Text + "%') and Monto like ('" + textBox5.Text + "%') and Descripcion like ('" + textBox6.Text + "%') ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } } if (radioButton4.Checked) { try { da = new OdbcDataAdapter("select * from folio where Id_reservacion like ('" + textBox1.Text + "%') and TipoCliente like ('" + textBox9.Text + "%') and Habitacion like ('" + comboBox1.Text + "%') and Id_reservacion like ('" + textBox1.Text + "%') and Nombre like ('" + textBox2.Text + "%') and Apellido like ('" + textBox3.Text + "%') and Servicio like ('" + textBox4.Text + "%') and Monto like ('" + textBox5.Text + "%') and Descripcion like ('" + textBox6.Text + "%') ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }//fin if if (radioButton5.Checked) { try { da = new OdbcDataAdapter("select * from folio where Id_reservacion like ('" + textBox1.Text + "%') and Habitacion like ('" + comboBox1.Text + "%') and Id_reservacion like ('" + textBox1.Text + "%') and Nombre like ('" + textBox2.Text + "%') and Apellido like ('" + textBox3.Text + "%') and Servicio like ('" + textBox4.Text + "%') and Monto like ('" + textBox5.Text + "%') and Descripcion like ('" + textBox6.Text + "%') ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }//fin if }
private void button1_Click_1(object sender, EventArgs e) { try { da = new OdbcDataAdapter("select SUM(monto) as Total from folio where Habitacion = '" + comboBox1.Text + "' group by habitacion ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
private void button2_Click(object sender, EventArgs e) { try { da = new OdbcDataAdapter("select * from reservacion where nombreCliente like ('" + textBox1.Text + "%') and apellidoCliente like ('" + textBox2.Text + "%') and cliente_idCliente like('" + comboBox2 + "%') ; ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
public void calculo_folio() { try { da = new OdbcDataAdapter("select SUM(Monto) as Total, Id_reservacion from folio group by Id_reservacion ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
private void button2_Click(object sender, EventArgs e) { try { da = new OdbcDataAdapter("select * from habitacion where estatusHabitacion like ('" + comboBox2.Text + "%') and tipo like ('" + comboBox1.Text + "%') and idHabitacion like ('" + textBox1.Text + "%') and Descripcion like ('" + textBox2.Text + "%') and Costo like ('" + textBox3.Text + "%') ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); comboBox1.SelectedIndex = -1; comboBox2.SelectedIndex = -1; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
private void button2_Click(object sender, EventArgs e) { try { da = new MySqlDataAdapter("select * from habitacion where disponibilidad like ('" + comboBox2.Text + "%') and tipo like ('" + comboBox1.Text + "%') and NoHabitacion like ('" + textBox1.Text + "%') and Descripcion like ('" + textBox2.Text + "%') ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
public void gasto_por_cliente() { if (radioButton1.Checked) { try { da = new OdbcDataAdapter("select * from folio where Id_reservacion = '" + textBox1.Text + "' ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } } if (radioButton2.Checked) { mostrar_folio(); try { da = new OdbcDataAdapter("select * from folio where Id_reservacion = '" + textBox1.Text + "' and Habitacion = '" + comboBox1.Text + "' and Nombre = '" + textBox2.Text + "' and Apellido = '" + textBox3.Text + "' ", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }//fin if }
private void button1_Click(object sender, EventArgs e) { Conexion.conexion(); MessageBox.Show("Conectado"); }
void mostrar_tipohabitacion() { try { da = new OdbcDataAdapter("select idTipohabitacion as Id_habitacion, nombreTipoHabitacion as Tipo_habitacion from tipohabitacion", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }
private void btn_guardar_Click(object sender, EventArgs e) { try { com = new MySqlCommand("insert into folio (Habitacion, Id_reservacion,TipoCliente, Nombre, Apellido, Servicio, Fecha, Monto, Descripcion) values ('" + Convert.ToInt32(comboBox1.Text) + "', '" + Convert.ToInt32(textBox1.Text) + "', '" + tipoc + "' ,'" + textBox2.Text + "', '" + textBox3.Text + "', '" + textBox4.Text + "', '" + Convert.ToString(maskedTextBox1.Text) + "', '" + Convert.ToInt32(textBox5.Text) + "', '" + textBox6.Text + "' )", Conexion.conexion()); com.ExecuteNonQuery(); mostrar_folio(); comboBox1.Text = ""; textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; maskedTextBox1.Text = ""; textBox5.Text = ""; textBox6.Text = ""; MessageBox.Show("Datos Ingresados"); textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); textBox5.Clear(); textBox6.Clear(); comboBox1.SelectedIndex = -1; maskedTextBox1.Clear(); } catch (Exception ex) { MessageBox.Show("Datos no ingresados"); } }
public void mostrar_habitaciones() { try { da = new OdbcDataAdapter("select idHabitacion, estatusHabitacion, tipo, Descripcion, costo from habitacion", Conexion.conexion()); dt = new DataTable(); da.Fill(dt); dataGridView1.DataSource = dt; dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; } catch (Exception ex) { MessageBox.Show("ERROR"); } }