private void ReportesNuevoWF_Load(object sender, EventArgs e) { List <Reporte_Proveedores> listaProveedores = new List <Reporte_Proveedores>(); List <Reporte_Ventas> listaVentas = new List <Reporte_Ventas>(); ////// Grafico Proveedores listaProveedores = ReportesDao.BuscarTotalComprasRealizadasProveedores(); if (listaProveedores.Count > 0) { DiseñoGraficoProveedores(listaProveedores); } else { btnExportarComprasProveedores.Visible = false; } ////// Grafico Ventas listaVentas = ReportesDao.BuscarVentasPorMes(); if (listaVentas.Count > 0) { DiseñoGraficoVentas(listaVentas); } else { btnExportar.Visible = false; } ////// Grafico Producto Más Vendidos listaVentas = ReportesDao.BuscarProductosMasVendidos(); if (listaVentas.Count > 0) { DiseñoGraficoProductosMasVendidos(listaVentas); } else { btnproductoMasVendido.Visible = false; } ////// Reportes Botones /// Total de Ventas List <Reporte_Ventas> listaVentas2 = new List <Reporte_Ventas>(); listaVentas2 = ReportesDao.TotalDeVentas(); lblTotalVentas.Text = Convert.ToString(listaVentas2[0].TotalDeVentasGenerales); /// Caja de Ventas List <Reporte_Ventas> listaVentas3 = new List <Reporte_Ventas>(); listaVentas3 = ReportesDao.CajaDeVentas(); lblCajaVentas.Text = Convert.ToString(listaVentas3[0].CajaDeVentas); /// Total de Compras List <Reporte_Compras> listaCompras = new List <Reporte_Compras>(); listaCompras = ReportesDao.TotalDeCompras(); lblTotalCompras.Text = Convert.ToString(listaCompras[0].TotalDeComprasGenerales); /// Pagos de Compras List <Reporte_Compras> listaCompras2 = new List <Reporte_Compras>(); listaCompras2 = ReportesDao.PagosCompras(); lblPagosProveedores.Text = Convert.ToString(listaCompras2[0].CajaDePagos); }
private void ArmoGrillaVentas(List <ListaVentas> resultado) { PanelResultado.Visible = true; decimal TotalVentas = 0; foreach (var item in resultado) { string fecha = item.Fecha.ToShortDateString(); TotalVentas = Convert.ToDecimal(TotalVentas + item.PrecioVenta); dgvVentas.Rows.Add(item.idVenta, fecha, item.PrecioVenta); } /// Total de Ventas lblTotalVentas.Text = Convert.ToString(resultado.Count); /// Caja de Ventas List <Reporte_Ventas> listaVentas3 = new List <Reporte_Ventas>(); listaVentas3 = ReportesDao.CajaDeVentas(); lblCajaVentas.Text = Convert.ToString(TotalVentas); }
public ReportesImpl() { _reportesDao = new ReportesDao(); }
public static object GetPiechartData(int idPaciente, String fechaini, String fechafin) { List<ChartDetails> dataList = new List<ChartDetails>(); List<ReporteSintomas> sintomas = new List<ReporteSintomas>(); ReportesDao rd = new ReportesDao(); DateTime fechauno = new DateTime(); DateTime fechados = new DateTime(); // valido que no venga vacio si viene vacio if (!String.IsNullOrEmpty(fechafin)) { if (String.IsNullOrEmpty(fechaini)) { return new { userMessage = "por favor ingrese la fecha inicial", logMessage = "Carga satisfactoria...", status = Status.OK_WITH_MESSAGES }; } } if (!String.IsNullOrEmpty(fechaini)) { if (String.IsNullOrEmpty(fechafin)) { return new GridData { userMessage = "por favor ingrese la fecha final", logMessage = "Carga satisfactoria...", status = Status.OK_WITH_MESSAGES }; } try { fechauno = Convert.ToDateTime(fechafin); } catch { return new GridData { userMessage = "La fecha inicial es incorrecta por favor verificar nuevamente", logMessage = "Carga satisfactoria...", status = Status.OK_WITH_MESSAGES }; } try { fechados = Convert.ToDateTime(fechaini); } catch { return new GridData { userMessage = "La fecha inicial es incorrecta por favor verificar nuevamente", logMessage = "Carga satisfactoria...", status = Status.OK_WITH_MESSAGES }; } } if (String.IsNullOrEmpty(fechaini) && String.IsNullOrEmpty(fechafin)) { fechauno = new DateTime(1900, 01, 01); fechados = new DateTime(2400, 01, 01); } sintomas = rd.sp_reporte_sintamas_paciente(fechauno, fechados, idPaciente); dataList = rd.obtenerReporteEpisodios(idPaciente, fechauno, fechados); return new { status = Status.OK, pie = dataList, lineas = sintomas }; }