예제 #1
0
        public Collection <DataTable> ConsultarOtrosFoliosSIC(string anosRegUnion, string anosNacUnion, string mesesUnion, string municipiosUnion)
        {
            Collection <DataTable> dts = new Collection <DataTable>();

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRN_CONSULTA_OTROS_FOLIOS_SIC, CreaParametrosAnalisisSIC(anosRegUnion, anosNacUnion, mesesUnion, municipiosUnion), dataSet);

                    if (this.Codigo == 0 && (dataSet.Tables.Count > 0))
                    {
                        dts.Add(dataSet.Tables[0]);
                        dts.Add(dataSet.Tables[1]);
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(dts);
        }
        public DataTable ConsultarOficialias(string municipiosUnion)
        {
            DataTable dataTable = new DataTable();

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRS_OFICILIAS, CreaParametrosConsultaGeoreferenciacion(municipiosUnion), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        dataTable = dataSet.Tables[0];
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(dataTable);
        }
예제 #3
0
        public int ConsultarTotalSINAC(Collection <string> colAnosNac, Collection <string> colMeses, Collection <Municipio> colMunicipios)
        {
            try
            {
                IList <string> anosNacLista = new List <string>(colAnosNac);
                string         anosNacUnion = string.Join(",", anosNacLista);

                IList <string> mesesLista = new List <string>(colMeses);
                string         mesesUnion = string.Join(",", mesesLista);

                IList <string> municipiosLista = new List <string>();
                foreach (Municipio m in colMunicipios)
                {
                    municipiosLista.Add(m.MpioId.ToString());
                }
                string municipiosUnion = string.Join(",", municipiosLista);

                return(reporteDAO.ConsultarTotalSINAC(anosNacUnion, mesesUnion, municipiosUnion));
            }
            catch (DAOException e)
            {
                Bitacora.Error(e.Message);
                if (e.Codigo == 1)
                {
                    throw new BusinessException(e.Message);
                }
                else
                {
                    throw new BusinessException("No se completó la consulta del reporte, favor de intentar nuevamente: " + e.Message);
                }
            }
        }
예제 #4
0
        public int ConsultarTotalSINAC(string anosUnion, string mesesUnion, string municipiosUnion)
        {
            int totalSINAC;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRN_CONSULTA_TOTAL_SINAC, CreaParametrosSubregistroNacimientos(anosUnion, mesesUnion, municipiosUnion), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        DataRow row = dataSet.Tables[0].Rows[0];
                        totalSINAC = row.Field <int>("TotalSINAC");
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(totalSINAC);
        }
예제 #5
0
        public ReporteSubregistroRespuesta ConsultarReporteEdoCivilSubregistro(Collection <string> colAnos, Collection <string> colMeses, Collection <Municipio> colMunicipios)
        {
            ReporteSubregistroRespuesta reporte = new ReporteSubregistroRespuesta();

            try
            {
                IList <string> anosLista = new List <string>(colAnos);
                string         anosUnion = string.Join(",", anosLista);

                IList <string> mesesLista = new List <string>(colMeses);
                string         mesesUnion = string.Join(",", mesesLista);

                IList <string> municipiosLista = new List <string>();
                foreach (Municipio m in colMunicipios)
                {
                    municipiosLista.Add(m.MpioId.ToString());
                }
                string municipiosUnion = string.Join(",", municipiosLista);

                reporte.DTs = reporteDAO.ConsultarReporteDSEdoCivilSubregistro(anosUnion, mesesUnion, municipiosUnion);
                return(reporte);
            }
            catch (DAOException e)
            {
                Bitacora.Error(e.Message);
                if (e.Codigo == 1)
                {
                    throw new BusinessException(e.Message);
                }
                else
                {
                    throw new BusinessException("No se completó la consulta del reporte, favor de intentar nuevamente: " + e.Message);
                }
            }
        }
