Example #1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            Moderator_Home frm = new Moderator_Home();

            frm.Show();
            this.Close();
        }
Example #2
0
        private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            Trader        login        = new Trader();
            TraderList    userlist     = new TraderList();
            List <Trader> searchResult = userlist.SearchForUser(usernameTextBox.Text);

            if (searchResult.Count == 0)
            {
                Invalid_Login badLogin = new Invalid_Login();
                badLogin.Show();
            }
            else
            {
                for (int i = 0; i < searchResult.Count; i++)
                {
                    if (searchResult[i].Password == passwordBox.Password)
                    {
                        login = searchResult[i];

                        if (login.isModerator())
                        {
                            Moderator      mod     = new Moderator(login.Username, login.Password, login.FirstName, login.LastName, login._Email.ToString(), login.Trader_id, login.isModerator());
                            Moderator_Home modhome = new Moderator_Home(mod);
                            modhome.Show();
                            this.Close();
                        }
                        else
                        {
                            TraderHome tradehome = new TraderHome(login);
                            tradehome.Show();
                            this.Close();
                        }

                        break;
                    }
                }
            }
        }