Example #1
0
        public LoginPage()
        {
            InitializeComponent();

            if (CrossConnectivity.Current.IsConnected)
            {
                if (App.Initiallogin == true)
                {
                    Initial.init();
                    App.Initiallogin = false;
                }

                //if (App.Thai == true)
                //{
                //    LanguageThai.IsVisible = false;
                //    LanguageThai.IsEnabled = false;

                //    LanguageEng.IsVisible = true;
                //    LanguageEng.IsEnabled = true;

                //    Signin1.IsVisible = false;
                //    Signin2.IsVisible = true;
                //}
                //else
                //{
                //    LanguageThai.IsVisible = true;
                //    LanguageThai.IsEnabled = true;

                //    LanguageEng.IsVisible = false;
                //    LanguageEng.IsEnabled = false;

                //    Signin1.IsVisible = true;
                //    Signin2.IsVisible = false;
                //}

                if (App.Thai == true)
                {
                    LanguageThai.IsVisible = true;
                    LanguageThai.IsEnabled = true;

                    LanguageEng.IsVisible = false;
                    LanguageEng.IsEnabled = false;

                    Signin1.IsVisible = false;
                    Signin2.IsVisible = true;
                }
                else
                {
                    LanguageThai.IsVisible = false;
                    LanguageThai.IsEnabled = false;

                    LanguageEng.IsVisible = true;
                    LanguageEng.IsEnabled = true;

                    Signin1.IsVisible = true;
                    Signin2.IsVisible = false;
                }

                mUsernameEntry.Placeholder = Utils.getLabel(LabelConstants.MAPVIEW_PAGE_EMAIL);
                mPasswordEntry.Placeholder = Utils.getLabel(LabelConstants.LOGIN_PAGE_PASSWORD);
                forgetpassword.Text        = Utils.getLabel(LabelConstants.LOGIN_PAGE_FORGETPASSWORD);
                DonAccount.Text            = Utils.getLabel(LabelConstants.LOGIN_PAGE_DONACCOUNT);
                SignUP.Text = Utils.getLabel(LabelConstants.LOGIN_PAGE_SIGNUP);


                //         var username = "******";
                //var password = "******";
                //Login MasQLogin = new Login(username, password);
                //UIReturn uiReturn = LoginController.getInstance().LoginMember(MasQLogin);

                //if (uiReturn.isSuccess)
                //{
                //	Navigation.PushAsync(new MainPage());
                //}
                //else
                //{
                //	DisplayAlert("Click", uiReturn.getDescription(), "Close");
                //}

                //string A = Utils.getLabel(Constants.PAGE_USERNAME);

                if (SessionModel.loginMember != null)
                {
                    App.fristtime = true;
                    Navigation.PushAsync(new MainPage());
                }
            }
            else
            {
                App.RePagelogin = true;

                DisplayAlert(App.AppicationName, App.NoInternet, "Close");

                LanguageThai.IsVisible = true;
                LanguageThai.IsEnabled = true;

                LanguageEng.IsVisible = false;
                LanguageEng.IsEnabled = false;

                Signin1.IsVisible = false;
                Signin2.IsVisible = true;

                mUsernameEntry.Placeholder = "อีเมล";
                mPasswordEntry.Placeholder = "รหัสผ่าน";
                forgetpassword.Text        = "ลืมรหัสผ่าน | ช่วยเหลือ";
                DonAccount.Text            = "คุณยังไม่ได้สมัครสมาชิกใช่ใหม?";
                SignUP.Text = "สมัครสมาชิก";
            }
        }