示例#1
0
        public async Task <BusinessUserAccountCodeModel> GetUserAccountCodeByAccountId(int accountId)
        {
            try
            {
                var userAccountCodeModel = await _userAccountCodeRepository.GetUserAccountCodeByAccountId(accountId);

                if (userAccountCodeModel == null)
                {
                    return(null);
                }
                else
                {
                    var businessUserAccountCodeModel = ModelConverterService.ConvertTo(userAccountCodeModel,
                                                                                       new BusinessUserAccountCodeModel());

                    return(businessUserAccountCodeModel);
                }
            }
            catch (SqlCustomException e)
            {
                throw new SqlCustomException(e.Message, e.InnerException);
            }
            catch (NullReferenceException e)
            {
                throw new NullReferenceException(e.Message, e.InnerException);
            }
        }
示例#2
0
        public async Task <BusinessLoginAttemptsModel> GetLoginAttemptsByIpAddress(string ipAddress)
        {
            try
            {
                var loginAttemptsModel = await _loginAttemptsRepository.GetLoginAttemptsByIpAddress(ipAddress);

                if (loginAttemptsModel == null)
                {
                    return(null);
                }
                else
                {
                    var businessLoginAttemptsModel = ModelConverterService.ConvertTo(loginAttemptsModel,
                                                                                     new BusinessLoginAttemptsModel());

                    return(businessLoginAttemptsModel);
                }
            }
            catch (SqlCustomException e)
            {
                throw new SqlCustomException(e.Message, e.InnerException);
            }
            catch (NullReferenceException e)
            {
                throw new NullReferenceException(e.Message, e.InnerException);
            }
        }