Ejemplo n.º 1
0
 private void bnClear_Click(object sender, EventArgs e)
 {
     syst.clearTransaction();
     tbName.Text = "";
     tbPrice.Text = "";
     currentTransaction = null;
 }
Ejemplo n.º 2
0
        private void bnScan_Click(object sender, EventArgs e)
        {
            if (currentTransaction == null) currentTransaction = new Transaction();
            try
            {
                int bc = int.Parse(tbBarCode.Text);
                Item i = syst.locateItem(bc);
                currentTransaction.addItem(i);
                tbName.Text = i.getName();
                tbPrice.Text = String.Format("{0:0.00}", i.getPrice());
            }
            catch { MessageBox.Show("Item not found"); }

            tbBarCode.Text = "";
        }
Ejemplo n.º 3
0
        private void bnTotal_Click(object sender, EventArgs e)
        {
            if (currentTransaction == null) MessageBox.Show("No current Transaction");
            else
            {
                currentTransaction.executeTransaction();

                List<string> sl = currentTransaction.displayItems();
                if (sl != null)
                {
                    ListDialog listDialog = new ListDialog();
                    listDialog.AddDisplayItems(sl.ToArray());
                    listDialog.ShowDialog();

                    syst.addTransaction(currentTransaction);
                }
                currentTransaction = null;
            }

            tbName.Text = "";
            tbPrice.Text = "";
        }
Ejemplo n.º 4
0
 /*
  * Add a transaction to the list.
  */
 public void addTransaction(Transaction t)
 {
     _transactionList.Add(t);
 }