public async Task <IActionResult> GetArmsAdministrationCategory(int AdministrationCategoryId)
        {
            log.Info("GetArmsAdministrationCategory");
            var agencyCategoryFromRepo = await _armsDataRepository.GetAdministrationCategoryTypeIdAsync(AdministrationCategoryId);

            if (agencyCategoryFromRepo == null)
            {
                return(BadRequest());
            }

            var agencyCategory = _mapper.Map <DTOs.ArmsAdministrationCategoryForDD>(agencyCategoryFromRepo);

            return(Ok(agencyCategory));
        }
Esempio n. 2
0
        public async Task <DTOs.PersonnelForDisplay> GetArmsPersonnelDisplayValues(DTOs.PersonnelForDisplay personnelIdDetails)
        {
            var ContactByIdFromRepo = await _contactsRepository.GetContactsIdAsync(personnelIdDetails.ContactId);

            personnelIdDetails.ContactName  = ContactByIdFromRepo.FirstName + " " + ContactByIdFromRepo.LastName;
            personnelIdDetails.EmailAddress = ContactByIdFromRepo.EmailAddress;

            var agencyCategoryFromRepo = await _armsDataRepository.GetAdministrationCategoryTypeIdAsync(personnelIdDetails.RoleId);

            personnelIdDetails.ContactRole = agencyCategoryFromRepo.AdministrationCategoryText;
            var ContactAgencyByContactIdFromRepo = await _contactAgencyRepository.GetContactAgencyByContactAsync(personnelIdDetails.ContactId);

            foreach (var item in ContactAgencyByContactIdFromRepo)
            {
                personnelIdDetails.agencyName  = _contactAgencyRepository.getAgencyName((item.AgencyID));
                personnelIdDetails.MobilePhone = item.MobilePhone;
            }
            return(personnelIdDetails);
        }