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) }); }
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)); } }
public ResponseResult <UserAccountIdentifyInfoShort> CheckUserLoginAndPassword(UserAccountIdentifyInfo identifyInfo) { return(_accountService.CheckUserLoginAndPassword(identifyInfo)); }