コード例 #1
0
        private void BindGrid(Int32 currentPage, bool configurarExportarExcel)
        {
            try
            {
                // Configuro la grilla
                SisPackController.AdministrarGrillas.Configurar(grid, this.CantidadOpciones);

                if (configurarExportarExcel == true)
                {
                    // Tengo que configurar para exportar a excel
                    grid.AllowPaging = false;
                    grid.BorderWidth = Unit.Pixel(0);
                    grid.BorderStyle = BorderStyle.None;
                }

                // busco los datos
                Dominio.Interfaces.Dominio.IPlanillaArrastreDominio _reporte = IoC.GetObjectDominio <Dominio.Interfaces.Dominio.IPlanillaArrastreDominio>();

                DateTime FechaDesde = DateTime.Now.AddDays(-30);
                DateTime FechaHasta = DateTime.Now.AddDays(1);
                string   chofer     = string.Empty;

                if (txtFechaDesde.Text != string.Empty)
                {
                    FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
                }
                if (txtFechaHasta.Text != string.Empty)
                {
                    FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
                }
                else
                {
                    FechaHasta = DateTime.Now;
                }

                chofer = txtChofer.Text.Trim();

                //  Cargo los datos en la grilla

                Dominio.Entidades.Extensiones.ReporteRecepcionHojaRuta reporte = new Dominio.Entidades.Extensiones.ReporteRecepcionHojaRuta();
                FechaHasta      = FechaHasta.Date.Add(new TimeSpan(0, 23, 59, 59, 999));
                grid.PageIndex  = currentPage;
                grid.DataSource = _reporte.ResumenProductividadChoferes(chofer, FechaDesde, FechaHasta);
                grid.DataBind();
            }
            catch
            {
                ((SisPacK.ErrorWeb) this.phErrores.Controls[0]).setMensaje("Error al cargar el reporte");
            }
        }
コード例 #2
0
        private void BindGrid(Int32 currentPage, bool configurarExportarExcel)
        {
            try
            {
                // Configuro la grilla
                SisPackController.AdministrarGrillas.Configurar(grid, this.CantidadOpciones);

                if (configurarExportarExcel == true)
                {
                    // Tengo que configurar para exportar a excel
                    grid.AllowPaging = false;
                    grid.BorderWidth = Unit.Pixel(0);
                    grid.BorderStyle = BorderStyle.None;
                }

                // busco los datos
                Dominio.Interfaces.Dominio.HojaDeRuta.IReporteHojaRutaDominio _reporte = IoC.GetObjectDominio <Dominio.Interfaces.Dominio.HojaDeRuta.IReporteHojaRutaDominio>();

                DateTime?FechaDesde = null;
                DateTime?FechaHasta = null;

                if (txtFechaDesde.Text != string.Empty)
                {
                    FechaDesde = Convert.ToDateTime(txtFechaDesde.Text);
                }
                if (txtFechaHasta.Text != string.Empty)
                {
                    FechaHasta = Convert.ToDateTime(txtFechaHasta.Text);
                }
                else
                {
                    FechaHasta = DateTime.Now;
                }

                // Cargo los datos en la grilla
                List <ReporteRecepcionHojaRuta> lista = new List <ReporteRecepcionHojaRuta>();
                lista          = _reporte.ReporteRecepcionHojaRutaAll(FechaDesde, FechaHasta, this.txtNroSucursal.Text, Utiles.Validaciones.obtieneEntero(this.txtNroHojaRuta.Text), chkRendiciones.Checked).ToList();
                grid.PageIndex = currentPage;
                //grid.DataSource = _reporte.ReporteRecepcionHojaRutaAll(FechaDesde, FechaHasta, this.txtNroSucursal.Text, Utiles.Validaciones.obtieneEntero(this.txtNroHojaRuta.Text), chkRendiciones.Checked).ToList();
                if (chkHRSInREndir.Checked)
                {
                    grid.DataSource = lista.Where(p => p.Rendida == false).ToList();
                }
                else
                {
                    grid.DataSource = lista;
                }

                grid.DataBind();

                Dominio.Entidades.Extensiones.ReporteRecepcionHojaRuta reporte = new Dominio.Entidades.Extensiones.ReporteRecepcionHojaRuta();
                FechaHasta = FechaHasta.Value.Date.Add(new TimeSpan(0, 23, 59, 59, 999));
                _reporte.ObtenerTotalizadores(FechaDesde, FechaHasta, reporte);
                HRRecibidasEnAgencia                 = reporte.HRRecibidasEnAgencia;
                HRIngresadasEnRendicion              = reporte.HRIngresadasEnRendicion;
                HRRendidasRecibidasEnAdministracion  = reporte.HRRendidasRecibidasEnAdministracion;
                HRGeneradasRecibidasEnAdministracion = reporte.HRGeneradasRecibidasEnAdministracion;
            }
            catch
            {
                ((SisPacK.ErrorWeb) this.phErrores.Controls[0]).setMensaje("Error al cargar el reporte");
            }
        }