Пример #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            TraderHome frm = new TraderHome();

            frm.Show();
            this.Close();
        }
Пример #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;
                    }
                }
            }
        }
Пример #3
0
        private void button_createListing_Click(object sender, RoutedEventArgs e)
        {
            string t    = textBox_bookTitle.Text;
            string a    = textBox_authors.Text;
            string ed   = textBox_edition.Text;
            string i    = textBox_isbn.Text;
            string last = " ";

            string[]  strArray = comboBox_cC.SelectedItem.ToString().Split();     //to get 4 characters course code
            Course    course   = new Course(strArray[1].Trim(), textBox_cL.Text); //since ToString() gives a bunch of gibberish
            Condition cond     = (Condition)comboBox_condition.SelectedItem;

            double  p   = Convert.ToDouble(textBox_price.Text);
            string  des = textBox_description.Text;
            Listing l   = new Listing(t, a, ed, i, course, cond, p, last, des);

            l.CreateListing(currtrad.Trader_id);

            TraderHome frm = new TraderHome(currtrad);

            frm.Show();
            this.Close();
        }