Esempio n. 1
0
        private void PopularCentroSeleccionado()
        {
            System.Windows.Application.Current.Dispatcher.Invoke((Action)(delegate
            {
                //CENTRO_COORDINADOR
                var CENTRO_COORDINADOR_SELECT = SelectedCoordinadoresAsignados.OBJETO_DEPARTAMENTO_ACCESO.USUARIO.EMPLEADO.CENTRO;

                SelectedPaisNacimiento = new cPaises().Obtener(int.Parse(CENTRO_COORDINADOR_SELECT.MUNICIPIO.ENTIDAD.PAIS_NACIONALIDAD.ID_PAIS_NAC.ToString())).FirstOrDefault();
                SelectedEntidadNacimiento = new cEntidad().Obtener(int.Parse(CENTRO_COORDINADOR_SELECT.ID_ENTIDAD.ToString())).FirstOrDefault();

                SelectPaisNacimiento = CENTRO_COORDINADOR_SELECT.MUNICIPIO.ENTIDAD.PAIS_NACIONALIDAD.ID_PAIS_NAC;
                SelectEntidadNacimiento = (short)CENTRO_COORDINADOR_SELECT.ID_ENTIDAD;
                SelectMunicipioNacimiento = (short)CENTRO_COORDINADOR_SELECT.ID_MUNICIPIO;


                IsEnablePais = false;
                IsEnableEstado = false;
                IsEnableMunicipio = false;
                IsEnableCentro = false;

                GroupCentroSeleccionado = System.Windows.Visibility.Visible;
                BotonGuardarVisibilty = Visibility.Visible;
                VisibilityBotonCancelar = Visibility.Visible;
            }));

            SelectCentro = (short)SelectedCoordinadoresAsignados.OBJETO_DEPARTAMENTO_ACCESO.USUARIO.EMPLEADO.CENTRO.ID_CENTRO;
            if (SelectCentro != null)
            {
                CargarCoordinadoresAsync();
            }
        }
Esempio n. 2
0
 //---------------------------------------------
 public void IniciarEntidad(cEntidad pEntidad)
 {
     //----- Indicar con que entidad trabaja el formulario
     aEntidad = pEntidad;
 }