예제 #6
0
        public XmlDocument ConsultarReporteXMLTotalesSubregistro(string anosUnion, string mesesUnion, string municipiosUnion)
        {
            XmlDocument xmlDocument = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRN_CONSULTA_REPORTE_XML_SUBREGISTRO_MUNICIPIOS, CreaParametrosSubregistroNacimientos(anosUnion, mesesUnion, municipiosUnion), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        xmlDocument = GetXml(dataSet);
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(xmlDocument);
        }
        public Oficialia ConsultarOficialia(int OId)
        {
            Oficialia oficialia = new Oficialia();

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRS_OFICILIA, CreaParametrosConsultaOficialia(OId), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            oficialia = new Oficialia
                            {
                                OId           = r.Field <int>("OId"),
                                OficialiaId   = r.Field <int>("OficialiaId"),
                                MpioId        = r.Field <int>("MpioId"),
                                MpioDesc      = r.Field <string>("MpioDesc"),
                                LocId         = r.Field <int>("LocId"),
                                LocDesc       = r.Field <string>("LocDesc"),
                                Calle         = r.Field <string>("Calle"),
                                Numero        = r.Field <string>("Numero"),
                                Colonia       = r.Field <string>("Colonia"),
                                CP            = r.Field <string>("CP"),
                                Telefono      = r.Field <string>("Telefono"),
                                Nombres       = r.Field <string>("Nombres"),
                                Apellidos     = r.Field <string>("Apellidos"),
                                CorreoE       = r.Field <string>("CorreoE"),
                                Latitud       = r.Field <string>("Latitud"),
                                Longitud      = r.Field <string>("Longitud"),
                                Observaciones = r.Field <string>("Observaciones")
                            };
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(oficialia);
        }
예제 #8
0
 public void ConsultarSesionActiva(int sesionId)
 {
     try
     {
         usuarioDAO.ConsultarSesionActiva(sesionId);
     }
     catch (DAOException e)
     {
         Bitacora.Error("Error al ejecutar método:ConsultaSesionActiva " + e.Message);
         throw new BusinessException(1, "Ocurrió un error al ejecutar el servicio, favor de intentarlo nuevamente");
     }
 }
예제 #9
0
 public void ProcesarCarga()
 {
     try
     {
         cargaDAO.ProcesarCargaSINAC();
         cargaDAO.ProcesarCargaSIC();
     }
     catch (Exception e)
     {
         Bitacora.Error(e.Message);
         throw new BusinessException(1, "El procesamiento de la carga no fue completado exitosamente, favor de intentar nuevamente: " + e.Message);
     }
 }
        public bool InsertarOficina(Oficina oficina)
        {
            try
            {
                geoDAO.InsertarOficina(oficina);
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("La oficina no fue registrada correctamente, favor de validar los datos: " + e.Message);
            }

            return(true);
        }
        public bool EliminarOficialia(int oId)
        {
            try
            {
                geoDAO.EliminarOficialia(oId);
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("La oficialia no fue eliminada correctamente, favor de intentar nuevamente: " + e.Message);
            }

            return(true);
        }
예제 #12
0
        public bool EliminarUsuario(int usuarioId)
        {
            try
            {
                usuarioDAO.EliminarUsuario(usuarioId);
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("El usuario no fue eliminado correctamente, favor de intentar nuevamente: " + e.Message);
            }

            return(true);
        }
        public bool ActualizarOficialia(Oficialia oficialia)
        {
            try
            {
                geoDAO.ActualizarOficialia(oficialia);
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("La oficialia no fue actualizada correctamente, favor de validar los datos: " + e.Message);
            }

            return(true);
        }
