Beispiel #1
0
        private void users_Click(object sender, RoutedEventArgs e)
        {
            PayLoadData data = new PayLoadData();

            data.thisContext = db;

            this.Frame.Navigate(typeof(UserList), data);
        }
Beispiel #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            // Add Thread
            PayLoadData data = new PayLoadData();

            data.thisContext = db;
            data.thisUser    = thisUser;

            this.Frame.Navigate(typeof(ThreadAdd), data);
        }
Beispiel #3
0
        private void dataList_DoubleClick(object sender, RoutedEventArgs e)
        {
            // Open Thread
            try
            {
                Thread thisThread = (Thread)dataList.SelectedItem;

                PayLoadData data = new PayLoadData();
                data.thisContext = db;
                data.thisThread  = thisThread;
                data.thisUser    = thisUser;

                Frame.Navigate(typeof(ThreadWindow), data);
            }

            catch (Exception exc)
            {
                MessageDialog alert = new MessageDialog(exc.Message, "Exception");
                alert.ShowAsync();
            }
        }
Beispiel #4
0
        private void DoLogin()
        {
            // Login to system
            if (username.Text.Length != 0 && password.Password.Length != 0)
            {
                string passHash = passwordEncode(password.Password);
                User   thisUser = db.UserSet.SingleOrDefault(user => user.username == username.Text && user.password == passHash);

                if (thisUser != null)
                {
                    // Log OK
                    ApplicationDataContainer roamingSettings = ApplicationData.Current.RoamingSettings;

                    roamingSettings.Values["login"]    = username.Text;
                    roamingSettings.Values["password"] = password.Password;

                    PayLoadData data = new PayLoadData();
                    data.thisPage    = this;
                    data.thisContext = db;
                    data.thisUser    = thisUser;

                    Frame.Navigate(typeof(ThreadList), data);
                }

                else
                {
                    // Log WRONG
                    MessageDialog info = new MessageDialog("Password is wrong.", "Warning");
                    info.ShowAsync();
                }
            }

            else
            {
                MessageDialog info = new MessageDialog("Username or password is empty!", "Warning");
                info.ShowAsync();
            }
        }