Ejemplo n.º 1
0
        private void filtros_button_Click(object sender, EventArgs e)
        {
            var frm = new HistorialLotesFiltroForm(this, reporteFiltro);

            this.Hide();
            frm.ShowDialog();
            this.Show();
        }
Ejemplo n.º 2
0
        private async void exportar_inventario_button_Click(object sender, EventArgs e)
        {
            var frm = new HistorialLotesFiltroForm(this);

            this.Hide();
            frm.ShowDialog();
            this.Show();


            var destino = GuardarDialogo();

            if (destino == null)
            {
                return;
            }

            Exportando(true);
            CambiarTareaLabel("Exportando...");

            List <ReporteInventarioModelo> reportes;
            int?comienzo = 0;

            try
            {
                do
                {
                    reportes = await Task.Run(() =>
                                              ConfigGlobal.conexion.CargarReporteInventario(reporteFiltro, limiteFilas: LimiteFilas, comienzo: comienzo)
                                              );

                    await Ayudantes.GuardarCsvReporteAsync(reportes, destino);

                    comienzo = reportes.LastOrDefault()?.LoteId;
                } while (reportes.Count > 0);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Exportando(false);
                return;
            }

            MessageBox.Show("Tarea completada", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Exportando(false);
            reporteFiltro = null;
        }
Ejemplo n.º 3
0
        private async void exportar_lotes_button_Click(object sender, EventArgs e)
        {
            var frm = new HistorialLotesFiltroForm(solicitante: this);

            this.Hide();
            frm.ShowDialog();
            this.Show();

            var destino = AbrirDialogoGuardar();

            if (destino == null)
            {
                return;
            }

            await ExportarReporte <ReporteLoteModelo>(destino, reporteFiltro);

            reporteFiltro = null;
        }