private void btn_buscar_Click(object sender, EventArgs e) { acceso_DB BD = new acceso_DB(); DataTable tabla = new DataTable(); Facturacion fac = new Facturacion(); if (this.txt_num_fac.Text == "") { MessageBox.Show("El Num Factura esta vacio \n Ingrese un valor para buscar..", "Atencion", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); return; } else { tabla = fac.Buscar_NumeroFactura(txt_num_fac.Text); if (tabla.Rows.Count == 0) { MessageBox.Show("No se ha encontrado ninguna Factura con ese Numero", "Atencion", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); txt_num_fac.Clear(); txt_num_fac.Focus(); return; } //Reportes_AlumnosBindingSource.DataSource = tabla; //reportViewer1.RefreshReport(); Datos_FacturaBindingSource.DataSource = tabla; reportViewer_facturacion.RefreshReport(); } }
private void button1_Click(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); DataTable tabla = new DataTable(); string sql = ""; sql = @"SELECT * FROM registro WHERE 1=1"; // sql = @"SELECT alumnos.legajo, alumnos.apellido, // alumnos.nombres as nombre, // tipos_sexos.descripcion as sexo // FROM alumnos join tipos_sexos ON // alumnos.sexo = tipos_sexos.id_sexo // WHERE 1 = 1 "; if (!string.IsNullOrEmpty(txt_patron.Text)) { int i; if (int.TryParse(txt_patron.Text, out i)) { sql += " AND id_huesped = " + txt_patron.Text; } else { if (txt_patron.Text.IndexOf("-") != -1) { string[] datos; datos = txt_patron.Text.Split('-'); sql += @" AND id_huesped BETWEEN " + datos[0] + " AND " + datos[1]; } else { sql += @" AND id_hotel like '%" + txt_patron.Text.Trim() + "%'"; } } } tabla = _BD.consultaDB(sql); if (tabla.Rows.Count == 0) { MessageBox.Show("No hay datos para mostrar"); return; } registroBindingSource.DataSource = tabla; //registroBindinsourse .DataSource = tabla; this.reportViewer1.RefreshReport(); //datoslistestadBindingSource.DataSource = tabla; //reportViewer1.RefreshReport(); }
private void estadistica_huesped_Load(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); string sql = ""; sql = @"SELECT Hotel.nombre as Descriptor , count(*) as Datos FROM huespedes join Hotel ON huespedes.hotel = Hotel.id_hotel GROUP BY hotel.nombre"; // EstadisticaBindingSource.DataSource = _BD.consulta(sql); // reportViewer2.RefreshReport(); estadisticaBindingSource.DataSource = _BD.consultaDB(sql); this.reportViewer1.RefreshReport(); }
private void estadistica_montos_Load(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); string sql = ""; sql = @"SELECT factura.total as Descriptor , count(*) as Datos FROM huespedes join factura ON huespedes.id_huesped = factura.id_huesped GROUP BY factura.total"; // EstadisticaBindingSource.DataSource = _BD.consulta(sql); // reportViewer2.RefreshReport(); estadisticaBindingSource.DataSource = _BD.consultaDB(sql); this.reportViewer1.RefreshReport(); }
private void estadistica_detalle_Load(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); string sql = ""; sql = @"SELECT detalle_factura.descipcion as Descriptor , count(*) as Datos FROM factura join detalle_factura ON factura.n_factura = detalle_factura.n_factura GROUP BY detalle_factura.descipcion"; // EstadisticaBindingSource.DataSource = _BD.consulta(sql); // reportViewer2.RefreshReport(); estadisticaBindingSource.DataSource = _BD.consultaDB(sql); this.reportViewer1.RefreshReport(); }
private void estadistica_instalacion_Load(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); string sql = ""; sql = @"SELECT Instalacion.descripcion_instalacion as Descriptor , count(*) as Datos FROM registro join Instalacion ON registro.id_instalacion = Instalacion.id_instalacion GROUP BY Instalacion.descripcion_instalacion"; // EstadisticaBindingSource.DataSource = _BD.consulta(sql); // reportViewer2.RefreshReport(); estadisticaBindingSource.DataSource = _BD.consultaDB(sql); this.reportViewer1.RefreshReport(); }
private void estadistica_hues_serv_Load(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); string sql = ""; sql = @"SELECT huespedes.nombre as Descriptor , count(*) as Datos FROM registro join huespedes ON registro.id_huesped = huespedes.id_huesped GROUP BY huespedes.nombre"; // EstadisticaBindingSource.DataSource = _BD.consulta(sql); // reportViewer2.RefreshReport(); estadisticaBindingSource.DataSource = _BD.consultaDB(sql); //this.reportViewer1.RefreshReport(); this.reportViewer1.RefreshReport(); }
private void button1_Click(object sender, EventArgs e) { acceso_DB _BD = new acceso_DB(); DataTable tabla = new DataTable(); string sql = ""; sql = @"SELECT * FROM detalle_factura WHERE 1=1"; if (!string.IsNullOrEmpty(txt_patron.Text)) { int i; if (int.TryParse(txt_patron.Text, out i)) { sql += " AND codigo = " + txt_patron.Text; } else { if (txt_patron.Text.IndexOf("-") != -1) { string[] datos; datos = txt_patron.Text.Split('-'); sql += @" AND codigo BETWEEN " + datos[0] + " AND " + datos[1]; } else { sql += @" AND descipcion like '%" + txt_patron.Text.Trim() + "%'"; } } } tabla = _BD.consultaDB(sql); if (tabla.Rows.Count == 0) { MessageBox.Show("No hay datos para mostrar"); return; } detalleBindingSource.DataSource = tabla; //huespedesinformeBindingSource.DataSource = tabla; this.reportViewer1.RefreshReport(); }
private void btn_calcular_Click(object sender, EventArgs e) { acceso_DB BD = new acceso_DB(); DataTable tabla = new DataTable(); Facturacion fac = new Facturacion(); if (this.txt_mes.Text == "") { MessageBox.Show("El campo mes esta vacio \n Ingrese un valor para buscar..", "Atencion", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); return; } else if (this.txt_monto.Text == "") { MessageBox.Show("El campo monto esta vacio \n Ingrese un valor para buscar..", "Atencion", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); return; } else { int num = int.Parse(txt_mes.Text); float x = float.Parse(txt_monto.Text); tabla = fac.Estadistica_Facturacion(num, x); if (tabla.Rows.Count == 0) { MessageBox.Show("No se ha encontrado ningun Monto con ese Numero", "Atencion", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation); txt_mes.Clear(); txt_monto.Clear(); txt_mes.Focus(); return; } Datos_EstadisticaBindingSource.DataSource = tabla; Estadistica_FactuBindingSource.DataSource = tabla; reportViewer_estad_factu.RefreshReport(); } }