예제 #14
0
        public Collection <Localidad> ConsultaCatLocalidadCoahuila()
        {
            Collection <Localidad> colLocalidad = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    Collection <SqlParameter> parametrosCatLocalidad = new Collection <SqlParameter>();
                    CreaParametrosSalida(parametrosCatLocalidad);

                    EjecutaProcedimiento(PRS_CT_LOCALIDAD_COAHUILA, parametrosCatLocalidad, dataSet);

                    if (this.Codigo == 0 && validaDataSet(dataSet))
                    {
                        colLocalidad = new Collection <Localidad>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            Localidad loc = new Localidad
                            {
                                LocEdoId    = r.Field <int>("LocEdoId"),
                                LocEdoDesc  = r.Field <string>("LocEdoDesc"),
                                LocMpioId   = r.Field <int>("LocMpioId"),
                                LocMpioDesc = r.Field <string>("LocMpioDesc"),
                                LocId       = r.Field <int>("LocId"),
                                LocDesc     = r.Field <string>("LocDesc")
                            };
                            colLocalidad.Add(loc);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(colLocalidad);
        }
예제 #15
0
        public CatalogoRolesRespuesta ConsultarCatRoles()
        {
            CatalogoRolesRespuesta respuesta = new CatalogoRolesRespuesta();

            try
            {
                respuesta.ColRoles = dao.ConsultaCatRoles();
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("La consulta no fue realizada exitosamente, favor de intentar nuevamente: " + e.Message);
            }

            return(respuesta);
        }
예제 #16
0
        public ConsultaMesesRespuesta ConsultarMesesXAnio(string anio)
        {
            ConsultaMesesRespuesta consultaMesesRespuesta = new ConsultaMesesRespuesta();

            try
            {
                consultaMesesRespuesta.ColMeses = dao.ConsultarMesesXAnio(anio);
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("La consulta no fue realizada exitosamente, favor de intentar nuevamente: " + e.Message);
            }

            return(consultaMesesRespuesta);
        }
예제 #17
0
        public ParametroRespuesta ConsultarParametroRegistroExtemporaneo()
        {
            ParametroRespuesta respuesta;

            try
            {
                respuesta = cargaDAO.ConsultarParametroRegistroExtemporaneo();
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException(1, "La consulta del parámetro no fue exitosa " + e.Message);
            }

            return(respuesta);
        }
예제 #18
0
        public bool ActualizarDiasExtemporaneos(int parametroValor)
        {
            bool respuesta;

            try
            {
                respuesta = cargaDAO.ActualizarDiasExtemporaneos(parametroValor);
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException(1, "La actualización del parámetro no fue exitosa " + e.Message);
            }

            return(respuesta);
        }
예제 #19
0
        public Usuario IniciarSesion(string identificador, string contrasena, string ip)
        {
            Usuario u = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRN_INICIAR_SESION, CreaParametrosIniciarSesion(identificador, contrasena, ip), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        DataRow row = dataSet.Tables[0].Rows[0];
                        u = new Usuario()
                        {
                            SesionId    = row.Field <int>("SesionId"),
                            UsuarioId   = row.Field <int>("UsuarioId"),
                            UsuarioDesc = row.Field <string>("UsuarioDesc"),
                            CorreoE     = row.Field <string>("CorreoE")
                        };
                        Rol rol = new Rol
                        {
                            RolId   = row.Field <int>("RolId"),
                            RolDesc = row.Field <string>("RolDesc")
                        };
                        u.Rol = rol;
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(u);
        }
예제 #20
0
        public ConsultarUsuarioRespuesta ConsultarUsuario(int usuarioId)
        {
            ConsultarUsuarioRespuesta respuesta = new ConsultarUsuarioRespuesta();

            try
            {
                UsuarioAlta usuario = usuarioDAO.ConsultarUsuario(usuarioId);
                respuesta.Usuario = usuario;
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("El usuario no fue obtenido correctamente, favor de intentar nuevamente: " + e.Message);
            }

            return(respuesta);
        }
예제 #21
0
        public Collection <TotalesMunicipio> ConsultarReporteTotalesMunicipio(string anosUnion, string mesesUnion, string municipiosUnion)
        {
            Collection <TotalesMunicipio> col = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRN_CONSULTA_REPORTE_TOTALES_MUNICIPIOS, CreaParametrosSubregistroNacimientos(anosUnion, mesesUnion, municipiosUnion), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        col = new Collection <TotalesMunicipio>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            TotalesMunicipio mpio = new TotalesMunicipio
                            {
                                IdMunicipio               = r.Field <int>("IdMunicipio"),
                                MpioDesc                  = r.Field <string>("MpioDesc"),
                                TotalSubregistro          = r.Field <int>("TotalSubregistro"),
                                TotalRegistroOportuno     = r.Field <int>("TotalRegistroOportuno"),
                                TotalRegistroExtemporaneo = r.Field <int>("TotalRegistroExtemporaneo")
                            };
                            col.Add(mpio);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(col);
        }
예제 #22
0
        public ConsultarUsuariosRespuesta ConsultarBitacoraUsuarios()
        {
            ConsultarUsuariosRespuesta respuesta = new ConsultarUsuariosRespuesta();

            try
            {
                DataTable tbUsuarios = usuarioDAO.ConsultarBitacoraUsuarios();
                respuesta.DTUsuarios = tbUsuarios;
            }
            catch (DAOException e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException(e.Codigo, "No pudo ser obtenida una bitácora, favor de intentar nuevamente: " + e.Message);
            }

            return(respuesta);
        }
예제 #23
0
        public UsuarioAlta ConsultarUsuario(int usuarioId)
        {
            UsuarioAlta u;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRS_USUARIO, CreaParametrosConsultaUsuario(usuarioId), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        DataRow r = dataSet.Tables[0].Rows[0];

                        u = new UsuarioAlta
                        {
                            UsuarioId   = r.Field <int>("UsuarioId"),
                            UsuarioDesc = r.Field <string>("UsuarioDesc"),
                            Contrasenia = r.Field <string>("Contrasenia"),
                            CorreoE     = r.Field <string>("CorreoE"),
                            RolId       = r.Field <int>("RolId"),
                            RolDesc     = r.Field <string>("RolDesc"),
                            StatusId    = r.Field <int>("EstatusId")
                        };
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }


            return(u);
        }
