private void Cargar()
 {
     string año = System.DateTime.Now.Year.ToString();
     this.TextBox_buscar.Text = año;
     Reporte reporte = new Reporte(Session["idEmpresa"].ToString());
     Cargar(this.DropDownList_regionales, reporte.ListarRegionales());
     Cargar(this.DropDownList_ciudades);
     Cargar(año, DropDownList_regionales.SelectedValue, DropDownList_ciudades.SelectedValue);
 }
示例#2
0
 public void TestResumenListaVacia()
 {
     Assert.AreEqual("<h1>Lista vacía de formas!</h1>",
                     Reporte.Imprimir(new List <IFormaGeometrica>(), new Castellano()));
 }
        public async void ClickSwitch(object obj)
        {
            switch (obj.ToString())
            {
            case "GenerarReporte":
                if (!pConsultar)
                {
                    ReportViewerVisible = Visibility.Collapsed;
                    new Dialogos().ConfirmacionDialogo("Validación", "Su usuario no tiene privilegios para realizar esta acción");
                    break;
                }
                if (!ListaIngresosSeleccionados.Any())
                {
                    var mensaje    = System.Windows.Application.Current.Windows[0] as MetroWindow;
                    var mySettings = new MetroDialogSettings()
                    {
                        AffirmativeButtonText = "Cerrar",
                        AnimateShow           = true,
                        AnimateHide           = false
                    };
                    ReportViewerVisible = Visibility.Collapsed;
                    await mensaje.ShowMessageAsync("Validación", "Debe seleccionar al menos un interno para generar el reporte.", MessageDialogStyle.Affirmative, mySettings);

                    ReportViewerVisible = Visibility.Visible;
                }
                else
                {
                    ReportViewerVisible = Visibility.Collapsed;
                    Reporte.Reset();
                    await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
                    {
                        GenerarReporte();
                    });

                    ReportViewerVisible = Visibility.Visible;
                }
                break;

            case "ObtenerIngresos":
                try
                {
                    if (!pConsultar)
                    {
                        ReportViewerVisible = Visibility.Collapsed;
                        new Dialogos().ConfirmacionDialogo("Validación", "Su usuario no tiene privilegios para realizar esta acción");
                        break;
                    }
                    ReportViewerVisible = Visibility.Collapsed;
                    await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
                    {
                        Pagina        = 1;
                        ListaIngresos = new List <cCredencialBiblioteca>();
                        EmptyVisible  = true;
                        ObtenerIngresos();
                    });

                    ReportViewerVisible = Visibility.Visible;
                }
                catch (Exception ex)
                {
                    throw new ApplicationException(ex.Message);
                }
                break;

            case "Permitir":
                if (!SelectedIngreso.Seleccionado)
                {
                    SeleccionarTodosIngresos = false;
                }
                else
                {
                    SeleccionarTodosIngresos = !ListaIngresos.Where(w => !w.Seleccionado).Any();
                }
                break;

            case "SeleccionarTodosIngresos":
                if (ListaIngresos.Any())
                {
                    var lista_ingresos = new List <cCredencialBiblioteca>(ListaIngresos);
                    foreach (var Ingreso in lista_ingresos)
                    {
                        Ingreso.Seleccionado = SeleccionarTodosIngresos;
                    }
                    ListaIngresos = lista_ingresos;
                }
                else
                {
                    SeleccionarTodosIngresos = false;
                }
                break;

            case "PermitirSeleccionado":
                if (!SelectedIngresoSeleccionado.Seleccionado)
                {
                    SeleccionarTodosIngresosSeleccionados = false;
                }
                else
                {
                    SeleccionarTodosIngresosSeleccionados = !ListaIngresosSeleccionados.Where(w => !w.Seleccionado).Any();
                }
                break;

            case "SeleccionarTodosIngresosSeleccionados":
                if (ListaIngresosSeleccionados.Any())
                {
                    var lista_ingresos_Seleccionados = new List <cCredencialBiblioteca>(ListaIngresosSeleccionados);
                    foreach (var Ingreso in lista_ingresos_Seleccionados)
                    {
                        Ingreso.Seleccionado = SeleccionarTodosIngresosSeleccionados;
                    }
                    ListaIngresosSeleccionados = lista_ingresos_Seleccionados;
                }
                else
                {
                    SeleccionarTodosIngresosSeleccionados = false;
                }
                break;

            case "AgregarInternos":
                if (ListaIngresos.Any())
                {
                    if (ListaIngresos.Where(w => w.Seleccionado).Any())
                    {
                        var lista_ingresos = new List <cCredencialBiblioteca>(ListaIngresos);
                        var lista_ingresos_Seleccionados = new List <cCredencialBiblioteca>(
                            ListaIngresos.Where(w => w.Seleccionado).
                            OrderByDescending(oD => oD.Id_Anio).
                            ThenByDescending(tD => tD.Id_Imputado).
                            ToList());
                        foreach (var ingreso_Seleccionado in lista_ingresos_Seleccionados)
                        {
                            ingreso_Seleccionado.Seleccionado = false;
                            lista_ingresos.Remove(ingreso_Seleccionado);
                        }
                        ListaIngresos             = lista_ingresos.Any() ? lista_ingresos.OrderByDescending(oD => oD.Id_Anio).ThenByDescending(tD => tD.Id_Imputado).ToList() : new List <cCredencialBiblioteca>();
                        EmptyVisible              = !ListaIngresos.Any();
                        EmptySeleccionadosVisible = false;
                        ListaIngresosSeleccionados.AddRange(lista_ingresos_Seleccionados);
                        ListaIngresosSeleccionados = ListaIngresosSeleccionados.OrderByDescending(oD => oD.Id_Anio).ThenByDescending(tD => tD.Id_Imputado).ToList();
                        SeleccionarTodosIngresos   = false;
                    }
                    else
                    {
                        var mensaje    = System.Windows.Application.Current.Windows[0] as MetroWindow;
                        var mySettings = new MetroDialogSettings()
                        {
                            AffirmativeButtonText = "Cerrar",
                            AnimateShow           = true,
                            AnimateHide           = false
                        };
                        ReportViewerVisible = Visibility.Collapsed;
                        await mensaje.ShowMessageAsync("Validación", "Debe seleccionar al menos un interno.", MessageDialogStyle.Affirmative, mySettings);

                        ReportViewerVisible = Visibility.Visible;
                    }
                }
                else
                {
                    var mensaje    = System.Windows.Application.Current.Windows[0] as MetroWindow;
                    var mySettings = new MetroDialogSettings()
                    {
                        AffirmativeButtonText = "Cerrar",
                        AnimateShow           = true,
                        AnimateHide           = false
                    };
                    ReportViewerVisible = Visibility.Collapsed;
                    await mensaje.ShowMessageAsync("Validación", "Lista de internos vacía. Realice una búsqueda e intente de nuevo.", MessageDialogStyle.Affirmative, mySettings);

                    ReportViewerVisible = Visibility.Visible;
                }
                break;

            case "RemoverInternos":
                if (ListaIngresosSeleccionados.Any())
                {
                    if (ListaIngresosSeleccionados.Where(w => w.Seleccionado).Any())
                    {
                        var lista_ingresos = new List <cCredencialBiblioteca>(ListaIngresosSeleccionados);
                        var lista_ingresos_Seleccionados = new List <cCredencialBiblioteca>(
                            ListaIngresosSeleccionados.Where(w => w.Seleccionado).
                            OrderByDescending(oD => oD.Id_Anio).
                            ThenByDescending(tD => tD.Id_Imputado).
                            ToList());
                        foreach (var ingreso_Seleccionado in lista_ingresos_Seleccionados)
                        {
                            ingreso_Seleccionado.Seleccionado = false;
                            lista_ingresos.Remove(ingreso_Seleccionado);
                        }
                        ListaIngresosSeleccionados = lista_ingresos.Any() ? lista_ingresos.OrderByDescending(oD => oD.Id_Anio).ThenByDescending(tD => tD.Id_Imputado).ToList() : new List <cCredencialBiblioteca>();
                        EmptySeleccionadosVisible  = !ListaIngresosSeleccionados.Any();
                        EmptyVisible = false;
                        ListaIngresos.AddRange(lista_ingresos_Seleccionados);
                        ListaIngresos = ListaIngresos.OrderByDescending(oD => oD.Id_Anio).ThenByDescending(tD => tD.Id_Imputado).ToList();
                        SeleccionarTodosIngresosSeleccionados = false;
                    }
                    else
                    {
                        var mensaje    = System.Windows.Application.Current.Windows[0] as MetroWindow;
                        var mySettings = new MetroDialogSettings()
                        {
                            AffirmativeButtonText = "Cerrar",
                            AnimateShow           = true,
                            AnimateHide           = false
                        };
                        ReportViewerVisible = Visibility.Collapsed;
                        await mensaje.ShowMessageAsync("Validación", "Debe seleccionar al menos un interno.", MessageDialogStyle.Affirmative, mySettings);

                        ReportViewerVisible = Visibility.Visible;
                    }
                }
                else
                {
                    var mensaje    = System.Windows.Application.Current.Windows[0] as MetroWindow;
                    var mySettings = new MetroDialogSettings()
                    {
                        AffirmativeButtonText = "Cerrar",
                        AnimateShow           = true,
                        AnimateHide           = false
                    };
                    ReportViewerVisible = Visibility.Collapsed;
                    await mensaje.ShowMessageAsync("Validación", "Lista de internos Seleccionados vacía.", MessageDialogStyle.Affirmative, mySettings);

                    ReportViewerVisible = Visibility.Visible;
                }
                break;
            }
        }
        public async void GenerarReporte()
        {
            var datosReporte = new List <cReporteDatos>();
            var lIngreso     = new List <cTotalIngreso>();
            await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
            {
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    ReportViewerVisible = Visibility.Collapsed;
                }));
                try
                {
                    var centro = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();

                    datosReporte.Add(new cReporteDatos()
                    {
                        Encabezado1 = Parametro.ENCABEZADO1.Trim(),
                        Encabezado2 = Parametro.ENCABEZADO2.Trim(),
                        Encabezado3 = Parametro.ENCABEZADO3.Trim(),
                        Titulo      = "RELACIÓN DE INGRESOS",
                        Logo1       = Parametro.REPORTE_LOGO1,
                        Logo2       = Parametro.REPORTE_LOGO2,
                        Centro      = centro.DESCR.Trim().ToUpper(),
                    });

                    lIngreso = new cIngreso().ObtenerIngresosActivosPorFecha(GlobalVar.gCentro, SelectedFechaInicial, SelectedFechaFinal).
                               AsEnumerable().
                               Select(s => new cTotalIngreso()
                    {
                        Nacionalidad = s.PAIS_NACIONALIDAD != null ?
                                       (!string.IsNullOrEmpty(s.PAIS_NACIONALIDAD.NACIONALIDAD) ? (s.PAIS_NACIONALIDAD.NACIONALIDAD.TrimEnd() != "MEXICANA" ? "EXTRANJEROS" : "MEXICANOS") : "INDEFINIDO") : "INDEFINIDO",
                        Sexo = !string.IsNullOrEmpty(s.IMPUTADO.SEXO) ? (s.IMPUTADO.SEXO == FEMENINO ? "FEMENINO" : "MASCULINO") : "INDEFINIDO"
                    }).ToList();
                }
                catch (Exception ex)
                {
                    throw new ApplicationException(ex.Message);
                }

                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    ReportViewerVisible = Visibility.Visible;
                }));
            });

            Reporte.LocalReport.ReportPath = "Reportes/rTotalIngresos.rdlc";
            Reporte.LocalReport.DataSources.Clear();

            ReportDataSource ReportDataSource_Encabezado = new ReportDataSource();

            ReportDataSource_Encabezado.Name  = "DataSet1";
            ReportDataSource_Encabezado.Value = datosReporte;

            ReportDataSource ReportDataSource_TotalIngresos = new ReportDataSource();

            ReportDataSource_TotalIngresos.Name  = "DataSet2";
            ReportDataSource_TotalIngresos.Value = lIngreso;

            Reporte.LocalReport.DataSources.Add(ReportDataSource_Encabezado);
            Reporte.LocalReport.DataSources.Add(ReportDataSource_TotalIngresos);

            Reporte.LocalReport.SetParameters(new ReportParameter("FechaInicial", string.Format("{0}/{1}/{2}", SelectedFechaInicial.Day, SelectedFechaInicial.Month, SelectedFechaInicial.Year)));
            Reporte.LocalReport.SetParameters(new ReportParameter("FechaFinal", string.Format("{0}/{1}/{2}", SelectedFechaFinal.Day, SelectedFechaFinal.Month, SelectedFechaFinal.Year)));

            Reporte.Refresh();
            Reporte.RefreshReport();
        }
        public async void GenerarReporte()
        {
            var datosReporte       = new List <cReporteDatos>();
            var ingresosDecomiso   = new List <cDecomisoCustodioIngreso>();
            var objetosDecomiso    = new List <cDecomisoCustodioObjeto>();
            var visitantesDecomiso = new List <cDecomisoCustodioVisitante>();
            var decomisos          = new List <cDecomisoFecha>();

            try
            {
                await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
                {
                    Application.Current.Dispatcher.Invoke((Action)(delegate
                    {
                        ReportViewerVisible = Visibility.Collapsed;
                    }));

                    var centro = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();

                    datosReporte.Add(new cReporteDatos()
                    {
                        Encabezado1 = Parametro.ENCABEZADO1.Trim(),
                        Encabezado2 = Parametro.ENCABEZADO2.Trim(),
                        Encabezado3 = Parametro.ENCABEZADO3.Trim(),
                        Titulo      = "RELACIÓN DE INTERNOS",
                        Logo1       = Parametro.REPORTE_LOGO1,
                        Logo2       = Parametro.REPORTE_LOGO2,
                        Centro      = centro.DESCR.Trim().ToUpper(),
                    });


                    //var objetos_decomiso = new cDecomisoObjeto().ObtenerObjetos(null).ToList();
                    objetosDecomiso.AddRange(new cDecomisoObjeto().ObtenerObjetos(null).AsEnumerable().Select(s => new cDecomisoCustodioObjeto()
                    {
                        Cantidad       = s.CANTIDAD.HasValue ? s.CANTIDAD.Value : 0,
                        Capacidad      = !string.IsNullOrEmpty(s.CAPACIDAD) ? s.CAPACIDAD.TrimEnd() : string.Empty,
                        Comentarios    = !string.IsNullOrEmpty(s.COMENTARIO) ? s.COMENTARIO.TrimEnd() : "SIN COMENTARIOS",
                        Compañia       = s.ID_COMPANIA != null && s.ID_COMPANIA.HasValue ? (!string.IsNullOrEmpty(s.COMPANIA.DESCR) ? s.COMPANIA.DESCR.TrimEnd() : string.Empty) : string.Empty,
                        Descripcion    = !string.IsNullOrEmpty(s.DESCR) ? s.DESCR.TrimEnd() : "SIN DESCRIPCIÓN",
                        Dosis          = s.DOSIS != null && s.DOSIS.HasValue ? s.DOSIS.Value.ToString() : string.Empty,
                        Envoltorios    = s.ENVOLTORIOS != null && s.ENVOLTORIOS.HasValue ? s.ENVOLTORIOS.ToString() : "0",
                        Fabricante     = s.ID_COMPANIA != null && s.ID_FABRICANTE != null && s.ID_FABRICANTE.HasValue && s.ID_COMPANIA.HasValue ? (!string.IsNullOrEmpty(s.COMPANIA.DESCR) ? s.COMPANIA.DESCR.TrimEnd() : string.Empty) : "NO APLICA",
                        Id_Decomiso    = s.ID_DECOMISO,
                        IMEI           = !string.IsNullOrEmpty(s.IMEI) ? s.IMEI.TrimEnd() : string.Empty,
                        Modelo         = s.DECOMISO_MODELO != null && s.ID_MODELO.HasValue ? (!string.IsNullOrEmpty(s.DECOMISO_MODELO.DESCR) ? s.DECOMISO_MODELO.DESCR.TrimEnd() : string.Empty) : string.Empty,
                        NumeroTelefono = !string.IsNullOrEmpty(s.TELEFONO) ? s.TELEFONO.TrimEnd() : string.Empty,
                        SerieNumero    = !string.IsNullOrEmpty(s.SERIE) ? s.SERIE.TrimEnd() : string.Empty,
                        SimSerie       = !string.IsNullOrEmpty(s.SIM_SERIE) ? s.SIM_SERIE.TrimEnd() : string.Empty,
                        TipoObjeto     = !string.IsNullOrEmpty(s.OBJETO_TIPO.DESCR) ? s.OBJETO_TIPO.DESCR.TrimEnd() : string.Empty,
                        Unidad         = s.ID_UNIDAD_MEDIDA != null && s.ID_UNIDAD_MEDIDA.HasValue && s.DROGA_UNIDAD_MEDIDA != null ? (!string.IsNullOrEmpty(s.DROGA_UNIDAD_MEDIDA.DESCR) ? s.DROGA_UNIDAD_MEDIDA.DESCR.TrimEnd() : "NO APLICA") : "NO APLICA"
                    }));
                    var consulta_decomiso = new cDecomiso();
                    foreach (var objeto in objetosDecomiso)
                    {
                        var decomiso = consulta_decomiso.Obtener(objeto.Id_Decomiso).FirstOrDefault();
                        if (!ingresosDecomiso.Any(a => a.Id_Decomiso == objeto.Id_Decomiso))
                        {
                            ingresosDecomiso.AddRange(decomiso.
                                                      DECOMISO_INGRESO.
                                                      Select(s => new cDecomisoCustodioIngreso()
                            {
                                Celda       = !string.IsNullOrEmpty(s.INGRESO.ID_UB_CELDA) ? s.INGRESO.ID_UB_CELDA.TrimEnd() : string.Empty,
                                Edificio    = s.INGRESO.ID_UB_EDIFICIO.HasValue ? s.INGRESO.ID_UB_EDIFICIO.Value.ToString() : string.Empty,
                                Id_Anio     = s.ID_ANIO,
                                Id_Decomiso = s.ID_DECOMISO,
                                Id_Imputado = s.ID_IMPUTADO,
                                Materno     = !string.IsNullOrEmpty(s.INGRESO.IMPUTADO.MATERNO) ? s.INGRESO.IMPUTADO.MATERNO.TrimEnd() : string.Empty,
                                Nombre      = !string.IsNullOrEmpty(s.INGRESO.IMPUTADO.NOMBRE) ? s.INGRESO.IMPUTADO.NOMBRE.TrimEnd() : string.Empty,
                                Paterno     = !string.IsNullOrEmpty(s.INGRESO.IMPUTADO.PATERNO) ? s.INGRESO.IMPUTADO.PATERNO.TrimEnd() : string.Empty,
                                Sector      = s.INGRESO.ID_UB_SECTOR.HasValue ? s.INGRESO.ID_UB_SECTOR.Value.ToString() : string.Empty
                            }));
                        }

                        if (!visitantesDecomiso.Any(a => a.Id_Decomiso == objeto.Id_Decomiso))
                        {
                            visitantesDecomiso.AddRange(decomiso.
                                                        DECOMISO_PERSONA.Where(w => w.ID_TIPO_PERSONA == VISITA).
                                                        Select(s => new cDecomisoCustodioVisitante()
                            {
                                Discapacitado = s.PERSONA.ID_TIPO_DISCAPACIDAD.HasValue ? "SI" : "NO",    //(!string.IsNullOrEmpty(s.PERSONA.TIPO_DISCAPACIDAD.DESCR) ? s.PERSONA.TIPO_DISCAPACIDAD.DESCR.TrimEnd() : string.Empty) : string.Empty,
                                Estatus       = s.PERSONA.VISITANTE.ID_ESTATUS_VISITA.HasValue ? (!string.IsNullOrEmpty(s.PERSONA.VISITANTE.ESTATUS_VISITA.DESCR) ? s.PERSONA.VISITANTE.ESTATUS_VISITA.DESCR.TrimEnd() : "SIN DEFINIR") : "SIN DEFINIR",
                                FechaRegistro = s.PERSONA.VISITANTE.FEC_ALTA.HasValue ? (string.Format("{0}/{1}/{2}", s.PERSONA.VISITANTE.FEC_ALTA.Value.Day, s.PERSONA.VISITANTE.FEC_ALTA.Value.Month, s.PERSONA.VISITANTE.FEC_ALTA.Value.Year)) : string.Empty,
                                Id_Decomiso   = s.ID_DECOMISO,
                                Materno       = !string.IsNullOrEmpty(s.PERSONA.MATERNO) ? s.PERSONA.MATERNO.TrimEnd() : string.Empty,
                                Paterno       = !string.IsNullOrEmpty(s.PERSONA.PATERNO) ? s.PERSONA.PATERNO.TrimEnd() : string.Empty,
                                Nombre        = !string.IsNullOrEmpty(s.PERSONA.NOMBRE) ? s.PERSONA.NOMBRE.TrimEnd() : string.Empty,
                                Sexo          = !string.IsNullOrEmpty(s.PERSONA.SEXO) ? (s.PERSONA.SEXO.TrimEnd() == "F" ? "FEMENINO" : "MASCULINO") : string.Empty,
                                TipoVisitante = "FAMILIAR"     //TODO: Pendiente?
                            }));
                        }
                    }


                    Application.Current.Dispatcher.Invoke((Action)(delegate
                    {
                        Reporte.LocalReport.ReportPath = "Reportes/rDecomisoObjetos.rdlc";
                        ReportDataSource ReportDataSource_Encabezado = new ReportDataSource();
                        ReportDataSource_Encabezado.Name = "DataSet1";
                        ReportDataSource_Encabezado.Value = datosReporte;

                        ReportDataSource ReportDataSource = new ReportDataSource();
                        ReportDataSource.Name = "DataSet2";
                        ReportDataSource.Value = objetosDecomiso;

                        Reporte.LocalReport.DataSources.Add(ReportDataSource_Encabezado);
                        Reporte.LocalReport.DataSources.Add(ReportDataSource);


                        Reporte.LocalReport.SubreportProcessing += (s, e) =>
                        {
                            if (e.ReportPath.Equals("srDecomisoIngreso", StringComparison.InvariantCultureIgnoreCase))
                            {
                                ReportDataSource rds2 = new ReportDataSource("DataSet1", ingresosDecomiso);
                                e.DataSources.Add(rds2);
                            }

                            if (e.ReportPath.Equals("srDecomisoVisitante", StringComparison.InvariantCultureIgnoreCase))
                            {
                                ReportDataSource rds4 = new ReportDataSource("DataSet1", visitantesDecomiso);
                                e.DataSources.Add(rds4);
                            }
                        };

                        //Reporte.LocalReport.SetParameters(new ReportParameter("FechaInicial", string.Format("{0}/{1}/{2}", SelectedFechaInicial.Day, SelectedFechaInicial.Month, SelectedFechaInicial.Year)));
                        //Reporte.LocalReport.SetParameters(new ReportParameter("FechaFinal", string.Format("{0}/{1}/{2}", SelectedFechaFinal.Day, SelectedFechaFinal.Month, SelectedFechaFinal.Year)));


                        Reporte.Refresh();
                        Reporte.RefreshReport();
                        ReportViewerVisible = Visibility.Visible;
                    }));
                });
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }
示例#6
0
 public FrmBuscadorReportes()
 {
     InitializeComponent();
     reporteController = new ReporteController();
     reporte           = null;
 }
