Example #1
0
        //Animation on page load
        protected override async void OnAppearing()
        {
            if (SettingsSaved == "")
            {
                double scale = this.Scale;

                LoginButton.Scale        = (scale * 70 / 100);
                LoginEntryUsername.Scale = (scale * 70 / 100);
                LoginEntryPassword.Scale = (scale * 70 / 100);
                //Startup setup
                await CinnamonLogo.TranslateTo(0, 170, 500, Easing.Linear);

                //await CheckinText.TranslateTo(0, 100, 500, Easing.Linear);
                await LoginEntryUsername.TranslateTo(0, 100, 500, Easing.Linear);

                await LoginEntryPassword.TranslateTo(0, 100, 500, Easing.Linear);

                await LoginButton.TranslateTo(0, 100, 500, Easing.Linear);

                //Cinnamon Logo Animation
                await Sleep(500);

                await CinnamonLogo.TranslateTo(0, 0, 600, Easing.CubicOut);

                //Entry and Button Animation

                //CheckinText.FadeTo(1, 800, Easing.CubicOut);
                //CheckinText.TranslateTo(0, 0, 800, Easing.CubicOut);

                LoginEntryUsername.FadeTo(1, 800, Easing.CubicOut);
                LoginEntryUsername.TranslateTo(0, 0, 800, Easing.CubicOut);

                LoginEntryPassword.FadeTo(1, 800, Easing.CubicOut);
                LoginEntryPassword.TranslateTo(0, 0, 800, Easing.CubicOut);

                LoginButton.FadeTo(1, 800, Easing.CubicOut);
                LoginButton.TranslateTo(0, 0, 800, Easing.CubicOut);

                ForgotPasswordButton.FadeTo(1, 800, Easing.CubicOut);
                ForgotPasswordButton.TranslateTo(0, 0, 800, Easing.CubicOut);

                //NeedHelpButton.FadeTo(1, 800, Easing.CubicOut);
                //NeedHelpButton.TranslateTo(0, 0, 800, Easing.CubicOut);

                //ContactButton.FadeTo(1, 800, Easing.CubicOut);
                //ContactButton.TranslateTo(0, 0, 800, Easing.CubicOut);

                TradeMark.IsVisible = true;
                //ContactSeperator.IsVisible = true;

                Sleep(800);

                base.OnAppearing();
            }
            //Update Availability Indicator
            //VersionChecker();
        }
Example #2
0
        async Task oAuthLogin(UserModel user)
        {
            //Authenticate against ADFS and NW Gateway
            oAuthLogin oauthlogin = new oAuthLogin();

            user.Username = user.Username + "@jkintranet.com";
            String access_token = await oauthlogin.LoginUserAsync(user);


            if ((access_token != "" && access_token != Constants._userNotExistInNWGateway) && access_token != Constants._gatewayUrlError)
            {
                //Store Username and Password in global Area
                Constants._user = user;

                //Store Username and Password in local shared preference
                Settings.Username = user.Username;
                Settings.Password = user.Password;

                //Retrieving Hotel Code
                try
                {
                    await hotelInformationAndLogin();
                }
                catch (Exception)
                {
                    await DisplayAlert(Constants._headerConnectionLost, Constants._networkerror, Constants._buttonOkay);
                }
            }
            else if (access_token == Constants._gatewayUrlError)
            {
                await DisplayAlert(Constants._headerConnectionLost, Constants._gatewayUrlError, Constants._buttonOkay);
            }
            else
            {
                if (access_token == Constants._userNotExistInNWGateway)
                {
                    await DisplayAlert(Constants._headerMessage, Constants._userNotExistInNWGateway, Constants._buttonClose);
                }
                else
                {
                    await DisplayAlert(Constants._headerWrongCredentials, Constants._incorrectlogincredentials, Constants._buttonClose);

                    LoginEntryUsername.Text = "";
                    LoginEntryPassword.Text = "";
                    LoginEntryUsername.Focus();
                }
            }


            stopLoading();
        }