예제 #24
0
        public Collection <Escolaridad> ConsultaCatEscolaridad()
        {
            Collection <Escolaridad> colEscolaridad = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    Collection <SqlParameter> parametrosCatEscolaridad = new Collection <SqlParameter>();
                    CreaParametrosSalida(parametrosCatEscolaridad);

                    EjecutaProcedimiento(PRS_CT_ESCOLARIDAD, parametrosCatEscolaridad, dataSet);

                    if (this.Codigo == 0 && validaDataSet(dataSet))
                    {
                        colEscolaridad = new Collection <Escolaridad>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            Escolaridad escol = new Escolaridad
                            {
                                EscolaridadId   = r.Field <int>("EscolId"),
                                EscolaridadDesc = r.Field <string>("EscolDesc")
                            };
                            colEscolaridad.Add(escol);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(colEscolaridad);
        }
예제 #25
0
        public Collection <Rol> ConsultaCatRoles()
        {
            Collection <Rol> colRoles = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    Collection <SqlParameter> parametrosCatRoles = new Collection <SqlParameter>();
                    CreaParametrosSalida(parametrosCatRoles);

                    EjecutaProcedimiento(PRS_CT_ROL, parametrosCatRoles, dataSet);

                    if (this.Codigo == 0 && validaDataSet(dataSet))
                    {
                        colRoles = new Collection <Rol>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            Rol rol = new Rol
                            {
                                RolId   = r.Field <int>("RolId"),
                                RolDesc = r.Field <string>("RolDesc")
                            };
                            colRoles.Add(rol);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(colRoles);
        }
예제 #26
0
        public Collection <Municipio> ConsultaCatMunicipio()
        {
            Collection <Municipio> colMunicipio = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    Collection <SqlParameter> parametrosCatMunicipio = new Collection <SqlParameter>();
                    CreaParametrosSalida(parametrosCatMunicipio);

                    EjecutaProcedimiento(PRS_CT_MUNICIPIO, parametrosCatMunicipio, dataSet);

                    if (this.Codigo == 0 && validaDataSet(dataSet))
                    {
                        colMunicipio = new Collection <Municipio>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            Municipio mpio = new Municipio
                            {
                                MpioId   = r.Field <int>("MpioId"),
                                MpioDesc = r.Field <string>("MpioDesc")
                            };
                            colMunicipio.Add(mpio);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(colMunicipio);
        }
        public ConsultaOficialiaRespuesta ConsultarOficialia(int OId)
        {
            ConsultaOficialiaRespuesta consultaOficialiaRespuesta = new ConsultaOficialiaRespuesta();

            try
            {
                Oficialia oficialia = geoDAO.ConsultarOficialia(OId);
                consultaOficialiaRespuesta.Oficialia = oficialia;
            }
            catch (Exception e)
            {
                Bitacora.Error(e.Message);
                throw new BusinessException("La oficialia no fue obtenida correctamente, favor de intentar nuevamente: " + e.Message);
            }

            return(consultaOficialiaRespuesta);
        }
예제 #28
0
        public Collection <EstatusRegistro> ConsultaCatEstatusRegistro()
        {
            Collection <EstatusRegistro> colEstatusRegistro = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    Collection <SqlParameter> parametrosCatEstatusRegistro = new Collection <SqlParameter>();
                    CreaParametrosSalida(parametrosCatEstatusRegistro);

                    EjecutaProcedimiento(PRS_CT_ESTATUS_REGISTRO, parametrosCatEstatusRegistro, dataSet);

                    if (this.Codigo == 0 && validaDataSet(dataSet))
                    {
                        colEstatusRegistro = new Collection <EstatusRegistro>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            EstatusRegistro statusRegistro = new EstatusRegistro
                            {
                                EstatusRegistroId   = r.Field <int>("EstatusRegistroId"),
                                EstatusRegistroDesc = r.Field <string>("EstatusRegistroDesc")
                            };
                            colEstatusRegistro.Add(statusRegistro);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(colEstatusRegistro);
        }
예제 #29
0
        public TotalesSubregistroNacimientosRespuesta ConsultaTotalesSubregistroNacimientos(string anosUnion, string mesesUnion, string municipiosUnion)
        {
            TotalesSubregistroNacimientosRespuesta totalesSubregistroNacimientosRespuesta = new TotalesSubregistroNacimientosRespuesta();

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRN_CONSULTA_TOTALES_SUBREGISTRO_NACIMIENTOS, CreaParametrosSubregistroNacimientos(anosUnion, mesesUnion, municipiosUnion), dataSet);

                    if (this.Codigo == 0 && ValidaDataSet(dataSet))
                    {
                        totalesSubregistroNacimientosRespuesta.ColTotales = new Collection <SubregistroTotal>();

                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            SubregistroTotal sub = new SubregistroTotal
                            {
                                IdGrupo     = r.Field <int>("IdGrupo"),
                                NombreGrupo = r.Field <string>("NombreGrupo"),
                                Total       = r.Field <int>("Total")
                            };

                            totalesSubregistroNacimientosRespuesta.ColTotales.Add(sub);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(totalesSubregistroNacimientosRespuesta);
        }
예제 #30
0
        public Collection <Mes> ConsultarMesesXAnio(string anio)
        {
            Collection <Mes> colMeses = null;

            try
            {
                using (DataSet dataSet = new DataSet())
                {
                    dataSet.Locale = CultureInfo.InvariantCulture;

                    EjecutaProcedimiento(PRS_CONSULTA_MESES_X_ANIO, CreaParametrosMesesXAnio(anio), dataSet);

                    if (this.Codigo == 0 && validaDataSet(dataSet))
                    {
                        colMeses = new Collection <Mes>();
                        foreach (DataRow r in dataSet.Tables[0].Rows)
                        {
                            Mes mes = new Mes
                            {
                                MesId   = r.Field <int>("MesId"),
                                MesDesc = r.Field <string>("MesDesc")
                            };
                            colMeses.Add(mes);
                        }
                    }
                    else
                    {
                        throw new EmptyDataException(this.Mensaje);
                    }
                }
            }
            catch (Exception de)
            {
                Bitacora.Error(de.Message);
                if (de is EmptyDataException)
                {
                    throw new DAOException(1, de.Message);
                }
                throw new DAOException(-1, de.Message);
            }

            return(colMeses);
        }