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); }
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); } } }
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); }
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); } } }
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); }
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"); } }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }