private void button1_Click(object sender, EventArgs e) { CashSuper csuper = CashFactory.createCashAccept(comboBox1.SelectedItem.ToString()); double totalPrice = 0d; totalPrice = csuper.acceptCash(Convert.ToDouble(txtPrice.Text) * Convert.ToDouble(txtNum.Text)); total = total + totalPrice; lbxInfo.Items.Add("单价:" + txtPrice.Text + " 数量:" + txtNum.Text + " 合计:" + totalPrice); lblTotal.Text = total.ToString(); }
public double GetResult(double money) { return(cs.acceptCash(money)); }