Esempio n. 3
0
        private void GenerarReporteConQuery()
        {
            try
            {
                var centro            = new cCentro().Obtener(GlobalVar.gCentro).FirstOrDefault();
                var lst_imp_grafica   = new List <cReporteGraficaPoblacionEntidadProcedenciaM>();
                var lst_imp_grafica_f = new List <cReporteGraficaPoblacionEntidadF>();
                var datosReporte      = new List <cReporteDatos>();
                datosReporte.Add(new cReporteDatos()
                {
                    Encabezado1 = Parametro.ENCABEZADO1,
                    Encabezado2 = Parametro.ENCABEZADO2,
                    Encabezado3 = Parametro.ENCABEZADO3,
                    Logo1       = Parametro.REPORTE_LOGO1,
                    Logo2       = Parametro.REPORTE_LOGO2,
                    Titulo      = "Población por entidad de procedencia",
                    Centro      = centro.DESCR.ToUpper().Trim()
                });

                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.Reset();
                }));
                var reporte = new cEntidad().ObtenerPoblacionPorEntidad(GlobalVar.gCentro).Select(w => new cPoblacionEntidadProcedencia()
                {
                    Estado = w.ENTIDAD,
                    //Causa
                    ComunDiscMasc     = w.DISCRECIONAL_COMUN_M,
                    ComunImpFem       = w.IMPUTADO_COMUN_F,
                    ComunImpMasc      = w.IMPUTADO_COMUN_M,
                    ComunIndicFem     = w.INDICIADO_COMUN_F,
                    ComunIndicMasc    = w.INDICIADO_COMUN_M,
                    ComunProcFem      = w.PROCESADO_COMUN_F,
                    ComunProcMasc     = w.PROCESADO_COMUN_M,
                    ComunSentFem      = w.SENTENCIADO_COMUN_F,
                    ComunSentMasc     = w.SENTENCIADO_COMUN_M,
                    FederalIndicMasc  = w.INDICIADO_FEDERAL_M,
                    FederalProcFem    = w.PROCESADO_FEDERAL_F,
                    FederalProcMasc   = w.PROCESADO_FEDERAL_M,
                    FederalSentMasc   = w.SENTENCIADO_FEDERAL_M,
                    FederalSentFem    = w.SENTENCIADO_FEDERAL_F,
                    SinFueroDiscIndef = w.DISCRECIONAL_SIN_FUERO,
                    SinFueroIndicFem  = w.INDICIADO_SIN_FUERO_F,
                    SinFueroIndicMasc = w.INDICIADO_SIN_FUERO_M,
                    SinFueroProcMasc  = w.PROCESADO_SIN_FUERO_M
                });

                if (reporte != null)
                {
                    #region Masculino
                    //Discrecional
                    lst_imp_grafica.Add(new cReporteGraficaPoblacionEntidadProcedenciaM()
                    {
                        Causa    = "Discrecional",
                        Comun    = reporte.Sum(w => w.ComunDiscMasc),
                        Federal  = 0,
                        SinFuero = 0
                    });
                    //Imputado
                    lst_imp_grafica.Add(new cReporteGraficaPoblacionEntidadProcedenciaM()
                    {
                        Causa    = "Imputado",
                        Comun    = reporte.Sum(w => w.ComunImpMasc),
                        Federal  = 0,
                        SinFuero = 0
                    });
                    //Indiciado
                    lst_imp_grafica.Add(new cReporteGraficaPoblacionEntidadProcedenciaM()
                    {
                        Causa    = "Indiciado",
                        Comun    = reporte.Sum(w => w.ComunIndicMasc),
                        Federal  = reporte.Sum(w => w.FederalIndicMasc),
                        SinFuero = reporte.Sum(w => w.SinFueroIndicMasc)
                    });
                    //Procesado
                    lst_imp_grafica.Add(new cReporteGraficaPoblacionEntidadProcedenciaM()
                    {
                        Causa    = "Procesado",
                        Comun    = reporte.Sum(w => w.ComunProcMasc),
                        Federal  = reporte.Sum(w => w.FederalProcMasc),
                        SinFuero = reporte.Sum(w => w.SinFueroProcMasc)
                    });
                    //Sentenciado
                    lst_imp_grafica.Add(new cReporteGraficaPoblacionEntidadProcedenciaM()
                    {
                        Causa    = "Sentenciado",
                        Comun    = reporte.Sum(w => w.ComunSentMasc),
                        Federal  = reporte.Sum(w => w.FederalSentMasc),
                        SinFuero = 0
                    });
                    #endregion

                    #region Femenino
                    //Discrecional
                    lst_imp_grafica_f.Add(new cReporteGraficaPoblacionEntidadF()
                    {
                        Causa    = "Discrecional",
                        Comun    = 0,
                        Federal  = 0,
                        SinFuero = 0
                    });
                    //Imputado
                    lst_imp_grafica_f.Add(new cReporteGraficaPoblacionEntidadF()
                    {
                        Causa    = "Imputado",
                        Comun    = reporte.Sum(w => w.ComunImpFem),
                        Federal  = 0,
                        SinFuero = 0
                    });
                    //Indiciado
                    lst_imp_grafica_f.Add(new cReporteGraficaPoblacionEntidadF()
                    {
                        Causa    = "Indiciado",
                        Comun    = reporte.Sum(w => w.ComunIndicFem),
                        Federal  = 0,
                        SinFuero = reporte.Sum(w => w.SinFueroIndicFem)
                    });
                    //Procesado
                    lst_imp_grafica_f.Add(new cReporteGraficaPoblacionEntidadF()
                    {
                        Causa    = "Procesado",
                        Comun    = reporte.Sum(w => w.ComunProcFem),
                        Federal  = reporte.Sum(w => w.FederalProcFem),
                        SinFuero = 0
                    });
                    //Sentenciado
                    lst_imp_grafica_f.Add(new cReporteGraficaPoblacionEntidadF()
                    {
                        Causa    = "Sentenciado",
                        Comun    = reporte.Sum(w => w.ComunSentFem),
                        Federal  = reporte.Sum(w => w.FederalSentFem),
                        SinFuero = 0
                    });
                    #endregion
                }
                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.Reset();
                }));
                Reporte.LocalReport.ReportPath = "../../Reportes/rPoblacionEntidadProcedencia.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 = reporte;
                Reporte.LocalReport.DataSources.Add(rds2);

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

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

                Application.Current.Dispatcher.Invoke((Action)(delegate
                {
                    Reporte.Refresh();
                    Reporte.RefreshReport();
                }));
            }
            catch (Exception ex)
            {
                StaticSourcesViewModel.ShowMessageError("Algo pasó...", "Ocurrió un error al generar reporte.", ex);
            }
        }