示例#7
0
        public async void GenerarReporte()
        {
            var datosReporte = new List <cReporteDatos>();
            var centro       = new CENTRO();
            var lVisitantes  = new List <cControlVisitante>();
            var usuario      = new USUARIO();
            await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
            {
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    ReportViewerVisible = Visibility.Collapsed;
                }));
                try
                {
                    usuario = new cUsuario().ObtenerUsuario(GlobalVar.gUsr);
                    centro  = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();
                    datosReporte.Add(new cReporteDatos()
                    {
                        Encabezado1 = Parametro.ENCABEZADO1.Trim(),
                        Encabezado2 = Parametro.ENCABEZADO2.Trim(),
                        Encabezado3 = Parametro.ENCABEZADO3.Trim(),
                        Titulo      = "CONTROL VISITANTES POR DÍA",
                        Logo1       = Parametro.REPORTE_LOGO1,
                        Logo2       = Parametro.REPORTE_LOGO2,
                        Centro      = centro.DESCR.Trim().ToUpper(),
                    });

                    lVisitantes = new cAduana().
                                  ObtenerVisitasIntimasXDiaPorFecha(SelectedFechaInicial, SelectedFechaFinal).
                                  AsEnumerable().
                                  Select(s => new cControlVisitante()
                    {
                        Categoria    = (s.PERSONA.SEXO == FEMENINO ? MUJERES : HOMBRES),
                        FechaEntrada = s.ENTRADA_FEC.Value.Date
                    }).
                                  ToList();
                }
                catch (Exception ex)
                {
                    throw new ApplicationException(ex.Message);
                }
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    ReportViewerVisible = Visibility.Visible;
                }));
            });

            Reporte.LocalReport.ReportPath = "Reportes/rControlVisitantesXDiaIntima.rdlc";
            Reporte.LocalReport.DataSources.Clear();

            ReportDataSource ReportDataSource_Encabezado = new ReportDataSource();

            ReportDataSource_Encabezado.Name  = "DataSet1";
            ReportDataSource_Encabezado.Value = datosReporte;

            ReportDataSource ReportDataSource = new ReportDataSource();

            ReportDataSource.Name  = "DataSet2";
            ReportDataSource.Value = lVisitantes;

            Reporte.LocalReport.DataSources.Add(ReportDataSource_Encabezado);
            Reporte.LocalReport.DataSources.Add(ReportDataSource);

            Reporte.LocalReport.SetParameters(new ReportParameter(("Usuario"), ObtenerNombreUsuario(usuario)));
            Reporte.LocalReport.SetParameters(new ReportParameter(("FechaActual"), string.Format("{0} DE {1} DE {2}", Fechas.GetFechaDateServer.Day, ((eMesesAnio)Fechas.GetFechaDateServer.Month).ToString(), Fechas.GetFechaDateServer.Year)));
            Reporte.LocalReport.SetParameters(new ReportParameter(("Centro"), centro.DESCR.Trim().ToUpper()));
            Reporte.LocalReport.SetParameters(new ReportParameter(("ComandanteEstatal"), Parametro.COMANDANTE_ESTATAL_CENTROS));
            Reporte.LocalReport.SetParameters(new ReportParameter(("FechaInicial"), string.Format("{0}/{1}/{2}", SelectedFechaInicial.Day, SelectedFechaInicial.Month, SelectedFechaInicial.Year)));
            Reporte.LocalReport.SetParameters(new ReportParameter(("FechaFinal"), string.Format("{0}/{1}/{2}", SelectedFechaFinal.Day, SelectedFechaFinal.Month, SelectedFechaFinal.Year)));

            Reporte.Refresh();
            Reporte.RefreshReport();
        }
 public void DropDownListEmpresa_SelectedIndexChanged(object sender, EventArgs e)
 {
     Reporte reporte = new Reporte(Session["idEmpresa"].ToString());
 }
        public void CargaRecomendaciones(usuario_idr idrusuario, Reporte reporteUsuario)
        {
            if (idrusuario == null || Convert.ToDecimal(idrusuario.energia_kcal) / 2 > reporteUsuario.calorias)
            {
                lblErrorAyer.Visible       = true;
                divRecomendaciones.Visible = false;
            }
            else
            {
                lblErrorAyer.Visible       = false;
                divRecomendaciones.Visible = true;

                if (idrusuario.energia_kcal > reporteUsuario.calorias)
                {
                    pnlCalorias.CssClass += " lime accent-1";
                    pCalorias.InnerHtml   = "Bajo Consumo";
                    rCalorias.InnerHtml   = "Debes ingerir más Alimentos para estar saludable!";
                }
                else
                {
                    pnlCalorias.CssClass += " red accent-1";
                    pCalorias.InnerHtml   = "Alto Consumo";
                    rCalorias.InnerHtml   = "Debes reducir la cantidad de calorías.";
                }

                if (idrusuario.carbohidratos_totales_g > reporteUsuario.carbohidratos)
                {
                    pnlCarbohidratos.CssClass += " lime accent-1";
                    pCarbohidratos.InnerHtml   = "Bajo Consumo";
                    rCarbohidratos.InnerHtml   = "Recomendamos los siguientes alimentos ricos en carbohidratos: <br/> - Manzana <br/> - Arroz integral <br/> - Nueces y semillas <br/> - Berenjena";
                }
                else
                {
                    pnlCarbohidratos.CssClass += " red accent-1";
                    pCarbohidratos.InnerHtml   = "Alto Consumo";
                    rCarbohidratos.InnerHtml   = " Recomendamos que reduzcas el consumo de los siguientes alimentos: <br/> - Pastas blancas <br/> - Cereal refinado <br/> - Pan blanco <br/> - Productos procesados de papa";
                }

                if (idrusuario.proteinas_g > reporteUsuario.proteina)
                {
                    pnlProteinas.CssClass += " lime accent-1";
                    pProteinas.InnerHtml   = "Bajo Consumo";
                    rProteinas.InnerHtml   = "Recomendamos los siguientes alimentos ricos en proteina: <br/> - Pollo <br/> - Clara de huevo <br/> - Pescado <br/> - Lentejas <br/> - Brocoli <br/> - Mani";
                }
                else
                {
                    pnlProteinas.CssClass += " red accent-1";
                    pProteinas.InnerHtml   = "Alto Consumo";
                    rProteinas.InnerHtml   = " Recomendamos los siguientes alimentos: <br/> - Verduras de hoja <br/> - Hortalizas";
                }

                if (idrusuario.grasa_total_g > reporteUsuario.grasa)
                {
                    pnlGrasas.CssClass += " lime accent-1";
                    pGrasas.InnerHtml   = "Bajo Consumo";
                    rGrasas.InnerHtml   = "Debes llevar un consumo de grasas equilibradas. Recomendamos: <br/> - Nueces, frutos secos <br/> - Pescado <br/> - Carnes rojas";
                }
                else
                {
                    pnlGrasas.CssClass += " red accent-1";
                    pGrasas.InnerHtml   = "Alto Consumo";
                    rGrasas.InnerHtml   = "Debes llevar un consumo de grasas equilibradas. Recomendamos que regules el consumo de carnes rojas, alimentos procesados (dulces, galletitas) y productos panificados";
                }

                if (idrusuario.fibra_dietetica_g >= reporteUsuario.fibra)
                {
                    pnlFibra.CssClass += " lime accent-1";
                    pFibra.InnerHtml   = "Bajo Consumo";
                    rFibra.InnerHtml   = "Un consumo bajo en fibra provoca severos problemas en la digestion y aumenta el riesgo de diabetes. Recomendamos que consumas los siguientes alimentos ricos en fibra: <br/> - Verduras (tomate, lechuga, zanahoria) <br/> - Frutas (ciruela, pera, durazno, manzana)";
                }
                else
                {
                    pnlFibra.CssClass += " red accent-1";
                    pFibra.InnerHtml   = "Alto Consumo";
                    rFibra.InnerHtml   = "Un consumo alto de fibra puede llevar a problemas digestivos, especialmente en la digestion de vitaminas y minerales. Reduzca el consumo de alimentos ricos en fibra.";
                }

                if (idrusuario.agua_g > reporteUsuario.agua)
                {
                    pnlAgua.CssClass += " lime accent-1";
                    pAgua.InnerHtml   = "Bajo Consumo";
                    rAgua.InnerHtml   = "Detectamos un bajo consumo de liquidos en tu dieta. Esto puede conllevar a problemas digestivos, mayor estres y mayor propension a alergias. Aumente urgentemente el consumo de agua.";
                }
                else if (idrusuario.agua_g * 2 < reporteUsuario.agua)
                {
                    pnlAgua.CssClass += " red accent-1";
                    pAgua.InnerHtml   = "Alto Consumo";
                    rAgua.InnerHtml   = "Detectamos un consumo excesivo de agua.Te recomendamos volver a los valores de ingesta diaria recomendada de agua.";
                }
                else
                {
                    pnlAgua.CssClass += " green accent-1";
                    pAgua.InnerHtml   = "Consumo Indicado";
                    rAgua.InnerHtml   = "Continúa Saludable!";
                }

                if (idrusuario.potasio_mg >= reporteUsuario.potasio)
                {
                    pnlPotasio.CssClass += " lime accent-1";
                    pPotasio.InnerHtml   = "Bajo Consumo";
                    rPotasio.InnerHtml   = "Recomendamos ingerir los siguientes alimentos: <br/> - Banana <br/> - Acelga <br/> - Espinaca";
                }
                else
                {
                    pnlPotasio.CssClass += " green accent-1";
                    pPotasio.InnerHtml   = "Consumo Indicado";
                    rPotasio.InnerHtml   = "Continúa Saludable!";
                }

                if (idrusuario.sodio_mg >= reporteUsuario.potasio)
                {
                    pnlSodio.CssClass += " lime accent-1";
                    pSodio.InnerHtml   = "Bajo Consumo";
                    rSodio.InnerHtml   = "Compensa esta falta ingieriendo mas sal de mesa, bebidas isotonicas, quesos y caldos.";
                }
                else
                {
                    pnlSodio.CssClass += " red accent-1";
                    pSodio.InnerHtml   = "Alto Consumo";
                    rSodio.InnerHtml   = "Estas consumiendo muchos alimentos con sodio, lo cual puede llevar a la hipertension arterial y problemas oseos. Reduce el consumo de sal de mesa y de embutidos.";
                }

                if (idrusuario.calcio_mg >= reporteUsuario.calcio)
                {
                    pnlCalcio.CssClass += " lime accent-1";
                    pCalcio.InnerHtml   = "Bajo Consumo";
                    rCalcio.InnerHtml   = "Recomendamos que compenses esta falta ingiriendo: <br/> - Mayonesa <br/> - lechuga <br/> - pasas de uva <br/> - alga <br/> - hinojo <br/> - leche";
                }
                else
                {
                    pnlCalcio.CssClass += " green accent-1";
                    pCalcio.InnerHtml   = "Consumo Indicado";
                    rCalcio.InnerHtml   = "Continúa Saludable!";
                }

                if (idrusuario.hierro_mg >= reporteUsuario.hierro)
                {
                    pnlHierro.CssClass += " lime accent-1";
                    pHierro.InnerHtml   = "Bajo Consumo";
                    rHierro.InnerHtml   = "Compensa esta falta con estos alimentos: <br/> - Huevos <br/> - Pescado <br/> - Legumbres (soja, lentejas, garbanzos) <br/> - Espinaca <br/> - Acelga <br/> - Carnes rojas";
                }
                else
                {
                    pnlHierro.CssClass += " green accent-1";
                    pHierro.InnerHtml   = "Consumo Indicado";
                    rHierro.InnerHtml   = "Continúa Saludable!";
                }

                if (idrusuario.fosforo_mg >= reporteUsuario.fosforo)
                {
                    pnlFosforo.CssClass += " lime accent-1";
                    pFosforo.InnerHtml   = "Bajo Consumo";
                    rFosforo.InnerHtml   = "Para compensar esta falta puede consumir: <br/> - Carnes rojas <br/> - Cereales de salvado y avena <br/> - Leches y derivados";
                }
                else
                {
                    pnlFosforo.CssClass += " green accent-1";
                    pFosforo.InnerHtml   = "Consumo Indicado";
                    rFosforo.InnerHtml   = "Continúa Saludable!";
                }

                if (idrusuario.colesterol_mg <= reporteUsuario.colesterol)
                {
                    pnlColesterol.CssClass += " red accent-1";
                    pColesterol.InnerHtml   = "Alto Consumo";
                    rColesterol.InnerHtml   = "Un consumo excesivo de alimentos ricos en grasas saturadas contribuye al aumento de los niveles de colesterol. Para reducir estos niveles recomendamos que baje el consumo de alimentos procesados, harinas refinadas, mantecas y carnes rojas. Consulte con su medico su nivel actual de colesterol en sangre.";
                }
                else
                {
                    pnlColesterol.CssClass += " green accent-1";
                    pColesterol.InnerHtml   = "Consumo Indicado";
                    rColesterol.InnerHtml   = "Continúa Saludable!";
                }
            }
        }
