Exemple #1
0
        /// <summary>
        /// Login to app
        /// </summary>
        /// <param name="instance">Instance.</param>
        public void loginButton()
        {
            string emailInput    = LoginEmail.Text;
            string passwordInput = LoginPassword.Text;


            EmailBar.Highlighted    = false;
            PasswordBar.Highlighted = false;

            AppController.DATAINPUT_RESULT loginResult = AppController.Instance.checkLogin(emailInput, passwordInput);
            if (loginResult == AppController.DATAINPUT_RESULT.VALID)
            {
                SecondViewController nextPage = this.Storyboard.InstantiateViewController("LoginComplete") as SecondViewController;

                PersistentDataCache.Instance.LoggedIn = true;
                this.NavigationController.PushViewController(nextPage, false);
            }
            else
            {
                if (loginResult == AppController.DATAINPUT_RESULT.EMAIL_TOO_SHORT)
                {
                    LoginEmail.Text        = "";
                    LoginEmail.Placeholder = "Invalid Email!";
                    EmailBar.Highlighted   = true;
                }
                if (loginResult == AppController.DATAINPUT_RESULT.PASSWORD_INVALID)
                {
                    LoginPassword.Text        = "";
                    LoginPassword.Placeholder = "Invalid Password!";
                    PasswordBar.Highlighted   = true;
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// initialise the button events
        /// </summary>
        public void initButtons()
        {
            Button_Continue.TouchUpInside += (object sender, EventArgs e) =>
            {
                SecondViewController nextPage = this.Storyboard.InstantiateViewController("LoginComplete") as SecondViewController;

                this.NavigationController.PushViewController(nextPage, false);
            };

            Back.TouchUpInside += (object sender, EventArgs e) =>
            {
                NewAccountControllerB lastPage = this.Storyboard.InstantiateViewController("NewAccountEmail") as NewAccountControllerB;

                this.NavigationController.PushViewController(lastPage, false);
            };
        }
        /// <summary>
        /// Login to app
        /// </summary>
        /// <param name="instance">Instance.</param>
        public void loginButton(ViewController instance)
        {
            string emailInput = TextInputTest.Text;

            SecondViewController nextPage = instance.Storyboard.InstantiateViewController("LoginComplete") as SecondViewController;

            PersistentDataCache.Instance.LoggedIn = true;
            if (AppController.Instance.checkLogin(emailInput, ""))
            {
                instance.NavigationController.PushViewController(nextPage, false);
            }
            else
            {
                TextInputTest.Text = "Invalid Code";
            }

            /*
             * if (PersistentDataCache.Instance.user.login("", "")) // logged in succesfully
             * {
             *      PersistentDataCache.Instance.LoggedIn = true;
             *      instance.NavigationController.PushViewController(nextPage, true);
             * }*/
            //instance.NavigationController.PushViewController(nextPage, false);
        }