private void button2_Click(object sender, EventArgs e) // boton de ventas de dias anteriores { controles(false, false, 829, 429); string[] fecha_separada = calendario.Value.ToShortDateString().Split('/'); string ventas_t = "SELECT DATE_FORMAT(fyh,'%Y/%M/%d') as fecha,SUM(totalVenta) as total,SUM(tarjeta) as tarjeta FROM detalles_pagos d, venta v WHERE d.folio_venta=v.folio_venta GROUP BY month(fyh),year(fyh),day(fyh)"; funcionesSQL.llenartabla(dataGridView1, ventas_t); }
private void Productos_Load(object sender, EventArgs e) { string cadena = "SELECT a.id_producto as id_prod,a.id_articulo as id_art,nombre,descripcion,categoria,precio FROM producto p,articulos a,categoria c,clasificacion cl WHERE a.id_cat=c.id_cat AND a.id_producto=p.id_producto AND cl.id_clase=p.clase ORDER BY a.id_producto,a.id_articulo"; funciones.llenartabla(dataGridView1, cadena); dataGridView1.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable; dataGridView1.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable; dataGridView1.Columns[2].SortMode = DataGridViewColumnSortMode.NotSortable; dataGridView1.Columns[3].SortMode = DataGridViewColumnSortMode.NotSortable; dataGridView1.Columns[4].SortMode = DataGridViewColumnSortMode.NotSortable; dataGridView1.Columns[0].Width = 60; dataGridView1.Columns[1].Width = 60; dataGridView1.Columns[4].DefaultCellStyle.Format = "C2"; }