Beispiel #1
0
        public Modelos.TBC_DEPARTAMENTO geDepartamentoById(int id)
        {
            Modelos.TBC_DEPARTAMENTO departamento = null;

            var res = _context.SP_TBC_DEPARTAMENTO_GetDepartamentosById(id).FirstOrDefault();   //Buscando a un usuario

            //Si el usuario existe es convertido en un objeto Usuario y es devuelto
            if (res != null)
            {
                departamento = new Modelos.TBC_DEPARTAMENTO();

                departamento.ID_DEPARTAMENTO  = res.ID_DEPARTAMENTO;
                departamento.COD_DEPARTAMENTO = res.COD_DEPARTAMENTO;
                departamento.NOMBRE           = res.NOMBRE_DEPTO;
            }

            return(departamento);
        }