Exemplo n.º 1
0
        private void CargarProductos()
        {
            try
            {
                dgvProductos.AutoGenerateColumns = false;
                List <proc_CargarTodosProductos_Result> lista = productosNegocio.CargarTodosProductos(indicePagina, tamanoPagina, filtro, columna).ToList();
                if (lista.Count < tamanoPagina)
                {
                    finalLista = true;
                }
                foreach (var item in lista)
                {
                    proc_CargarTodosProductos_Results.Add(item);
                }
                dgvProductos.DataSource = proc_CargarTodosProductos_Results;

                OrdenarColumnasDGV();
            }
            catch (Exception exc)
            {
                MessageBox.Show("Error: No se ha podido cargar los productos correctamente, intente de nuevo por favor.",
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Loggeator.EscribeEnArchivo(exc.ToString());
            }
        }
Exemplo n.º 2
0
 private void CargarVistaPreviaRV()
 {
     try
     {
         proc_CargarTodosProductos_Results = productosNegocio.CargarTodosProductos(1, 1, "Reporte", "Reporte").ToList();
         var dataSource = new ReportDataSource("DataSetTodosProductos", proc_CargarTodosProductos_Results);
         reportViewer1.ProcessingMode         = ProcessingMode.Local;
         reportViewer1.LocalReport.ReportPath = @"C:/SFacturacion/reporteProductos.rdlc";
         reportViewer1.LocalReport.DataSources.Clear();
         reportViewer1.LocalReport.DataSources.Add(dataSource);
         reportViewer1.ZoomMode = ZoomMode.PageWidth;
         reportViewer1.LocalReport.EnableExternalImages = true;
         reportViewer1.LocalReport.SetParameters(parameters);
         reportViewer1.RefreshReport();
     }
     catch (Exception exc)
     {
         MessageBox.Show("Error: No se ha podido exportar, verifique si las configuraciones del sistema estan correctas e intente de nuevo por favor.",
                         "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         Loggeator.EscribeEnArchivo(exc.ToString());
     }
 }
 private void CargarDataGridView()
 {
     proc_CargarTodosProductos_Results = productosNegocio.CargarTodosProductos().ToList();
     dgvProductos.DataSource           = proc_CargarTodosProductos_Results;
 }