示例#10
0
        public async void GenerarReporte()
        {
            var lAduana      = new List <cBitacoraAccesoAduana>();
            var datosReporte = new List <cReporteDatos>();

            Ventana.WFH.Visibility = Visibility.Collapsed;
            try
            {
                await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
                {
                    var centro = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();

                    datosReporte.Add(new cReporteDatos()
                    {
                        Encabezado1 = Parametro.ENCABEZADO1.Trim(),
                        Encabezado2 = Parametro.ENCABEZADO2.Trim(),
                        Encabezado3 = Parametro.ENCABEZADO3.Trim(),
                        Titulo      = "RELACIÓN DE INTERNOS",
                        Logo1       = Parametro.REPORTE_LOGO1,
                        Logo2       = Parametro.REPORTE_LOGO2,
                        Centro      = centro.DESCR.Trim().ToUpper(),
                    });

                    lAduana = new cAduana().
                              ObtenerReporteBitacora(GlobalVar.gCentro, SelectedFecha).
                              AsEnumerable().
                              Select(s =>
                                     new cBitacoraAccesoAduana()
                    {
                        Asunto        = !string.IsNullOrEmpty(s.ASUNTO) ? s.ASUNTO.TrimEnd() : string.Empty,
                        HoraEntrada   = string.Format("{0}:{1}", s.ENTRADA_FEC.Value.Hour < 10 ? string.Format("0{0}", s.ENTRADA_FEC.Value.Hour) : s.ENTRADA_FEC.Value.Hour.ToString(), s.ENTRADA_FEC.Value.Minute < 10 ? string.Format("0{0}", s.ENTRADA_FEC.Value.Minute) : s.ENTRADA_FEC.Value.Minute.ToString()),
                        HoraSalida    = s.SALIDA_FEC.HasValue ? string.Format("{0}:{1}", s.SALIDA_FEC.Value.Hour < 10 ? string.Format("0{0}", s.SALIDA_FEC.Value.Hour) : s.SALIDA_FEC.Value.Hour.ToString(), s.SALIDA_FEC.Value.Minute < 10 ? string.Format("0{0}", s.SALIDA_FEC.Value.Minute) : s.SALIDA_FEC.Value.Minute.ToString()) : string.Empty,
                        Institucion   = !string.IsNullOrEmpty(s.INSTITUCION) ? s.INSTITUCION : string.Empty,
                        LugarDestino  = s.AREA != null ? (!string.IsNullOrEmpty(s.AREA.DESCR) ? s.AREA.DESCR.TrimEnd() : string.Empty) : string.Empty,
                        Paterno       = !string.IsNullOrEmpty(s.PERSONA.PATERNO) ? s.PERSONA.PATERNO.TrimEnd() : string.Empty,
                        Materno       = !string.IsNullOrEmpty(s.PERSONA.MATERNO) ? s.PERSONA.MATERNO.TrimEnd() : string.Empty,
                        Nombre        = !string.IsNullOrEmpty(s.PERSONA.NOMBRE) ? s.PERSONA.NOMBRE.TrimEnd() : string.Empty,
                        Observaciones = !string.IsNullOrEmpty(s.OBSERV) ? s.OBSERV.TrimEnd() : string.Empty,
                        TipoVisitante = s.ID_TIPO_PERSONA != null ? ObtenerTipoVisitante(s) : string.Empty
                    }).
                              ToList();
                });

                Ventana.WFH.Visibility = Visibility.Visible;

                #region Reporte
                Reporte.LocalReport.ReportPath = "Reportes/rBitacoraAccesoAduana.rdlc";
                Reporte.LocalReport.DataSources.Clear();

                ReportDataSource ReportDataSource_Encabezado = new ReportDataSource();
                ReportDataSource_Encabezado.Name  = "DataSet1";
                ReportDataSource_Encabezado.Value = datosReporte;

                ReportDataSource ReportDataSource_Bitacora = new ReportDataSource();
                ReportDataSource_Bitacora.Name  = "DataSet2";
                ReportDataSource_Bitacora.Value = lAduana;

                Reporte.LocalReport.DataSources.Add(ReportDataSource_Encabezado);
                Reporte.LocalReport.DataSources.Add(ReportDataSource_Bitacora);
                #endregion

                #region Parametros
                Reporte.LocalReport.SetParameters(new ReportParameter("Fecha", string.Format("{0}/{1}/{2}", SelectedFecha.Month, SelectedFecha.Day, SelectedFecha.Year)));
                #endregion

                Reporte.Refresh();
                Reporte.RefreshReport();
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }
        private void GenerarReporte()
        {
            try
            {
                var centro       = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();
                var datosReporte = new List <cReporteDatos>();
                datosReporte.Add(new cReporteDatos()
                {
                    Encabezado1 = Parametro.ENCABEZADO1,
                    Encabezado2 = Parametro.ENCABEZADO2,
                    Encabezado3 = centro != null ? centro.DESCR.Trim() : string.Empty,
                    Logo1       = Parametro.REPORTE_LOGO1,
                    Logo2       = Parametro.REPORTE_LOGO2,
                    Titulo      = "Actividades"
                });

                var  listado  = new List <cReporteActividades>();
                var  grafica  = new List <cReporteActividadesGrafica>();
                var  titulos1 = new List <cReporteActividadesTitulos>();
                var  titulos2 = new List <cReporteActividadesTitulos>();
                bool t1       = true;
                #region Color
                Random       randomGen       = new Random();
                KnownColor[] names           = (KnownColor[])Enum.GetValues(typeof(KnownColor));
                KnownColor   randomColorName = names[randomGen.Next(names.Length)];
                #endregion

                #region Totales
                int tcp, tcs, tfp, tsfim, tsfin, tsfp, tsfs;
                #endregion
                var ltp = new cTipoPrograma().ObtenerTodos();
                if (ltp != null)
                {
                    foreach (var tp in ltp)
                    {
                        tcp             = tcs = tfp = tsfim = tsfin = tsfp = tsfs = 0;
                        randomColorName = names[randomGen.Next(names.Length)];
                        Color randomColor = Color.FromKnownColor(randomColorName);

                        if (t1)
                        {
                            titulos1.Add(new cReporteActividadesTitulos()
                            {
                                Titulo = tp.NOMBRE,
                                Color  = randomColor.Name,
                            });
                            t1 = false;
                        }
                        else
                        {
                            titulos2.Add(new cReporteActividadesTitulos()
                            {
                                Titulo = tp.NOMBRE,
                                Color  = randomColor.Name,
                            });
                            t1 = true;
                        }

                        if (tp.ACTIVIDAD != null)
                        {
                            foreach (var a in tp.ACTIVIDAD)
                            {
                                //comun procesado
                                var cp = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue && w.INGRESO.ID_CLASIFICACION_JURIDICA == "2" &&
                                                                    w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO && x.CP_FUERO == "C") != null);
                                tcp = tcp + cp;
                                //comun sentenciado
                                var cs = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue && w.INGRESO.ID_CLASIFICACION_JURIDICA == "3" &&
                                                                    w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO && x.CP_FUERO == "C") != null);
                                tcs = tcs + cs;
                                //federal procesado
                                var fp = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue && w.INGRESO.ID_CLASIFICACION_JURIDICA == "2" &&
                                                                    w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO && x.CP_FUERO == "F") != null);
                                tfp = tfp + fp;
                                //sin fuero imputado
                                var sfim = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue &&
                                                                      w.INGRESO.ID_CLASIFICACION_JURIDICA == "1" &&
                                                                      !string.IsNullOrEmpty(w.INGRESO.NUC) &&
                                                                      w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO) == null);
                                tsfim = tsfim + sfim;
                                //sin fuero indiciado
                                var sfin = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue &&
                                                                      w.INGRESO.ID_CLASIFICACION_JURIDICA == "1" &&
                                                                      string.IsNullOrEmpty(w.INGRESO.NUC) &&
                                                                      w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO) == null);
                                tsfin = tsfin + sfin;
                                //sin fuero procesado
                                var sfp = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue &&
                                                                     w.INGRESO.ID_CLASIFICACION_JURIDICA == "2" &&
                                                                     w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO) == null);
                                tsfp = tsfp + sfp;
                                //sin fuero sentenciado
                                var sfs = a.GRUPO_PARTICIPANTE.Count(w => w.ESTATUS == 2 && w.ID_GRUPO.HasValue &&
                                                                     w.INGRESO.ID_CLASIFICACION_JURIDICA == "3" &&
                                                                     w.INGRESO.CAUSA_PENAL.FirstOrDefault(x => x.ID_ESTATUS_CP == (short)enumEstatusCausaPenal.ACTIVO) == null);
                                tsfs = tsfs + sfs;
                                listado.Add(new cReporteActividades()
                                {
                                    TipoPrograma        = tp.NOMBRE,
                                    TipoActividad       = a.DESCR,
                                    ComunProcesado      = cp,
                                    ComunSentenciado    = cs,
                                    FederalProcesado    = fp,
                                    SinFueroImputado    = sfim,
                                    SinFueroIndiciado   = sfin,
                                    SinFueroProcesado   = sfp,
                                    SinFueroSentenciado = sfs
                                });
                            }
                        }

                        #region Grafica
                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "COMUN PROCESADO",
                            Color = randomColor.Name,
                            Total = tcp
                        });

                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "COMUN SENTENCIADO",
                            Color = randomColor.Name,
                            Total = tcs
                        });

                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "FEDERAL PROCESADO",
                            Color = randomColor.Name,
                            Total = tfp
                        });

                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "SIN FUERO IMPUTADO",
                            Color = randomColor.Name,
                            Total = tsfim
                        });

                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "SIN FUERO INDICIADO",
                            Color = randomColor.Name,
                            Total = tsfin
                        });

                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "SIN FUERO PROCESADO",
                            Color = randomColor.Name,
                            Total = tsfp
                        });

                        grafica.Add(new cReporteActividadesGrafica()
                        {
                            TipoPrograma          = tp.NOMBRE,
                            ClasificacionJuridica = "SIN FUERO SENTENCIADO",
                            Color = randomColor.Name,
                            Total = tsfs
                        });
                        #endregion
                    }
                }

                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.Reset();
                }));
                Reporte.LocalReport.ReportPath = "Reportes/rActividad.rdlc";
                Reporte.LocalReport.DataSources.Clear();

                ReportDataSource rds1 = new ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = datosReporte;
                Reporte.LocalReport.DataSources.Add(rds1);

                ReportDataSource rds2 = new ReportDataSource();
                rds2.Name  = "DataSet2";
                rds2.Value = listado;
                Reporte.LocalReport.DataSources.Add(rds2);


                ReportDataSource rds3 = new ReportDataSource();
                rds3.Name  = "DataSet3";
                rds3.Value = grafica;
                Reporte.LocalReport.DataSources.Add(rds3);

                ReportDataSource rds4 = new ReportDataSource();
                rds4.Name  = "DataSet4";
                rds4.Value = titulos1;
                Reporte.LocalReport.DataSources.Add(rds4);

                ReportDataSource rds5 = new ReportDataSource();
                rds5.Name  = "DataSet5";
                rds5.Value = titulos2;
                Reporte.LocalReport.DataSources.Add(rds5);

                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.Refresh();
                    Reporte.RefreshReport();
                }));
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error...", ex);
            }
        }
