private void ConfigureSalesGrid(DataTable data) { if (data.Rows.Count.Equals(0)) { SalesDataGridView.Height = 50; SalesDataGridView.DataSource = null; SalesTitleLabel.Text = string.Empty; return; } SalesTitleLabel.Location = new Point(0, ResumeSalesDataGridView.Height + ResumeSalesDataGridView.Location.Y + 25); SalesDataGridView.Location = new Point(0, SalesTitleLabel.Location.Y + 25); SalesTitleLabel.Text = "Detalle de ventas."; SalesDataGridView.DataSource = data; DataGridViewConfigurator configurator = DataGridViewConfigurator.CreateConfigurator(SalesDataGridView); IList <string> columns = new List <string> { "id_rol", "estado_orden" }; configurator.HideColumns(columns); configurator.ChangeHeader("fecha_orden", "Fecha de compra"); configurator.ChangeHeader("fecha_pago", "Fecha de pago"); configurator.ChangeHeader("condicion_pago", "Condición de pago"); configurator.ChangeHeader("metodo_pago", "Metodo pago"); configurator.CurrencyColumn("monto_pagado", "Monto"); configurator.AdjustHeight(); }
private void ConfigureResumeLossesGrid(DataTable data) { if (data.Rows.Count.Equals(0)) { ResumeLossesDataGridView.Height = 50; ResumeLossesDataGridView.DataSource = null; ResumeLossesLabel.Text = "No se registran mermas en el periodo seleccionado."; return; } ResumeLossesLabel.Text = "Resumen de mermas"; ResumeLossesDataGridView.DataSource = data; DataGridViewConfigurator configurator = DataGridViewConfigurator.CreateConfigurator(ResumeLossesDataGridView); IList <string> columns = new List <string> { "id_rol" }; configurator.HideColumns(columns); configurator.ChangeHeader("fecha_orden", "Fecha"); configurator.ChangeHeader("productor", "Productor"); configurator.CurrencyColumn("total_mermas", "Total mermas"); configurator.AdjustHeight(); }
private void ConfigureLossesSalesGrid(DataTable data) { if (data.Rows.Count.Equals(0)) { LossesDataGridView.Height = 50; LossesChart.Visible = false; LossesDataGridView.DataSource = null; LossesLabel.Text = string.Empty; return; } LossesLabel.Location = new Point(675, ResumeLossesDataGridView.Height + ResumeLossesDataGridView.Location.Y + 25); LossesDataGridView.Location = new Point(675, LossesLabel.Location.Y + 25); LossesLabel.Text = "Detalle de mermas registradas."; LossesDataGridView.DataSource = data; DataGridViewConfigurator configurator = DataGridViewConfigurator.CreateConfigurator(LossesDataGridView); IList <string> columns = new List <string> { "id_rol" }; configurator.HideColumns(columns); configurator.ChangeHeader("fecha_orden", "Fecha"); configurator.ChangeHeader("producto", "Producto"); configurator.NumericIntegerColumn("cantidad_merma", "Cantidad"); configurator.CurrencyColumn("precio_kg", "Precio (KG)"); configurator.CurrencyColumn("precio_productos", "Total"); configurator.ChangeHeader("productor", "Productor"); configurator.AdjustHeight(); LossesChart.Location = new Point(675, LossesDataGridView.Height + LossesDataGridView.Location.Y + 25); LossesChart.DataSource = data; LossesChart.Series[0].XValueMember = "producto"; LossesChart.Series[0].YValueMembers = "cantidad_merma"; LossesChart.Series[0]["PieLabelStyle"] = "Disabled"; LossesChart.Titles.Clear(); LossesChart.Titles.Add("Distribución de mermas por producto vs cantidad"); LossesChart.Visible = true; }
private void ConfigureResumeSalesGrid(DataTable data) { if (data.Rows.Count.Equals(0)) { ResumeSalesLabel.Text = "No hay ventas registradas en el periodo."; ResumeSalesDataGridView.Height = 50; ResumeSalesDataGridView.DataSource = null; return; } ResumeSalesLabel.Text = "Resumen de ventas"; ResumeSalesDataGridView.DataSource = data; DataGridViewConfigurator configurator = DataGridViewConfigurator.CreateConfigurator(ResumeSalesDataGridView); configurator.ChangeHeader("fecha_compra", "Fecha"); configurator.CurrencyColumn("monto", "Venta diaria"); configurator.AdjustHeight(); }