Example #1
0
        private void NextButtonClicked(object sender, EventArgs e)
        {
            try
            {
                if (NextButton.Text == AppResources.Label_Finish)
                {
                    var CredentialStatus = SQL_Commander.GetLoginCredentialsStatus();
                    if (CredentialStatus == "Registered")
                    {
                        var Credential = SQL_Commander.GetLoginCredentials("Registered");
                        Credential.Status = "Active";
                        SQL_Commander.UpdateLoginCredentials(Credential);
                        Settings.Session  = Credential.Session;
                        Settings.User_id  = Credential.UserID;
                        Settings.Username = Credential.Username;
                    }


                    App.GetMainPage();
                }
            }
            catch (Exception)
            {
                Navigation.PushModalAsync(new RegisterFriends());
            }
        }
Example #2
0
        private void NextButtonClicked(object sender, EventArgs e)
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                try
                {
                    var CredentialStatus = SQL_Commander.GetLoginCredentialsStatus();
                    if (CredentialStatus == "Registered")
                    {
                        var Credential    = SQL_Commander.GetLoginCredentials("Registered");
                        Credential.Status = "Active";
                        SQL_Commander.UpdateLoginCredentials(Credential);
                        Settings.Session  = Credential.Session;
                        Settings.User_id  = Credential.UserID;
                        Settings.Username = Credential.Username;
                    }


                    await Navigation.PushAsync(new RegisterFriends());
                }
                catch (Exception)
                {
                    await Navigation.PushModalAsync(new RegisterFriends());
                }
                // Navigation.PushAsync(new WalkThrough_Page2());
                //Navigation.RemovePage(this);
            });
        }
Example #3
0
        public App()
        {
            L10n.SetLocale();
            var netLanguage = DependencyService.Get <ILocale>().GetCurrent();

            AppResources.Culture = new CultureInfo(netLanguage);

            SQL_Entity.Connect();



            //Data.ClearLoginCredentialsList();
            var CredentialStatus = SQL_Commander.GetLoginCredentialsStatus();


            InitializeComponent();


            if (CredentialStatus == "Active")
            {
                var Credential = SQL_Commander.GetLoginCredentials("Active");
                Settings.Session          = Credential.Session;
                Settings.User_id          = Credential.UserID;
                Settings.Username         = Credential.Username;
                Settings.Onesignal_APP_ID = Credential.Onesignal_APP_ID;
                if (Credential.NotificationLedColor != "")
                {
                    Settings.NotificationVibrate      = Credential.NotificationVibrate;
                    Settings.NotificationSound        = Credential.NotificationSound;
                    Settings.NotificationPopup        = Credential.NotificationPopup;
                    Settings.NotificationLedColor     = Credential.NotificationLedColor;
                    Settings.NotificationLedColorName = Credential.NotificationLedColor;
                }
                else
                {
                    Credential.NotificationVibrate      = true;
                    Credential.NotificationLedColor     = Settings.MainColor;
                    Credential.NotificationLedColorName = AppResources.Label_Led_Color;
                    Credential.NotificationSound        = true;
                    Credential.NotificationPopup        = true;
                    SQL_Commander.UpdateLoginCredentials(Credential);
                    Settings.NotificationVibrate      = true;
                    Settings.NotificationSound        = true;
                    Settings.NotificationPopup        = true;
                    Settings.NotificationLedColor     = Settings.MainColor;
                    Settings.NotificationLedColorName = AppResources.Label_Led_Color;
                }


                //Start Onesignal
                OneSignalNotificationController.RegisterNotificationDevice();
                var navigationPage = new NavigationPage(new MasterMain())
                {
                };
                navigationPage.BarBackgroundColor = Color.FromHex(Settings.MainPage_HeaderBackround_Color);
                navigationPage.BarTextColor       = Color.FromHex(Settings.MainPage_HeaderText_Color);
                navigationPage.Title   = Settings.MainPage_HeaderTextLabel;
                navigationPage.Padding = new Thickness(0, 0, 0, 0);
                MainPage = navigationPage;
            }
            else
            {
                if (CredentialStatus == "Registered")
                {
                    var Credential = SQL_Commander.GetLoginCredentials("Registered");
                    Settings.Session  = Credential.Session;
                    Settings.User_id  = Credential.UserID;
                    Settings.Username = Credential.Username;
                    MainPage          = new NavigationPage(new UploudPicPage());
                }
                else
                {
                    MainPage = new NavigationPage(new WelcomePage());
                }
            }
        }