示例#12
0
        public async void GenerarReporte()
        {
            var datosReporte = new List <cReporteDatos>();
            var lPoblacion   = new List <cPoblacionInternos>();
            var centro       = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();
            var usuario      = new cUsuario().ObtenerUsuario(GlobalVar.gUsr);


            await StaticSourcesViewModel.CargarDatosMetodoAsync(() =>
            {
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    ReportViewerVisible = Visibility.Collapsed;
                }));
                datosReporte.Add(new cReporteDatos()
                {
                    Encabezado1 = Parametro.ENCABEZADO1.Trim(),
                    Encabezado2 = Parametro.ENCABEZADO2.Trim(),
                    Encabezado3 = Parametro.ENCABEZADO3.Trim(),
                    Titulo      = "RELACIÓN DE INTERNOS",
                    Logo1       = Parametro.REPORTE_LOGO1,
                    Logo2       = Parametro.REPORTE_LOGO2,
                    Centro      = centro.DESCR.Trim().ToUpper(),
                });


                lPoblacion = new cIngreso().
                             ObtenerIngresosActivos(GlobalVar.gCentro, null, null, true).
                             ToList().
                             Select(s => new cPoblacionInternos()
                {
                    ClasificacionJuridica = s.CLASIFICACION_JURIDICA != null ? (!string.IsNullOrEmpty(s.CLASIFICACION_JURIDICA.DESCR) ? s.CLASIFICACION_JURIDICA.DESCR.TrimEnd() : string.Empty) : string.Empty,
                    Fuero       = s.CAUSA_PENAL.Where(w => w.ID_ESTATUS_CP == Parametro.ID_CAUSA_PENAL_ACTIVA).FirstOrDefault() != null ? ObtenerFuero(s.CAUSA_PENAL.Where(w => w.ID_ESTATUS_CP == Parametro.ID_CAUSA_PENAL_ACTIVA).FirstOrDefault().CP_FUERO.TrimEnd()) : "SIN FUERO",
                    Genero      = s.IMPUTADO.SEXO == FEMENINO ? "FEMENINO" : "MASCULINO",
                    Id_Anio     = s.ID_ANIO,
                    Id_Centro   = (int)s.ID_UB_CENTRO,
                    Id_Imputado = s.ID_IMPUTADO
                }).
                             ToList();
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    ReportViewerVisible = Visibility.Visible;
                }));
            });


            #region Reporte
            Reporte.LocalReport.ReportPath = "Reportes/rPoblacionInternos.rdlc";
            Reporte.LocalReport.DataSources.Clear();

            ReportDataSource ReportDataSource_Encabezado = new ReportDataSource();
            ReportDataSource_Encabezado.Name  = "DataSet1";
            ReportDataSource_Encabezado.Value = datosReporte;

            ReportDataSource ReportDataSource = new ReportDataSource();
            ReportDataSource.Name  = "DataSet2";
            ReportDataSource.Value = lPoblacion;
            Console.WriteLine(lPoblacion.Where(w => w.Genero == "MASCULINO"));

            Reporte.LocalReport.DataSources.Add(ReportDataSource);
            Reporte.LocalReport.DataSources.Add(ReportDataSource_Encabezado);
            #endregion

            #region Parametro
            Reporte.LocalReport.SetParameters(new ReportParameter(("Usuario"), ObtenerNombreUsuario(usuario)));
            Reporte.LocalReport.SetParameters(new ReportParameter(("Fecha"), string.Format("{0} DE {1} DE {2}", Fechas.GetFechaDateServer.Day, ((eMesesAnio)Fechas.GetFechaDateServer.Month).ToString(), Fechas.GetFechaDateServer.Year)));
            Reporte.LocalReport.SetParameters(new ReportParameter(("Centro"), centro.DESCR.Trim().ToUpper()));
            Reporte.LocalReport.SetParameters(new ReportParameter(("ComandanteEstatal"), Parametro.COMANDANTE_ESTATAL_CENTROS));
            #endregion

            Reporte.Refresh();
            Reporte.RefreshReport();
        }
