示例#1
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();
        }
示例#2
0
 public virtual void AddListing(Listing listing, int trader_id)
 {
     listing.CreateListing(trader_id);
 }