public virtual void 設定飲料(單點 other) { if (other.Type() == "貴的飲料") { Price += 15; } this.飲料 = other; }
public void 重複添加(單點 other) { int number = 1; foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Cells[0].Value != null) { if (row.Cells[0].Value.ToString() == other.GetName()) { number = (int)row.Cells[2].Value + 1; dataGridView1.Rows.Remove(row); } } } dataGridView1.Rows.Add(other.GetName(), other.GetPrice(), number, number * other.GetPrice()); B總價_Click(sender, e); }
public 加大(單點 other) { this.單點 = other; }
public virtual void 設定配料(單點 other) { this.配料 = other; }
public virtual void 設定主菜(單點 other) { this.主菜 = other; }
public 卡拉雞腿堡(單點 HAMBURGER) { this.hamburger = HAMBURGER; }