public async Task CompleteRegistrationAsync() { var registerData = RegisterRepository.GetDyn365RegisterViewModel(); var checkUser = await RegisterRepository.GetUserWithOIDAsync(registerData); if (checkUser == null || checkUser.data.userId == null) { var user = await RegisterRepository.RegisterWithD365Async(registerData); if (user != null && user.success && user.data.verified) { _MasterRepo.PushMyCoverView(); } } else if (!checkUser.data.verified) { var sendModel = new NIUSSDViewModel { mobileNumber = registerData.MobileNumber, userId = _MasterRepo.DataSource.User.UserID, TokenID = _MasterRepo.DataSource.User.TokenID }; await _CellReposetory.SendUSSDTestAsync(sendModel); } else { _MasterRepo.PushMyCoverView(); } }
private async Task <GetUserReturnModel> GetUserWithD365DataAsync(RegisterViewModel model) { MustShowError = false; var user = await _RegisterRepo.GetUserWithOIDAsync(model); MustShowError = true; if (user != null && user.success) { await _RegisterRepo.SetUserWithServerDataAsync(user.data); return(user); } return(user); }
public void TestGetUserWithOIDAsyncTranslatesModel() { var regModel = new RegisterViewModel() { FirstName = TokenName, LastName = "Minnaar", MobileNumber = "0835666566", OID = OID, UserPicture = pictureBytes, TokenID = ARToken, PictureStorageSASToken = "Picture SAS" }; dynamixService.Setup(s => s.GetUserWithOIDAsync(It.Is <RegisterViewModel>(a => a.FirstName == TokenName))); registerRepo.GetUserWithOIDAsync(regModel); repository.VerifyAll(); }