예제 #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();
            }
        }
        public bool IsRegisteredUser(string D365Data, bool toOverride = false)
        {
            var isAuthenticated       = _MasterRepo.GetRegisteredUserOID() != Guid.Empty.ToString();
            var hasRegistrationRecord = _RegisterRepo.GetDyn365RegisterViewModel().ErrorList.Length == 0;
            var isIn365 = D365Data != string.Empty;

            return(toOverride || isAuthenticated && hasRegistrationRecord && isIn365);
        }