Beispiel #1
0
        public void ShowMessageDialog(string title, string message, string okBtn, PlatformDialogServiceArguments platformArguments)
        {
            UIViewController  presentViewController = null;
            UIAlertController dialogViewController  = null;

            if (platformArguments.Context != null && platformArguments.Context is UIViewController viewController)
            {
                presentViewController = viewController;
            }
            else
            {
                AttempToLookForPresentViewController(out presentViewController, out dialogViewController);
            }

            DialogViewModel viewModel = new DialogViewModel()
            {
                Title    = title,
                Body     = message,
                OkBtnTxt = okBtn
            };

            if (dialogViewController != null)
            {
                dialogViewController.DismissViewController(false, () =>
                {
                    DialogHelper.ShowDialog(presentViewController, viewModel, null);
                });
            }
            else
            {
                DialogHelper.ShowDialog(presentViewController, viewModel, null);
            }
        }
Beispiel #2
0
        public void InvokeNextButtonClick(
            Action onSuccess,
            Action onFail,
            Action onValidationFail,
            PlatformDialogServiceArguments platformDialogServiceArguments = null)
        {
            if (Selection == QuestionaireSelection.YesSince)
            {
                if (_selectedDateUTC == DateTime.MinValue)
                {
                    ServiceLocator.Current
                    .GetInstance <IDialogService>()
                    .ShowMessageDialog(
                        null,
                        "REGISTER_QUESTIONAIRE_CHOOSE_DATE_POP_UP".Translate(),
                        "ERROR_OK_BTN".Translate(),
                        platformDialogServiceArguments);

                    onValidationFail?.Invoke();

                    return;
                }
                PersonalData.FinalMiBaDate = _localSelectedDate;
            }
            else if (PersonalData.Validate())
            {
                try
                {
                    PersonalData.FinalMiBaDate = Convert.ToDateTime(PersonalData.Covid19_smitte_start);
                }
                catch
                {
                    onFail?.Invoke();
                    LogUtils.LogMessage(LogSeverity.ERROR, "Miba data can't be parsed into datetime");
                    return;
                }
            }
            else
            {
                onFail?.Invoke();
                LogUtils.LogMessage(LogSeverity.ERROR, "Validation of personaldata failed because of miba data was null or accesstoken expired");
                return;
            }

            onSuccess?.Invoke();
        }
        public void InvokeNextButtonClick(
            Action onSuccess,
            Action onFail,
            Action onValidationFail,
            PlatformDialogServiceArguments platformDialogServiceArguments = null)
        {
            DateTime?dateInMSIS = GetMSISDateFromPersonalData();

            if (dateInMSIS == null)
            {
                onFail?.Invoke();
                return;
            }
            if (Selection == QuestionaireSelection.YesSince)
            {
                if (_selectedDateUTC == DateTime.MinValue)
                {
                    ServiceLocator.Current
                    .GetInstance <IDialogService>()
                    .ShowMessageDialog(
                        null,
                        "REGISTER_QUESTIONAIRE_CHOOSE_DATE_POP_UP".Translate(),
                        "ERROR_OK_BTN".Translate(),
                        platformDialogServiceArguments);

                    onValidationFail?.Invoke();

                    return;
                }
                PersonalData.FinalDateToSetDSOS = dateInMSIS < _localSelectedDate ? dateInMSIS : _localSelectedDate;
            }
            else
            {
                PersonalData.FinalDateToSetDSOS = dateInMSIS;
            }

            onSuccess?.Invoke();
        }
Beispiel #4
0
        public void ShowMessageDialog(string title, string message, string okBtn, PlatformDialogServiceArguments platformArguments = null)
        {
            Activity activity = platformArguments?.Context != null && platformArguments.Context is Activity act ? act : Current.Activity;

            DialogUtils.DisplayDialog(activity, title, message, okBtn);
        }