示例#13
0
 public override Simbolo evaluar(Entorno entorno, Reporte reporte)
 {
     return(sim);
 }
    protected void DropDownList_Regional_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownList_Regional.SelectedValue == "*")
        {
            CargarDropDownList_Vacio(DropDownList_Ciudad);
        }
        else
        {
            Reporte _reporte = new Reporte(Session["idEmpresa"].ToString());
            Cargar(DropDownList_Ciudad, _reporte.ListarCiudadesPorRegional(DropDownList_Regional.SelectedValue), true);
        }

        CargarMesEnGrilla();
    }
        protected void Grabar_Click(object sender, EventArgs e)
        {
            bool CampohayNuevo = true;
            bool FiltroHayNuevo = true;
            //Traigo los datos del reporte.
            Reporte report = new Reporte();

            //Reviso si existe un número, sino doy de alta uno nuevo.
            if (id_reporte.Value != "")
            {
                report.ID_Reporte = Convert.ToInt32(id_reporte.Value);
            }
            else
            {
               report.ID_Reporte = ReporteData.GetNewID();
                //Genero un nuevo numero.
            }
            report.Cabecera = new Cabecera();
            report.Campos = new List<Campo>();
            report.Filtros = new List<Filtro>();
            //Tomo los demás datos.
            report.Cabecera.Nombre = NombreReporte.Text;
            report.Cabecera.Descripcion = Descripcion.Text;

            //traigo el origen de datos.
            Origen origen = new Origen();

            //Tipo de origen desde el combo.
              //  string comboTipo = TipoOrigen.SelectedValue;

            if (PaginadoAutomatico.Checked)
                origen.PaginadoAutomatico = 1;
            else
                origen.PaginadoAutomatico = 0;

            report.Origen = OrigenDatos1.GetOrigen(); ;
            // Toma los datos del empty template.
            TextBox campodbnuevo = (TextBox) Campos.Controls[0].Controls[0].FindControl("CampoBDNuevo");
            TextBox titulonuevo = (TextBox)Campos.Controls[0].Controls[0].FindControl("TituloNuevo");
            TextBox longitudnuevo = (TextBox)Campos.Controls[0].Controls[0].FindControl("LongitudNuevo");
            DropDownList tipocamponuevo = (DropDownList)Campos.Controls[0].Controls[0].FindControl("TipoCampoNuevo");

            // Reviso si hay campos nuevos.

            foreach (GridViewRow  r in Campos.Rows)
            {
                TextBox titulo = (TextBox)r.FindControl("Titulo");
                TextBox campodb = (TextBox)r.FindControl("CampoBD");
                TextBox longitud = (TextBox)r.FindControl("Longitud");
                DropDownList tipocampo = (DropDownList)r.FindControl("TipoCampo");
            }

            if (CampohayNuevo)
            {
                Campo campoNuevo = new Campo();
                campoNuevo.CampoDB = campodbnuevo.Text;
                campoNuevo.Label = titulonuevo.Text;
                campoNuevo.LongitudMaxima = 1;// Convert.ToInt32(longitudnuevo.Text);
                campoNuevo.TipoCampo = (TipoCampo) Convert.ToInt16(tipocamponuevo.SelectedValue);
                report.Campos.Add(campoNuevo);
            }

            //Tomamos los filtros

            // Toma los datos del empty template.
            TextBox filtronombrenuevo = (TextBox)Filtros.Controls[0].Controls[0].FindControl("NombreNuevo");
            TextBox filtrolabelnuevo = (TextBox)Filtros.Controls[0].Controls[0].FindControl("LabelNuevo");
            CheckBox filtroobligatorionuevo = (CheckBox)Filtros.Controls[0].Controls[0].FindControl("ObligatorioNuevo");
            DropDownList tipofiltronuevo = (DropDownList)Filtros.Controls[0].Controls[0].FindControl("TipoFiltroNuevo");

            // Reviso si hay campos nuevos.

            foreach (GridViewRow r in Filtros.Rows)
            {
                // Toma los datos del empty template.
                TextBox filtronombre = (TextBox)Filtros.Controls[0].Controls[0].FindControl("Nombre");
                TextBox filtrolabel = (TextBox)Filtros.Controls[0].Controls[0].FindControl("Label");
                CheckBox filtroobligatorio = (CheckBox)Filtros.Controls[0].Controls[0].FindControl("Obligatorio");
                DropDownList tipofiltro = (DropDownList)Filtros.Controls[0].Controls[0].FindControl("TipoFiltro");

            }

            if (FiltroHayNuevo)
            {
                Filtro filtroNuevo = new Filtro();
                filtroNuevo.Nombre = campodbnuevo.Text;
                filtroNuevo.Label = titulonuevo.Text;
                filtroNuevo.LongitudMaxima = 1;// Convert.ToInt32(longitudnuevo.Text);
                filtroNuevo.Obligatorio = false;
                if (filtroobligatorionuevo.Checked)
                {
                    filtroNuevo.Obligatorio = true;
                }

                //filtroNuevo.OrigenDatos = (TipoCampo)Convert.ToInt16(tipocamponuevo.SelectedValue);
                //filtroNuevo.TipoOrigen =
                report.Filtros.Add(filtroNuevo);
            }

            ReporteData.SaveReporte(report);
        }
示例#16
0
 public void TestResumenListaVaciaFrances()
 {
     Assert.AreEqual("<h1>Liste vide de formes!</h1>",
                     Reporte.Imprimir(new List <IFormaGeometrica>(), new Frances()));
 }
