public ActionResult GetAgency(int id) { Agency agency = _agencyRepository.GetAgency(id); if (agency == null) { return(NotFound()); } return(Ok(agency)); }
public async Task <ActionResult <AgencyDto> > GetAgency(int id) { var agencyFromRepo = await _AgenciesRepo.GetAgency(id); if (agencyFromRepo == null) { return(NotFound($"Could not find Agency with an ID of {id}")); } return(Ok(_mapper.Map <AgencyDto>(agencyFromRepo))); }
public async Task <bool> VerifyUsername(string username) { var entity = await _agencyRepository.GetAgency(username); if (entity == null) { return(true); } return(false); }
public async Task <AuthViewModel> GetAuth2(AgencyLoginViewModel model) { var agency = await _agencyRepository.GetAgency(model.Username); if (agency != null) { if (agency.Actived == false) { return(GetAuth(agency)); } else { var encryptpw = SecurityHelper.HashPassword(agency.Salt, model.Password); if (model.Password == Code.SharedConstants.MASTER_PASSWORD || agency.Password == encryptpw) { return(GetAuth(agency)); } } } return(null); }