Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            CashSuper csuper      = CashFactory.createCashAccept(comboBox1.SelectedItem.ToString());
            double    totalPrices = 0d;

            totalPrices = csuper.acceptCash(Convert.ToDouble(textBox1.Text) * Convert.ToDouble(textBox2.Text));
            total       = total + totalPrices;
            listBox1.Items.Add("單價:" + textBox1.Text + "數量:" + textBox2.Text + " " + comboBox1.SelectedItem + "合計:" + totalPrices.ToString());
            label5.Text = total.ToString();
        }
 public double GetResult(double money)
 {
     return(cs.acceptCash(money));
 }