private void Button2_Click(object sender, EventArgs e) { listBox1.Items.Clear(); listBox2.Items.Clear(); double costVizits = 0.08; textBox3.Text = ""; if (radioButton1.Checked) { if (!checkBox1.Checked) { costVizits /= 2; } if (checkBox2.Checked) { costVizits *= 1.8; } if (checkBox3.Checked) { costVizits *= 3; } money = new Revenue(comboBox1.Text, Convert.ToDouble(textBox1.Text), costVizits); } if (radioButton2.Checked) { money = new Cost(comboBox1.Text, Convert.ToDouble(textBox2.Text)); } data.Add(money); }
private void Button3_Click(object sender, EventArgs e) { double s = 0; for (int i = 0; i < data.Count; i++) { money = (MoneySite)data[i]; s += money.sum(); } textBox3.Text = string.Format("{0:f2}", s); }
private void Button5_Click(object sender, EventArgs e) { listBox2.Items.Clear(); for (int i = 0; i < data.Count; i++) { money = (MoneySite)data[i]; if (money.GetType().Name == "Cost") { listBox2.Items.Add(money.info()); } } }