private void btnAdd_Click(object sender, EventArgs e) { Milktea.Quantity = Convert.ToDouble(numQuantity.Value); Milktea.ComputePrice(); TransactionHistory.priceTotal.Add(Milktea.MilkteaPrice); Transact.Total = TransactionHistory.priceTotal.Sum(); Transact.isVATable(Transact.Total); hist = "Milktea: " + Milktea.MilkteaName + "\r\n" + "Size: " + Milktea.Size + "\r\n" + "Sugar Level: " + Milktea.SugarLevel + "\r\n" + "Add-ons: " + Milktea.Sinkers + "\r\n" + "Price: " + Milktea.MilkteaPrice.ToString() + "\r\n"; TransactionHistory.History.Add(hist); this.Close(); }
private void btnRemove_Click(object sender, EventArgs e) { try { order = (Convert.ToInt32(txtRemove.Text) - 1); TransactionHistory.History.RemoveAt(order); TransactionHistory.priceTotal.RemoveAt(order); Transact.Total = TransactionHistory.priceTotal.Sum(); Transact.isVATable(Transact.Total); updateDisplay(); } catch { MessageBox.Show("Please input an existing order"); txtRemove.ResetText(); } txtRemove.Text = "Type the Order #"; this.txtRemove.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtRemove.ForeColor = System.Drawing.Color.Gray; }