private void buttonNext0_Click(object sender, EventArgs e) { panel1.Visible = true; Customer2 customer = new Customer2(/*textBox1.Text,textBox2.Text,textBox3.Text,textBox6.Text*/); customer.Namee = textBox1.Text; customer.Surname = textBox2.Text; customer.Number = textBox3.Text; customer.Address = textBox6.Text; List <Customer2> cst = new List <Customer2>(); cst.Add(customer); dataGridView1.DataSource = cst; }
private void buttonAdd3_Click(object sender, EventArgs e) { foreach (object itemChecked in checkedListBox3.CheckedItems) { DataRowView castedItem = itemChecked as DataRowView; string foodname = castedItem["Foodname"].ToString(); int price = int.Parse(castedItem["Price"].ToString()); total += price; panel1.Visible = true; Customer2 customer = new Customer2(/*textBox1.Text,textBox2.Text,textBox3.Text,textBox6.Text*/); customer.addorder(textBox1.Text, textBox2.Text, textBox3.Text, textBox6.Text, foodname, price); cst.Add(customer); } }