示例#17
0
        public static List<Reporte> VistaReporte()
        {
            using (OracleConnection conn = Conexion.conectar())
            {
                conn.Open();
                List<Reporte> nuevaLista = new List<Reporte>();
                OracleCommand consulta = new OracleCommand("prreporte", conn);
                consulta.CommandType = CommandType.StoredProcedure;
                consulta.Parameters.Add("p_cursor", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                consulta.ExecuteNonQuery();
                OracleDataReader dr = ((OracleRefCursor)consulta.Parameters["p_cursor"].Value).GetDataReader();
                while (dr.Read())
                {
                    Reporte nuevo = new Reporte();
                    nuevo.Fk_pabellon = VistaPabellon().Where(a => a.Idpabellon.ToString() == dr[0].ToString()).First();
                    nuevo.Fk_especialidad = VistaEspecialidada().Where(a => a.Idespecialidad.ToString() == dr[1].ToString()).First();
                    nuevo.Fk_estado = VistaEstado().Where(a => a.Idestado.ToString() == dr[3].ToString()).First();
                    int contar = VistaTotal().Where(a => a.Fecha == dr[4].ToString() && a.Idpabellon.ToString() == dr[0].ToString()).Count();

                    if (contar == 0)
                    {
                        nuevo.Total = 0;

                    }
                    else
                    {
                        int total = VistaTotal().Where(a => a.Idpabellon.ToString() == dr[0].ToString() && a.Fecha == dr[4].ToString()).Select(a => a.Total).First();
                        nuevo.Total = Math.Round((Double.Parse(dr[2].ToString()) * 100) / (Double)total, 1);

                    }

                    DateTime time;
                    time = DateTime.Parse(dr[4].ToString());
                    nuevo.Fecha = time.ToString("d");

                    nuevaLista.Add(nuevo);
                }

                conn.Close();

                return nuevaLista;
            }
        }
        private void button_RegistrarReporte_Click(object sender, RoutedEventArgs e)
        {
            if (validarCampos())
            {
                if (conductoresSeleccionados.Count > 0)
                {
                    if (vehiculosSeleccionados.Count > 0)
                    {
                        if (images.Count >= 3)
                        {
                            Reporte reporte = new Reporte();
                            reporte.Direccion   = tb_direccion.Text;
                            reporte.Descripcion = tb_descripcion.Text;
                            reporte.Fecha       = (DateTime)dp_fecha.SelectedDate;
                            reporte.Estado      = "Activo";
                            ReporteDAO.addReporte(reporte);

                            int ultimoReporte = ReporteDAO.getLastIndex();

                            Dictamen dictamen = new Dictamen();
                            dictamen.Descripcion = "";
                            dictamen.Estado      = "Activo";
                            dictamen.Fecha       = (DateTime)dp_fecha.SelectedDate;
                            string hora = DateTime.Now.ToString("t");
                            dictamen.Hora      = hora;
                            dictamen.IdPerito  = 0;
                            dictamen.IdReporte = ultimoReporte;
                            dictamen.Folio     = ultimoReporte;
                            DictamenDAO.addDictamen(dictamen);



                            VehiculosReporte vehiculosReporte;
                            foreach (Vehiculo vehiculo in vehiculosSeleccionados)
                            {
                                vehiculosReporte            = new VehiculosReporte();
                                vehiculosReporte.IdReporte  = ultimoReporte;
                                vehiculosReporte.IdVehiculo = vehiculo.IdVehiculo;
                                VehiculosReporteDAO.addVehiculosReporte(vehiculosReporte);
                            }

                            ConductoresReporte conductoresReporte;
                            foreach (Conductor conductor in conductoresSeleccionados)
                            {
                                conductoresReporte             = new ConductoresReporte();
                                conductoresReporte.IdReporte   = ultimoReporte;
                                conductoresReporte.IdConductor = conductor.IdConductor;
                                ConductoresReporteDAO.addConductoresReporte(conductoresReporte);
                            }

                            try
                            {
                                foreach (Image imagen in images)
                                {
                                    String filepath = imagen.Source.ToString().Substring(8);
                                    String filename = String.Format("Reporte{0}", ultimoReporte);
                                    ConexionSFTP.subirArchivo(filepath, filename);
                                }
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show(ex.Message);
                                throw;
                            }
                            MessageBox.Show("Registro exitoso.");
                            limpiarCampos();
                        }
                        else
                        {
                            MessageBox.Show("Debe seleccionar al menos 3 fotografías.");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Debe elegir al menos un vehículo.");
                    }
                }
                else
                {
                    MessageBox.Show("Debe elegir al menos un Conductor");
                }
            }
            else
            {
                MessageBox.Show("Asegúrese de llenar todos los campos.");
            }
        }
示例#19
0
 public abstract Simbolo evaluar(Entorno entorno, Reporte reporte);
示例#20
0
 public int SaveReporte(Reporte entity)
 {
     return(ReporteDao.Save(entity));
 }
示例#21
0
 public override object ejecutar(Entorno entorno, Reporte reporte)
 {
     throw new NotImplementedException();
 }
示例#22
0
 public void UpdateReporte(Reporte entity)
 {
     ReporteDao.Update(entity);
 }
示例#23
0
    protected void btnGenerarReporte_Click(object sender, EventArgs e)
    {
        DateTime?fechaInicioProduccion = null;
        DateTime?fechaFinProduccion    = null;
        string   companias             = Utils.ObtenerIdsSeleccionados(lbxCompania);
        string   consolidarPor         = Utils.ObtenerIdsSeleccionados(lbxConsolidar);
        string   configuracionReporte  = "";
        string   filtros = "";

        if (txtFechaInicioProduccion.Text != "")
        {
            fechaInicioProduccion = DateTime.ParseExact(txtFechaInicioProduccion.Text, "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture);
            filtros += "Fecha Inicio: " + fechaInicioProduccion.Value.ToString("yyyy-MM") + "; ";
        }
        if (txtFechaFinProduccion.Text != "")
        {
            fechaFinProduccion = DateTime.ParseExact(txtFechaFinProduccion.Text, "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture);
            filtros           += "Fecha Fin: " + fechaFinProduccion.Value.ToString("yyyy-MM") + "; ";
        }
        if (!("," + companias + ",").Contains(",ALL,"))
        {
            filtros += "Compañías: " + Utils.ObtenerTextosSeleccionados(lbxCompania) + "; ";
        }
        filtros = filtros.TrimEnd(new char[] { ';', ' ' });
        if (!String.IsNullOrEmpty(filtros))
        {
            filtros = "FILTROS - " + filtros;
        }

        if (("," + consolidarPor + ",").Contains(",ALL,"))
        {
            configuracionReporte += "MOSTRAR_COLUMNA_MESES=1,MOSTRAR_COLUMNA_DEPARTAMENTO=1,MOSTRAR_COLUMNA_AGENCIA=1,MOSTRAR_COLUMNA_COMPAÑIA=1,MOSTRAR_COLUMNA_PRODUCTO=1,";
        }
        else
        {
            if (("," + consolidarPor + ",").Contains(",MESES,"))
            {
                configuracionReporte += "MOSTRAR_COLUMNA_MESES=1,";
            }
            if (("," + consolidarPor + ",").Contains(",DEPARTAMENTO,"))
            {
                configuracionReporte += "MOSTRAR_COLUMNA_DEPARTAMENTO=1,";
            }
            if (("," + consolidarPor + ",").Contains(",AGENCIA,"))
            {
                configuracionReporte += "MOSTRAR_COLUMNA_AGENCIA=1,";
            }
            if (("," + consolidarPor + ",").Contains(",COMPAÑIA,"))
            {
                configuracionReporte += "MOSTRAR_COLUMNA_COMPAÑIA=1,";
            }
            if (("," + consolidarPor + ",").Contains(",PRODUCTO,"))
            {
                configuracionReporte += "MOSTRAR_COLUMNA_PRODUCTO=1,";
            }
        }
        DataTable dsReporte = Reporte.GenerarEstadisticasProduccionSegurosBolivar(companias, fechaInicioProduccion, fechaFinProduccion);

        Utils.DeshabilitarFormatoExportacion(rvReporte, new string[] { "PDF", "WORD", "WORDOPENXML" });

        rvReporte.ProcessingMode         = ProcessingMode.Local;
        rvReporte.LocalReport.ReportPath = Server.MapPath("~/App_Code/Reportes/EstadisticasProduccionSegurosBolivar.rdlc");

        ReportParameter configuracionParameter = new ReportParameter("Configuraciones", configuracionReporte);

        rvReporte.LocalReport.SetParameters(new ReportParameter[] { configuracionParameter });
        ReportParameter filtrosParameter = new ReportParameter("Filtros", filtros);

        rvReporte.LocalReport.SetParameters(new ReportParameter[] { filtrosParameter });

        ReportDataSource datasourceResultado1 = new ReportDataSource("dsReporte", dsReporte);

        rvReporte.LocalReport.DataSources.Clear();
        rvReporte.LocalReport.DataSources.Add(datasourceResultado1);
    }
        /// <summary>
        /// Obtiene listado de delitos obteniendo la cantidad de delitos por grupos dependiendo del Fuero-Titulo-Grupo
        /// Si no selecciona ningun fuero se filtran todos los delitos  con sus titulos y grupos relacionados a todos los ingresos del rango de fechas
        /// si se filtra por un fuero
        /// Filtra dependiendo si se selecciono algun filtro
        /// </summary>
        private void ObtenerCatidaPorGrupos(IQueryable <CAUSA_PENAL_DELITO> LstCausaPenalDelito, short?Titulo_Seleccionado = null, short?Grupo_Seleccionado = null)
        {
            try
            {
                var datosReporte = new List <cReporteDatos>();
                datosReporte.Add(new cReporteDatos()
                {
                    Encabezado1 = !string.IsNullOrEmpty(Parametro.ENCABEZADO1) ? Parametro.ENCABEZADO1.Trim() : string.Empty,
                    Encabezado2 = !string.IsNullOrEmpty(Parametro.ENCABEZADO2) ? Parametro.ENCABEZADO2.Trim() : string.Empty,
                    Encabezado3 = !string.IsNullOrEmpty(Parametro.ENCABEZADO3) ? Parametro.ENCABEZADO3.Trim() : string.Empty,

                    Logo1 = Parametro.REPORTE_LOGO1,
                    Logo2 = Parametro.REPORTE_LOGO2,
                    // Centro = centro.DESCR.Trim().ToUpper(),
                });

                var Delito = new cDelito();
                var datosReporteAltoImpacto = new List <ReporteAltoImpacto>();

                foreach (var itemDelitos in LstCausaPenalDelito)
                {
                    if (Titulo_Seleccionado > -1)
                    {
                        //****Verifica que exista el delito de los  ingresos filtrado anteriormente por fechas  y que el titulo sea igual al que se selecciono en el combobox y se filtra tambien por grupo_delito en caso de que el usuario lo selecciono
                        var DelitosFiltrado = Grupo_Seleccionado > -1 ? Delito.ObtenerTodos().Where(w => w.ID_DELITO == itemDelitos.ID_DELITO && w.ID_TITULO == Titulo_Seleccionado && w.ID_GRUPO_DELITO == Grupo_Seleccionado).FirstOrDefault() : Delito.ObtenerTodos().Where(w => w.ID_DELITO == itemDelitos.ID_DELITO && w.ID_TITULO == Titulo_Seleccionado).FirstOrDefault();
                        if (DelitosFiltrado != null)
                        {//****si existe se guarda en la lista
                            var AltoImactos = new ReporteAltoImpacto();
                            AltoImactos.Delito      = itemDelitos.DESCR_DELITO;
                            AltoImactos.Fuero       = DelitosFiltrado.DELITO_GRUPO != null ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO != null ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.FUERO != null ? !string.IsNullOrEmpty(DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.FUERO.DESCR) ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.FUERO.DESCR.Trim() : string.Empty : string.Empty : string.Empty : string.Empty;
                            AltoImactos.Titulo      = DelitosFiltrado.DELITO_GRUPO != null ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO != null ? !string.IsNullOrEmpty(DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.DESCR) ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.DESCR.Trim() : string.Empty : string.Empty : string.Empty;
                            AltoImactos.GrupoDelito = DelitosFiltrado.DELITO_GRUPO != null ? !string.IsNullOrEmpty(DelitosFiltrado.DELITO_GRUPO.DESCR) ? DelitosFiltrado.DELITO_GRUPO.DESCR.Trim() : string.Empty : string.Empty;
                            AltoImactos.FechaInicio = TextFechaInicio.HasValue ? TextFechaInicio.Value.ToString("dd/MM/yyyy") : string.Empty;
                            AltoImactos.FechaFin    = TextFechaFin.HasValue ? TextFechaFin.Value.ToString("dd/MM/yyyy") : string.Empty;
                            string FUERO  = !string.IsNullOrEmpty(AltoImactos.Fuero) ? AltoImactos.Fuero.Trim() : "";
                            string TITULO = !string.IsNullOrEmpty(AltoImactos.Titulo) ? AltoImactos.Titulo.Trim() : "";
                            AltoImactos.TITULO_FUERO_DESCRTITULO = "REINGRESOS DEL FUERO " + FUERO + ",POR " + TITULO;
                            datosReporteAltoImpacto.Add(AltoImactos);
                        }
                    }
                    else
                    {//***cuando el usuario no selecciono ningun filtro de titulo y grupo
                        //****Se hace consulta a la tabla delito para obtener la descripciones del titulo y grupos
                        var DelitosFiltrado = Delito.ObtenerTodos().Where(w => w.ID_DELITO == itemDelitos.ID_DELITO).FirstOrDefault();
                        if (DelitosFiltrado != null)
                        {
                            var AltoImactos = new ReporteAltoImpacto();
                            AltoImactos.Delito      = itemDelitos.DESCR_DELITO;
                            AltoImactos.Fuero       = DelitosFiltrado.DELITO_GRUPO != null ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO != null ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.FUERO != null ? !string.IsNullOrEmpty(DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.FUERO.DESCR) ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.FUERO.DESCR.Trim() : string.Empty : string.Empty : string.Empty : string.Empty;
                            AltoImactos.Titulo      = DelitosFiltrado.DELITO_GRUPO != null ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO != null ? !string.IsNullOrEmpty(DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.DESCR) ? DelitosFiltrado.DELITO_GRUPO.DELITO_TITULO.DESCR.Trim() : string.Empty : string.Empty : string.Empty;
                            AltoImactos.GrupoDelito = DelitosFiltrado.DELITO_GRUPO != null ? !string.IsNullOrEmpty(DelitosFiltrado.DELITO_GRUPO.DESCR) ? DelitosFiltrado.DELITO_GRUPO.DESCR.Trim() : string.Empty : string.Empty;
                            AltoImactos.FechaInicio = TextFechaInicio.HasValue ? TextFechaInicio.Value.ToString("dd/MM/yyyy") : string.Empty;
                            AltoImactos.FechaFin    = TextFechaFin.HasValue ? TextFechaFin.Value.ToString("dd/MM/yyyy") : string.Empty;
                            string FUERO  = !string.IsNullOrEmpty(AltoImactos.Fuero) ? AltoImactos.Fuero.Trim() : "";
                            string TITULO = !string.IsNullOrEmpty(AltoImactos.Titulo) ? AltoImactos.Titulo.Trim() : "";
                            AltoImactos.TITULO_FUERO_DESCRTITULO = "REINGRESOS DEL FUERO " + FUERO + ",POR " + TITULO;
                            datosReporteAltoImpacto.Add(AltoImactos);
                        }
                    }
                }

                //**Validacion si no existen registros
                //if (datosReporteAltoImpacto.Count == 0)
                //    Application.Current.Dispatcher.Invoke((Action)(delegate
                //    {
                //        Reporte.Clear();
                //        Reporte.LocalReport.DataSources.Clear();

                //    }));
                //else
                //{
                #region Reporte
                Reporte.LocalReport.ReportPath = "Reportes/rAltoImpacto.rdlc";
                Reporte.LocalReport.DataSources.Clear();

                Microsoft.Reporting.WinForms.ReportDataSource rds1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = datosReporteAltoImpacto;
                Reporte.LocalReport.DataSources.Add(rds1);

                Microsoft.Reporting.WinForms.ReportDataSource rds2 = new Microsoft.Reporting.WinForms.ReportDataSource();
                rds2.Name  = "DataSet2";
                rds2.Value = datosReporte;
                Reporte.LocalReport.DataSources.Add(rds2);


                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.RefreshReport();
                }));
                #endregion
                //}
            }

            catch (Exception exc)
            {
                throw exc;
            }
        }
        public JsonResult Consultar(string fechaDesde, string fechaHasta, string tipoReporte, string idObjeto)
        {
            DateTime fDesde = Convert.ToDateTime(fechaDesde);
            DateTime fHasta = DateTime.Now;

            if (!String.IsNullOrEmpty(fechaHasta))
            {
                fHasta = Convert.ToDateTime(fechaHasta);
            }
            decimal consumo = 0;

            switch (tipoReporte.ToLower())
            {
            case "hogar":
                consumo = Reporte.consumoPorHogarYPeriodo(Convert.ToInt32(idObjeto), fDesde, fHasta);

                dBContext = new MongoDBContext();
                reporteClienteColeccion = dBContext.database.GetCollection <ReporteCliente>("clientePorPeriodo");

                int busquedaHistoricoHogar = 0;
                busquedaHistoricoHogar = (from t in reporteClienteColeccion.AsQueryable <ReporteCliente>()
                                          where t.IdUsuario == idObjeto &&
                                          t.FechaDesde == fDesde.ToShortDateString() &&
                                          (t.FechaHasta == fHasta.ToShortDateString() ||
                                           t.FechaHasta == DateTime.Now.ToShortDateString()) &&
                                          t.Consumo == consumo
                                          select t).Count();

                if (busquedaHistoricoHogar == 0)
                {
                    reporteCliente.IdUsuario  = idObjeto;
                    reporteCliente.FechaDesde = fDesde.ToShortDateString();
                    reporteCliente.FechaHasta = fHasta.ToShortDateString();
                    reporteCliente.Consumo    = consumo;

                    reporteClienteColeccion.InsertOne(reporteCliente);
                }
                break;

            case "tiposdisp":
                consumo = Reporte.consumoPorTipoDeDispositivoPorPeriodo(idObjeto, fDesde, fHasta);

                dBContext = new MongoDBContext();
                reporteDispositivoColeccion = dBContext.database.GetCollection <ReporteDispositivo>("dispositivoPorPeriodo");

                int busquedaHistoricoDispo = 0;
                busquedaHistoricoDispo = (from t in reporteDispositivoColeccion.AsQueryable <ReporteDispositivo>()
                                          where t.Tipo == idObjeto &&
                                          t.FechaDesde == fDesde.ToShortDateString() &&
                                          (t.FechaHasta == fHasta.ToShortDateString() ||
                                           t.FechaHasta == DateTime.Now.ToShortDateString()) &&
                                          t.Consumo == consumo
                                          select t).Count();

                if (busquedaHistoricoDispo == 0)
                {
                    reporteDispositivo.Tipo       = idObjeto;
                    reporteDispositivo.FechaDesde = fDesde.ToShortDateString();
                    reporteDispositivo.FechaHasta = fHasta.ToShortDateString();
                    reporteDispositivo.Consumo    = consumo;

                    reporteDispositivoColeccion.InsertOne(reporteDispositivo);
                }
                break;

            case "transformador":
                consumo = Reporte.consumoTransformadorPorPeriodo(Convert.ToInt32(idObjeto), fDesde, fHasta);

                dBContext = new MongoDBContext();
                reporteTransformadorColeccion = dBContext.database.GetCollection <ReporteTransformador>("transformadorPorPeriodo");
                int busquedaHistoricoTrans = 0;
                busquedaHistoricoTrans = (from t in reporteTransformadorColeccion.AsQueryable <ReporteTransformador>()
                                          where  t.Codigo == Convert.ToInt32(idObjeto) &&
                                          t.FechaDesde == fDesde.ToShortDateString() &&
                                          (t.FechaHasta == fHasta.ToShortDateString() ||
                                           t.FechaHasta == DateTime.Now.ToShortDateString()) &&
                                          t.Consumo == consumo
                                          select t).Count();

                if (busquedaHistoricoTrans == 0)
                {
                    reporteCreado.Codigo     = Convert.ToInt32(idObjeto);
                    reporteCreado.FechaDesde = fDesde.ToShortDateString();
                    reporteCreado.FechaHasta = fHasta.ToShortDateString();
                    reporteCreado.Consumo    = consumo;

                    reporteTransformadorColeccion.InsertOne(reporteCreado);     //inserta documentos a la coleccion especificada
                }

                break;

            default:
                return(Json(new { success = false, error = "No se reconoce el tipo de reporte" }));
            }

            return(Json(new { success = true, resultado = consumo, tipoReporte = tipoReporte }));
        }
示例#26
0
        public void ReporteAnual(Office.IRibbonControl control)
        {
            var addIn = Globals.ThisAddIn;

            var               fecha         = DateTime.Now.ToShortDateString();
            var               value         = fecha;
            const char        delimite      = '/';
            var               substrings    = value.Split(delimite);
            var               year          = substrings[2];
            var               fechainicial  = "01/01/" + year;
            var               fechafinal    = "12/31/" + year;
            var               date1         = DateTime.Parse(fechainicial, CultureInfo.InvariantCulture);
            var               date2         = DateTime.Parse(fechafinal, CultureInfo.InvariantCulture);
            var               datosAnual    = new List <DatosAnual>();
            var               datosGanador  = new List <DatosAnual>();
            var               datosPerdedor = new List <DatosAnual>();
            var               datosTrade    = new List <DatosAnual>();
            var               datosExito    = new List <DatosAnual>();
            List <DatosAnual> datosFracaso;
            var               times = new General
            {
                FechaIni = Convert.ToDateTime(date1),
                FechaFin = Convert.ToDateTime(date2)
            };

            Opcion.EjecucionAsync(x =>
            {
                Reporte.ReporteAnual(x, times);
            }, jsonResult =>
            {
                if (jsonResult != null)
                {
                    datosAnual = Opcion.JsonaListaGenerica <DatosAnual>(jsonResult).ToList();
                }
                else
                {
                    MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                }

                Opcion.EjecucionAsync(y =>
                {
                    Reporte.SeleccionarTradeGanador(y, times);
                }, jsonResu =>
                {
                    if (jsonResu != null)
                    {
                        datosGanador = Opcion.JsonaListaGenerica <DatosAnual>(jsonResu).ToList();
                    }
                    else
                    {
                        MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                    }
                    Opcion.EjecucionAsync(z =>
                    {
                        Reporte.SeleccionarTradePerdedor(z, times);
                    }, jsonR =>
                    {
                        if (jsonR != null)
                        {
                            datosPerdedor = Opcion.JsonaListaGenerica <DatosAnual>(jsonR).ToList();
                        }
                        else
                        {
                            MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                        }
                        Opcion.EjecucionAsync(z =>
                        {
                            Reporte.TradesAgrupados(z, times);
                        }, jsonRe =>
                        {
                            if (jsonRe != null)
                            {
                                datosTrade = Opcion.JsonaListaGenerica <DatosAnual>(jsonRe).ToList();
                            }
                            else
                            {
                                MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                            }
                            Opcion.EjecucionAsync(z =>
                            {
                                Reporte.SeleccionarRazonExito(z, times);
                            }, json =>
                            {
                                if (json != null)
                                {
                                    datosExito = Opcion.JsonaListaGenerica <DatosAnual>(json).ToList();
                                }
                                else
                                {
                                    MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                                }
                                Opcion.EjecucionAsync(z =>
                                {
                                    Reporte.SeleccionarRazonFracaso(z, times);
                                }, jso =>
                                {
                                    if (jso != null)
                                    {
                                        datosFracaso = Opcion.JsonaListaGenerica <DatosAnual>(jso).ToList();
                                        addIn.ReporteAnual(datosAnual, datosGanador, datosPerdedor, datosTrade, datosExito, datosFracaso);
                                    }
                                    else
                                    {
                                        MessageBox.Show(@"No se encontro informacion con los paramentro de busqueda");
                                    }
                                });
                            });
                        });
                    });
                });
            });
        }
        public void GenerarReporte()
        {
            var Centro = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();

            try
            {
                List <cReporteEdificio>        lEdificio = new List <cReporteEdificio>();
                List <cReporteSector>          lSector   = new List <cReporteSector>();
                List <cBrazaleteGafeteInterno> internos  = new List <cBrazaleteGafeteInterno>();

                if (SelectedEdificio.ID_EDIFICIO == TODOS_LOS_EDIFICIOS)
                {
                    lEdificio.Add(new cReporteEdificio {
                        Descr = "TODOS LOS EDIFICIOS", IdCentro = GlobalVar.gCentro, IdEdificio = TODOS_LOS_EDIFICIOS
                    });
                }
                else
                {
                    lEdificio.Add(new cReporteEdificio {
                        Descr = SelectedEdificio.DESCR, IdCentro = SelectedEdificio.ID_CENTRO, IdEdificio = SelectedEdificio.ID_EDIFICIO
                    });
                }

                if (SelectedEdificio.ID_EDIFICIO == TODOS_LOS_EDIFICIOS)
                {
                    lSector.Add(new cReporteSector {
                        Descr = "TODOS LOS SECTORES", IdCentro = GlobalVar.gCentro
                    });
                }
                else
                {
                    if (SelectedSector.ID_SECTOR == TODOS_LOS_SECTORES)
                    {
                        lSector.Add(new cReporteSector {
                            Descr = "TODOS LOS SECTORES", IdCentro = GlobalVar.gCentro
                        });
                    }
                    else
                    {
                        lSector.Add(new cReporteSector {
                            Descr = SelectedSector.DESCR, IdCentro = GlobalVar.gCentro, IdEdificio = SelectedEdificio.ID_EDIFICIO, IdSector = SelectedSector.ID_SECTOR
                        });
                    }
                }
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte = Ventana.ReportCredencialBiblioteca;
                    Reporte.LocalReport.ReportPath = "Reportes/rCredencialBiblioteca.rdlc";
                    Reporte.LocalReport.DataSources.Clear();
                    Microsoft.Reporting.WinForms.ReportDataSource ReportDataSource_CredencialBiblioteca = new Microsoft.Reporting.WinForms.ReportDataSource();
                    ReportDataSource_CredencialBiblioteca.Name = "DataSet1";
                    ReportDataSource_CredencialBiblioteca.Value = ListaIngresosSeleccionados;
                    Reporte.LocalReport.DataSources.Add(ReportDataSource_CredencialBiblioteca);

                    Reporte.Refresh();
                    Reporte.RefreshReport();
                }));
            }
            catch (Exception ex)
            {
                throw new ApplicationException(ex.Message);
            }
        }
