private async void Send_Click(object sender, RoutedEventArgs e)
        {
            if (await UserManager.SendForgottenEmail(EmailBox.Text))
            {
                ContentDialogWithOK dialog = new ContentDialogWithOK
                {
                    DataContext = new
                    {
                        MsgText = "The new password has been sent to your email!"
                    }
                };
                await dialog.ShowAsync();

                Frame.Navigate(typeof(LoginScreen));
            }
            else
            {
                ContentDialogWithOK dialog = new ContentDialogWithOK
                {
                    DataContext = new
                    {
                        MsgText = "Invalid email!"
                    }
                };
            }
        }
        private async void Modify_Click(object sender, RoutedEventArgs e)
        {
            if (PasswordBox.Password == RePasswordBox.Password && UserManager.LoginedUser.EncryptedPassword == UserManager.LoginedUser.EncodePassword(OldPassowordBox.Password))
            {
                UserManager.LoginedUser.ModifyPassword(PasswordBox.Password);
                ContentDialogWithOK dialog = new ContentDialogWithOK
                {
                    DataContext = new
                    {
                        MsgText = "Password succesfully changed!"
                    }
                };
                await dialog.ShowAsync();

                this.Frame.Navigate(typeof(MainSettings));
            }
            else
            {
                ContentDialogWithOK dialog = new ContentDialogWithOK
                {
                    DataContext = new
                    {
                        MsgText = "One of the given passwords are bad!"
                    }
                };
                await dialog.ShowAsync();
            }
        }
Example #3
0
        private async void Logout_Click(object sender, RoutedEventArgs e)
        {
            UserManager.Logout();
            Collections.ResreshSenderDataEvent -= RefreshAvgTemp;
            StopClock();
            ContentDialogWithOK dialog = new ContentDialogWithOK
            {
                DataContext = new
                {
                    MsgText = "Succesful logout!"
                }
            };
            await dialog.ShowAsync();

            this.Frame.Navigate(typeof(MainPage));
        }
Example #4
0
 private async void Bt_AddExisting(object sender, RoutedEventArgs e)
 {
     if (Collections.Rooms.Any())
     {
         Frame.Navigate(typeof(Map), "Localizing");
     }
     else
     {
         ContentDialogWithOK dialog = new ContentDialogWithOK
         {
             DataContext = new
             {
                 MsgText = "You must create atleast one room at first!"
             }
         };
         await dialog.ShowAsync();
     }
 }
        private async void Login_Click(object sender, RoutedEventArgs e)
        {
            if (UserManager.Login
                    (PasswordBox.Password, EmailBox.Text))
            {
                Frame.Navigate(typeof(MainPage));
            }
            else
            {
                ContentDialogWithOK dialog = new ContentDialogWithOK
                {
                    DataContext = new
                    {
                        MsgText = "Invalid password or email!"
                    }
                };
                await dialog.ShowAsync();

                PasswordBox.Password = "";
            }
        }
Example #6
0
        private async void Open_Control(object sender, RoutedEventArgs e)
        {
            if (Collections.Rooms.Any())
            {
                Collections.ResreshSenderDataEvent -= RefreshAvgTemp;
                StopClock();
                this.Frame.Navigate(typeof(Map), "Switch");
            }
            else
            {
                ContentDialogWithOK dialog = new ContentDialogWithOK
                {
                    DataContext = new
                    {
                        MsgText = "You must create atleast one room at first!"
                    }
                };
                await dialog.ShowAsync();

                this.Frame.Navigate(typeof(Localizer));
            }
        }