private void FormReportesIncidencias_Load(object sender, EventArgs e) { ClsNreportes N = new ClsNreportes(); DataTable reportes = N.listarIncidencias(); dgvVenta.DataSource = reportes; mtdGrafica2(); float[] puntos = mtdPintar(); //metodo para el chart mtdGrafica(puntos); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox1.SelectedIndex != -1) { DataTable reportes = new DataTable(); ClsNreportes N = new ClsNreportes(); if (comboBox1.SelectedIndex == 0) { reportes.Clear(); reportes = N.MtdListarReportesSemanaleS(); dgvVenta.DataSource = null; dgvVenta.DataSource = reportes; mtdGrafica2(reportes, 0, 8); float[,] puntos = mtdPintar(reportes, 7, reportes.Rows.Count); //metodo para el chart mtdGrafica(puntos, reportes, 7); } else if (comboBox1.SelectedIndex == 1) { reportes.Clear(); reportes = N.MtdListarReportesMensual(); dgvVenta.DataSource = null; dgvVenta.DataSource = reportes; mtdGrafica2(reportes, 0, 13); float[,] puntos = mtdPintar(reportes, 12, reportes.Rows.Count); //metodo para el chart mtdGrafica(puntos, reportes, 12); } else if (comboBox1.SelectedIndex == 2) { reportes.Clear(); reportes = N.MtdListarReportesTrimestre(); dgvVenta.DataSource = null; dgvVenta.DataSource = reportes; mtdGrafica2(reportes, 0, 5); float[,] puntos = mtdPintar(reportes, 4, reportes.Rows.Count); //metodo para el chart mtdGrafica(puntos, reportes, 4); } else if (comboBox1.SelectedIndex == 3) { reportes.Clear(); reportes = N.MtdListarReportesSemestrales(); dgvVenta.DataSource = null; dgvVenta.DataSource = reportes; mtdGrafica2(reportes, 0, 3); float[,] puntos = mtdPintar(reportes, 2, reportes.Rows.Count); //metodo para el chart mtdGrafica(puntos, reportes, 2); } } }