示例#28
0
 // ReSharper disable once FunctionComplexityOverflow
 public void GuardarDatos(Office.IRibbonControl control)
 {
     try
     {
         string name = Globals.ThisAddIn.Application.ActiveSheet.Name;
         if (name.Equals(@"ResumenMensual"))
         {
             //var mse = new MensajeDeEspera(() =>
             //{
             //    DialogResult continuarCancelacion = MessageBox.Show(@"¿Desea detener la operación?",
             //    @"Alerta",
             //    MessageBoxButtons.YesNoCancel,
             //    MessageBoxIcon.Question);
             //    cancelar = continuarCancelacion == DialogResult.Yes;
             //    return cancelar;
             //});
             //mse.Show();
             var sheet = Globals.ThisAddIn.Application.ActiveSheet;
             //var nInLastRow = sheet.Cells.Find("*", Missing.Value, Missing.Value, Missing.Value, XlSearchOrder.xlByRows,
             //   XlSearchDirection.xlPrevious, false, Missing.Value, Missing.Value)
             //    .Row;
             object[,] value  = sheet.Range["B7", "M11"].Value;
             object[,] value1 = sheet.Range["B16", "M20"].Value;
             object[,] value2 = sheet.Range["B25", "M29"].Value;
             object[,] value3 = sheet.Range["B34", "M38"].Value;
             object[,] value4 = sheet.Range["B43", "M47"].Value;
             var lista = new List <Guardar>();
             for (var x = 1; x <= (value.Length / 12); x++)
             {
                 Dato  = value[x, 10] == null ? "" : value[x, 10].ToString();
                 Dato2 = value[x, 11] == null ? "" : value[x, 11].ToString();
                 var id           = value[x, 12] == null ? "" : value[x, 12].ToString();
                 var fechaguardar = Convert.ToDateTime(value[x, 1]).ToString("yyyy-MM-dd");
                 {
                     if (value[x, 1] != null && value[x, 2] != null && value[x, 3] != null && value[x, 5] != null &&
                         value[x, 6] != null)
                     {
                         lista.Add(new Guardar
                         {
                             Fecha     = fechaguardar,
                             TipoTrade = value[x, 2].ToString(),
                             Proceso   = value[x, 3].ToString(),
                             Direccion = value[x, 5].ToString(),
                             Puntos    = Convert.ToDouble(value[x, 6]),
                             Exito     = Dato,
                             Fracaso   = Dato2,
                             Id        = id
                         });
                     }
                 }
             }
             for (var x = 1; x <= (value1.Length / 12); x++)
             {
                 Dato  = value1[x, 10] == null ? "" : value1[x, 10].ToString();
                 Dato2 = value1[x, 11] == null ? "" : value1[x, 11].ToString();
                 var id           = value1[x, 12] == null ? "" : value1[x, 12].ToString();
                 var fechaguardar = Convert.ToDateTime(value1[x, 1]).ToString("yyyy-MM-dd");
                 {
                     if (value1[x, 1] != null && value1[x, 2] != null && value1[x, 3] != null && value1[x, 5] != null &&
                         value1[x, 6] != null)
                     {
                         lista.Add(new Guardar
                         {
                             Fecha     = fechaguardar,
                             TipoTrade = value1[x, 2].ToString(),
                             Proceso   = value1[x, 3].ToString(),
                             Direccion = value1[x, 5].ToString(),
                             Puntos    = Convert.ToDouble(value1[x, 6]),
                             Exito     = Dato,
                             Fracaso   = Dato2,
                             Id        = (id)
                         });
                     }
                 }
             }
             for (var x = 1; x <= (value2.Length / 12); x++)
             {
                 Dato  = value2[x, 10] == null ? "" : value2[x, 10].ToString();
                 Dato2 = value2[x, 11] == null ? "" : value2[x, 11].ToString();
                 var id           = value2[x, 12] == null ? "" : value2[x, 12].ToString();
                 var fechaguardar = Convert.ToDateTime(value2[x, 1]).ToString("yyyy-MM-dd");
                 {
                     if (value2[x, 1] != null && value2[x, 2] != null && value2[x, 3] != null && value2[x, 5] != null &&
                         value2[x, 6] != null)
                     {
                         lista.Add(new Guardar
                         {
                             Fecha     = fechaguardar,
                             TipoTrade = value2[x, 2].ToString(),
                             Proceso   = value2[x, 3].ToString(),
                             Direccion = value2[x, 5].ToString(),
                             Puntos    = Convert.ToDouble(value2[x, 6]),
                             Exito     = Dato,
                             Fracaso   = Dato2,
                             Id        = (id)
                         });
                     }
                 }
             }
             for (var x = 1; x <= (value3.Length / 12); x++)
             {
                 Dato  = value3[x, 10] == null ? "" : value3[x, 10].ToString();
                 Dato2 = value3[x, 11] == null ? "" : value3[x, 11].ToString();
                 var id           = value3[x, 12] == null ? "" : value3[x, 12].ToString();
                 var fechaguardar = Convert.ToDateTime(value3[x, 1]).ToString("yyyy-MM-dd");
                 {
                     if (value3[x, 1] != null && value3[x, 2] != null && value3[x, 3] != null && value3[x, 5] != null &&
                         value3[x, 6] != null)
                     {
                         lista.Add(new Guardar
                         {
                             Fecha     = fechaguardar,
                             TipoTrade = value3[x, 2].ToString(),
                             Proceso   = value3[x, 3].ToString(),
                             Direccion = value3[x, 5].ToString(),
                             Puntos    = Convert.ToDouble(value3[x, 6]),
                             Exito     = Dato,
                             Fracaso   = Dato2,
                             Id        = id
                         });
                     }
                 }
             }
             for (var x = 1; x <= (value4.Length / 12); x++)
             {
                 Dato  = value4[x, 10] == null ? "" : value4[x, 10].ToString();
                 Dato2 = value4[x, 11] == null ? "" : value4[x, 11].ToString();
                 var fechaguardar = Convert.ToDateTime(value4[x, 1]).ToString("yyyy-MM-dd");
                 var id           = value4[x, 12] == null ? "" : value4[x, 12].ToString();
                 {
                     if (value4[x, 1] != null && value4[x, 2] != null && value4[x, 3] != null && value4[x, 5] != null &&
                         value4[x, 6] != null)
                     {
                         lista.Add(new Guardar
                         {
                             Fecha     = fechaguardar,
                             TipoTrade = value4[x, 2].ToString(),
                             Proceso   = value4[x, 3].ToString(),
                             Direccion = value4[x, 5].ToString(),
                             Puntos    = Convert.ToDouble(value4[x, 6]),
                             Exito     = Dato,
                             Fracaso   = Dato2,
                             Id        = id
                         });
                     }
                 }
             }
             // ReSharper disable once ForCanBeConvertedToForeach
             for (var i = 0; i < lista.Count; i++)
             {
                 if (lista[i].Id == "" && lista[i].Fecha != null && lista[i].TipoTrade != null && lista[i].Proceso != null &&
                     lista[i].Direccion != null)
                 {
                     var listaguardar = new Guardar
                     {
                         Fecha     = lista[i].Fecha,
                         TipoTrade = lista[i].TipoTrade,
                         Proceso   = lista[i].Proceso,
                         Direccion = lista[i].Direccion,
                         Puntos    = lista[i].Puntos,
                         Exito     = lista[i].Exito,
                         Fracaso   = lista[i].Fracaso
                     };
                     Opcion.EjecucionAsync(x =>
                     {
                         Reporte.Guardado(x, listaguardar);
                     }, resultado =>
                     {
                     });
                 }
                 else if ((lista[i].Id != null && lista[i].Fecha != null && lista[i].TipoTrade != null && lista[i].Proceso != null &&
                           lista[i].Direccion != null))
                 {
                     var listaguardar = new Guardar
                     {
                         Id        = lista[i].Id,
                         Fecha     = lista[i].Fecha,
                         TipoTrade = lista[i].TipoTrade,
                         Proceso   = lista[i].Proceso,
                         Direccion = lista[i].Direccion,
                         Puntos    = lista[i].Puntos,
                         Exito     = lista[i].Exito,
                         Fracaso   = lista[i].Fracaso
                     };
                     Reporte.Actualizar(listaguardar);
                 }
             }
             MessageBox.Show(@"La informacion se a guardado correctamente");
         }
         else
         {
             throw new Exception(
                       @"Debes escoger la hoja de trabajo 'ResumenMensual' para seleccionar esta opción.");
         }
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }
示例#29
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            //Si se presiona el botón f1 instancia el form de ayuda, y cierra la ventana de simulación
            if (Keyboard.GetState().IsKeyDown(Keys.F1))
            {
                Ayuda form = new Ayuda();

                form.Show();
                form.Refresh();
                this.Exit();
            }
            // si se activa la simulación empieza a ejecutar el método UpDate de la entidad
            if (Iniciar.Pressed() && !active && ellapsedTimeButton > delayStartButton)
            {
                ellapsedTimeButton = 0;
                this.active        = true;
                Iniciar.input      = "pausar";
                int vx, vy, ax, ay;
                if (tbVelocidadX.input == "")
                {
                    vx = 0;
                }
                else
                {
                    vx = int.Parse(tbVelocidadX.input);
                }

                if (tbVelocidadY.input == "")
                {
                    vy = 0;
                }
                else
                {
                    vy = int.Parse(tbVelocidadY.input);
                }

                if (tbAceleracionX.input == "")
                {
                    ax = 0;
                }
                else
                {
                    ax = int.Parse(tbAceleracionX.input);
                }
                if (tbAceleracionY.input == "")
                {
                    ay = 0;
                }
                else
                {
                    ay = int.Parse(tbAceleracionY.input);
                }



                entity.Initialize(new Vector2(0, 150),
                                  new Vector2(vx, vy),
                                  new Vector2(ax, ay),
                                  new Rectangle(),
                                  0.0f);
                entity.InitializeHistory();
            }
            //Si se se presiona el botón PAUSAR, se reinicia el botón y se desactiva la simulación
            if (active && Iniciar.Pressed() && ellapsedTimeButton > delayStartButton)
            {
                this.active        = false;
                Iniciar.input      = "iniciar";
                ellapsedTimeButton = 0;
            }

            ellapsedTimeButton += gameTime.ElapsedGameTime.Milliseconds;

            if (active)
            {
                entity.Update(gameTime);
            }
            //text.input = i.ToString();
            //Si no está activa la simulación, permite abrir el buffer para la entrada de los datos a los text boxes.
            if (!active)
            {
                tbAceleracionX.TurnOnBuffer();
                tbAceleracionY.TurnOnBuffer();
                tbVelocidadX.TurnOnBuffer();
                tbVelocidadY.TurnOnBuffer();
            }

            //Si se presiona el botón de VER REPORTE, se instancia el form de reportes, y se cierra la ventana de simulación
            if (Reporte.Pressed() && !active && ellapsedTimeButton > delayStartButton)
            {
                ellapsedTimeButton = 0;
                form = new Reportes(entity.History);

                form.Show();
                form.Refresh();
                this.Exit();
            }

            // mousex.input = Mouse.GetState().X.ToString();
            //mousey.input = Mouse.GetState().Y.ToString();
            if (entity.position.X > 1300 || entity.position.Y > 950)
            {
                this.active        = false;
                Iniciar.input      = "iniciar";
                ellapsedTimeButton = 0;
            }
            base.Update(gameTime);
        }
