Example #1
0
        public UserAccountIdentifyInfoShort CheckUserLoginAndPassword(UserAccountIdentifyInfo identifyInfo)
        {
            var userId = this.CheckUserPass(identifyInfo.Login, identifyInfo.Password);

            if (userId == Guid.Empty)
            {
                return(null);
            }

            var random = new Random();

            return(new UserAccountIdentifyInfoShort
            {
                Login = identifyInfo.Login,
                Password = identifyInfo.Password,
                Key = random.Next(1, 40)
            });
        }
Example #2
0
        public ResponseResult <UserAccountIdentifyInfoShort> CheckUserLoginAndPassword(UserAccountIdentifyInfo identifyInfo)
        {
            try
            {
                if (identifyInfo == null || string.IsNullOrEmpty(identifyInfo.Login) ||
                    string.IsNullOrEmpty(identifyInfo.Password))
                {
                    return(new ResponseResult <UserAccountIdentifyInfoShort>(WronginputDataErrorMessage));
                }

                var userInfo = _accountRepository.CheckUserLoginAndPassword(identifyInfo);
                return(userInfo == null
                           ? new ResponseResult <UserAccountIdentifyInfoShort>("Неверная пара логин-пароль")
                           : new ResponseResult <UserAccountIdentifyInfoShort>(userInfo));
            }
            catch (Exception exception)
            {
                _loggingService.Log(this, CheckUserLoginAndPasswordExceptionMessagge, LogType.Error, exception);
                return(new ResponseResult <UserAccountIdentifyInfoShort>(CheckUserLoginAndPasswordExceptionMessagge));
            }
        }
Example #3
0
 public ResponseResult <UserAccountIdentifyInfoShort> CheckUserLoginAndPassword(UserAccountIdentifyInfo identifyInfo)
 {
     return(_accountService.CheckUserLoginAndPassword(identifyInfo));
 }