public void Initialize(AgreementType type, Action onComplete)
 {
     Confirm.onClick.RemoveAllListeners();
     Confirm.onClick.AddListener(() =>
     {
         onComplete.Invoke();
         FrameSetController.GetInstance().LoadPreviousFrame();
     });
 }
Beispiel #2
0
    public void Start()
    {
        TermsOfUseButton.onClick.AddListener(() =>
        {
            FrameSetController.GetInstance().OpenFrame(FrameSet.AGREEMENT).GetComponent <AgreementController>().Initialize(AgreementType.TermsOfUse, () => { });
        });

        PrivacyPolicyButton.onClick.AddListener(() =>
        {
            FrameSetController.GetInstance().OpenFrame(FrameSet.AGREEMENT).GetComponent <AgreementController>().Initialize(AgreementType.PrivacyPolicy, () => { });
        });

        new List <Toggle>()
        {
            PrivacyPolicy, TermsOfUse
        }.ForEach(x =>
        {
            x.onValueChanged.AddListener((@checked) =>
            {
                if (!new List <Toggle>()
                {
                    PrivacyPolicy, TermsOfUse
                }.Exists(y => y.isOn))
                {
                    Submit.interactable = true;
                }
                else
                {
                    Submit.interactable = false;
                }
            });
        });

        Submit.onClick.AddListener(() =>
        {
            Submit.GetComponent <ButtonLoader>().StartLoading();

            RequestManager.Patient.Registration(new Dictionary <string, string>()
            {
                { "email", Email.text },
                { "password", Password.text },
                { "confirmation", Password.text },
                { "policy", true.ToString() }
            },
                                                response =>
            {
                TokenManager.Token = response.data.attributes.token;

                FrameSetController.GetInstance().OpenFrame(FrameSet.PROFILE);
            },
                                                error => {
                Submit.GetComponent <ButtonLoader>().StopLoading();
            });
        });
    }
Beispiel #3
0
    public void Start()
    {
        Submit.onClick.AddListener(() =>

        {
            Submit.GetComponent <ButtonLoader>().StartLoading();

            RequestManager.Patient.Authorize(new Dictionary <string, string>()
            {
                { "email", Email.text },
                { "password", Password.text }
            },
                                             response =>
            {
                TokenManager.Token = response.data.attributes.token;

                Debug.Log(response.rawData);

                RequestManager.Patient.Profile(_response =>
                {
                    RequestManager.User.TwoFA.Request(
                        __response =>
                    {
                        PrefabsController.OpenPrefabUI("2FA").GetComponent <TwoFAController>().OnComplete(() =>
                        {
                            Submit.GetComponent <ButtonLoader>().StopLoading();
                            FrameSetController.GetInstance().OpenFrame(FrameSet.PROFILE);
                        });
                    },
                        error =>
                    {
                        Message.Debug("2FA Failed");
                    }
                        );
                },
                                               error => {
                    Message.CREDENTIALS_WRONG.Show();
                    Form.Clear();

                    Submit.GetComponent <ButtonLoader>().StopLoading();
                });
            },
                                             error => {
                Message.CREDENTIALS_WRONG.Show();
                Form.Clear();

                Submit.GetComponent <ButtonLoader>().StopLoading();
            });
        });

        RegistrationButton.onClick.AddListener(() =>
        {
            FrameSetController.GetInstance().OpenFrame(FrameSet.REGISTRATION);
        });
    }
    public void Start()
    {
        RequestManager.Patient.Profile(
            response => {
            Avatar.URL       = response.data.attributes.photo;
            PatientName.text = response.data.attributes.first_name + " " + response.data.attributes.last_name;
        },
            error => {
            Debug.LogError("Error");
        }
            );

        LogOut.onClick.AddListener(() =>
        {
            FrameSetController.GetInstance().OpenFrame(FrameSet.LOGIN);
        });
    }
Beispiel #5
0
 public void Awake()
 {
     _Instance = this;
 }