private void Calculate(object sender, EventArgs e) { //get the product with the name that matches Products.product p = products.pl.find(comboBox1.SelectedItem.ToString()); // label1.Text = ("Price " + (p.price * Convert.ToDouble(numericUpDown1.Value)).ToString("C2")); }
public void AppendItem(Products.product p, double quantity) { currentReciept.Items.Add(new Transactions.Reciept.LineItem() { price = p.price, name = p.name, quantity = quantity }); WriteReciept(); //rewrites the current reciept }
private void AddItemToDatabaseButton(object sender, EventArgs e) { Products.product p = new Products.product(); p.name = textBox1.Text; p.price = double.Parse(textBox2.Text); products.pl.add(p); // save the database products.SaveDatabase(); UpdateComboboxes(); }
private void addtolistbutton(object sender, EventArgs e) { if (comboBox1.SelectedIndex < 0) { return; } //get the product with the name that matches Products.product p = products.pl.find(comboBox1.SelectedItem.ToString()); // double price = p.price * Convert.ToDouble(numericUpDown1.Value); label1.Text = "Price " + (price).ToString("C2"); AppendItem(p, Convert.ToDouble(numericUpDown1.Value)); }