示例#1
0
        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();
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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();
        }