示例#30
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                Reporte ds = new Reporte();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "tblStudentDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }
示例#31
0
 public void TestResumenListaVaciaFormasEnIngles()
 {
     Assert.AreEqual("<h1>Empty list of shapes!</h1>",
                     Reporte.Imprimir(new List <IFormaGeometrica>(), new Ingles()));
 }
示例#32
0
 /// <summary>
 /// Obtener los datos de una consulta para la generación de un gráfico asociado a un reporte.
 /// </summary>
 /// <param name="i">Fecha incial para la cual se desea delimitar la consulta asociada al gráfico</param>
 /// <param name="f">Fecha final para la cual se desea delimitar la consulta asociada al gráfico</param>
 /// <param name="a">Área para la cual se genera el gráfico</param>
 /// <param name="g">Gráfico para el cual se ejecuta la consulta</param>
 /// <param name="r">Reporte al cual está asociado el gráfico</param>
 /// <returns>Tabla con los datos devueltos por la consulta</returns>
 public DataTable obtenerDatosGrafico(DateTime i, DateTime f, Areas a, Grafico g, Reporte r)
 {
     try
     {
         return(_reportes.obtenerDatosGrafico(i, f, a, g, r));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void GenerarReporte()
        {
            try
            {
                var centro = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();

                var datosReporte = new List <cReporteDatos>();
                datosReporte.Add(new cReporteDatos()
                {
                    Encabezado1 = Parametro.ENCABEZADO1.Trim(),
                    Encabezado2 = Parametro.ENCABEZADO2.Trim(),
                    Encabezado3 = Parametro.ENCABEZADO3.Trim(),
                    Titulo      = "LISTA GRUPO " + LstActividad.Where(w => w.ID_ACTIVIDAD == SelectedActividad).FirstOrDefault().DESCR,
                    Logo1       = Parametro.REPORTE_LOGO1,
                    Logo2       = Parametro.REPORTE_LOGO2,
                    Centro      = centro.DESCR.Trim().ToUpper(),
                });

                #region Reporte
                Reporte.LocalReport.ReportPath = "Reportes/rGrupoActivos.rdlc";
                Reporte.LocalReport.DataSources.Clear();

                var rds2 = new Microsoft.Reporting.WinForms.ReportDataSource();
                rds2.Name  = "DataSet2";
                rds2.Value = datosReporte;
                Reporte.LocalReport.DataSources.Add(rds2);

                var rds1 = new Microsoft.Reporting.WinForms.ReportDataSource();
                rds1.Name  = "DataSet1";
                rds1.Value = new List <ReporteListaGruposActivos>()
                {
                    new ReporteListaGruposActivos()
                    {
                        Actividad = LstActividad.Where(w => w.ID_ACTIVIDAD == SelectedActividad).FirstOrDefault().DESCR,
                        Eje       = LstEje.Where(w => w.ID_EJE == SelectedEje).FirstOrDefault().DESCR,
                        Programa  = LstPrograma.Where(w => w.ID_TIPO_PROGRAMA == SelectedPrograma).FirstOrDefault().NOMBRE
                    }
                };
                Reporte.LocalReport.DataSources.Add(rds1);

                var rds3 = new Microsoft.Reporting.WinForms.ReportDataSource();
                rds3.Name  = "DataSet3";
                rds3.Value = new cGrupo().GetData().Where(w => w.ID_EJE == SelectedEje && w.ID_TIPO_PROGRAMA == SelectedPrograma && w.ID_ACTIVIDAD == SelectedActividad && w.ID_ESTATUS_GRUPO == 1).AsEnumerable().Select(s => new ReporteDetalleGruposActivos
                {
                    Grupo        = s.DESCR,
                    Responsable  = (s.PERSONA.PATERNO != null ? s.PERSONA.PATERNO.Trim() : string.Empty) + " " + (s.PERSONA.MATERNO != null ? s.PERSONA.MATERNO.Trim() : string.Empty) + " " + (s.PERSONA.NOMBRE != null ? s.PERSONA.NOMBRE.Trim() : string.Empty),
                    Fecha_Inicio = s.GRUPO_HORARIO.OrderBy(o => o.HORA_INICIO).FirstOrDefault().HORA_INICIO.Value.ToShortDateString(),
                    Fecha_Fin    = s.GRUPO_HORARIO.OrderByDescending(o => o.HORA_TERMINO).FirstOrDefault().HORA_TERMINO.Value.ToShortDateString(),
                    Departamento = s.CENTRO_DEPARTAMENTO.DEPARTAMENTO.DESCR,
                    Recurrencia  = s.RECURRENCIA
                });
                Reporte.LocalReport.DataSources.Add(rds3);



                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.RefreshReport();
                }));
                #endregion
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al generar reporte", ex);
            }
        }
示例#34
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["usuario"] == null)
        {
            Response.RedirectToRoute("thor");
        }
        if (!IsPostBack)
        {
            DataTable dtCompanias = new DataTable();
            dtCompanias = Reporte.ListarCompanias();
            lbxCompania.DataTextField  = "com_Nombre";
            lbxCompania.DataValueField = "com_Id";
            lbxCompania.DataSource     = dtCompanias;
            lbxCompania.DataBind();
            lbxCompania.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtProductos = new DataTable();
            dtProductos = Reporte.ListarProductosPorFiltros("ALL");
            lbxProducto.DataTextField  = "pro_Nombre";
            lbxProducto.DataValueField = "pro_Nombre";
            lbxProducto.DataSource     = dtProductos;
            lbxProducto.DataBind();
            lbxProducto.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtPagadurias = new DataTable();
            dtPagadurias = Reporte.ListarPagaduriasPorFiltros("ALL", "ALL");
            lbxPagadurias.DataTextField  = "paga_Nombre";
            lbxPagadurias.DataValueField = "paga_Nombre";
            lbxPagadurias.DataSource     = dtPagadurias;
            lbxPagadurias.DataBind();
            lbxPagadurias.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtEstadoNegocios = new DataTable();
            dtEstadoNegocios = Reporte.ListarEstadosNegocioCertificados();
            lbxEstadoNegocio.DataTextField  = "cer_EstadoNegocio";
            lbxEstadoNegocio.DataValueField = "cer_EstadoNegocio";
            lbxEstadoNegocio.DataSource     = dtEstadoNegocios;
            lbxEstadoNegocio.DataBind();
            lbxEstadoNegocio.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtLocalidades = new DataTable();
            dtLocalidades = Reporte.mostrarDepartamento();
            lbxLocalidad.DataTextField  = "dep_Nombre";
            lbxLocalidad.DataValueField = "dep_Id";
            lbxLocalidad.DataSource     = dtLocalidades;
            lbxLocalidad.DataBind();
            lbxLocalidad.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtAgencias = new DataTable();
            dtAgencias = Reporte.ListarAgenciasPorFiltros("ALL");
            lbxAgencia.DataTextField  = "age_Nombre";
            lbxAgencia.DataValueField = "age_Id";
            lbxAgencia.DataSource     = dtAgencias;
            lbxAgencia.DataBind();
            lbxAgencia.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtConvenios = new DataTable();
            dtConvenios = Reporte.ListarNombreConvenios();
            lbxConvenio.DataTextField  = "con_Nombre";
            lbxConvenio.DataValueField = "con_Nombre";
            lbxConvenio.DataSource     = dtConvenios;
            lbxConvenio.DataBind();
            lbxConvenio.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            DataTable dtAsesores = new DataTable();
            dtAsesores = Reporte.ConsultarAsesorDdl();
            lbxAsesor.DataTextField  = "asesor";
            lbxAsesor.DataValueField = "ase_Id";
            lbxAsesor.DataSource     = dtAsesores;
            lbxAsesor.DataBind();
            lbxAsesor.Items.Insert(0, new ListItem("(TODOS)", "ALL"));

            lbxCertificadoRecuperado.Items.Insert(0, new ListItem("(TODOS)", "ALL"));
            lbxCertificadoRecuperado.Items.Insert(1, new ListItem("SI", "1"));
            lbxCertificadoRecuperado.Items.Insert(2, new ListItem("NO", "0"));
        }
    }
    private void iniciar_interfaz_inicial()
    {
        GridView_HOJA_DE_TRABAJO.Visible = false;
        Reporte reporte = new Reporte(Session["idEmpresa"].ToString());
        Cargar(DropDownListEmpresa, reporte.ListarClientesIdEmpresa(), "Seleccione un cliente...");
        Cargar(DropDownListReclutador, reporte.ListarReclutadores(), "Seleccione un reclutador...");
        Cargar(ProductividadEmpresa, reporte.ListarClientesIdEmpresa(), "Seleccione un cliente...");
        Cargar(DropDownListCargo, reporte.ListarCargos(DropDownListEmpresa.SelectedValue), "Seleccione un cargo...");
        Cargar(DropDownList1regional, reporte.ListarRegionales(), "Seleccione un regional...");
        Cargar(DropDownListCiudad, reporte.ListarCiudades(), "Seleccione un ciudad...");
        Cargar(DropDownListPsicologo, reporte.ListarPsicologos_RECLUTAMIENTO(), "Seleccione un Psicologo...");
        Cargar(DropDownListPsicologoForm, reporte.ListarPsicologos_RECLUTAMIENTO(), "Seleccione un Psicologo...");
        Cargar(ProductividadReclutador, reporte.ListarReclutadores(), "Seleccione un reclutador...");
        Cargar(ProductividadCargo, reporte.ListarCargos(DropDownListEmpresa.SelectedValue), "Seleccione un cargo...");
        Cargar(ProductividadRegional, reporte.ListarRegionales(), "Seleccione un regional...");

        FormularioPrincipal();

        AgendarContacto.Enabled = false;
    }
        public static void GuardarReporte(Reporte reporte)
        {
            string mensaje = "";

            reglasNegocio.InsertarReporte(reporte.Categoria, reporte.Descripcion, reporte.Nota, ref mensaje);
        }
 protected void ProductividadRegional_SelectedIndexChanged(object sender, EventArgs e)
 {
     Reporte reporte = new Reporte(Session["idEmpresa"].ToString());
     Cargar(ProductividadCiudad, reporte.ListarCiudadesPorRegional(ProductividadRegional.SelectedValue), "Seleccione un ciudad...");
 }
 protected void DropDownList_regionales_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.DropDownList_ciudades.Items.Clear();
     Reporte reporte = new Reporte(Session["idEmpresa"].ToString());
     Cargar(this.DropDownList_ciudades, reporte.ListarCiudadesPorRegional(this.DropDownList_regionales.SelectedValue));
 }