Beispiel #1
0
        /// <summary>
        /// Método encargado de obtener el departamento al que un municipio pertenece
        /// </summary>
        /// <param name="municipio">Municipio</param>
        /// <returns>Retorna el departamento al que pertenece el municipio</returns>
        public TBC_DEPARTAMENTO obtenerDepartamentoByIdMunicipio(int?municipio)
        {
            var res = _context.SP_TBC_MUNICIPIO_GetDepartamentoByIdMunicipio(municipio).FirstOrDefault();

            TBC_DEPARTAMENTO depto = new TBC_DEPARTAMENTO();

            if (res != null)
            {
                depto.ID_DEPARTAMENTO  = res.ID_DEPARTAMENTO;
                depto.NOMBRE_DEPTO     = res.NOMBRE_DEPTO;
                depto.COD_DEPARTAMENTO = res.COD_DEPARTAMENTO;
            }

            return(depto);
        }