示例#1
0
文件: Till.cs 项目: Ripper555/SCS
 private void bnClear_Click(object sender, EventArgs e)
 {
     syst.clearTransaction();
     tbName.Text = "";
     tbPrice.Text = "";
     currentTransaction = null;
 }
示例#2
0
文件: Till.cs 项目: Ripper555/SCS
        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 = "";
        }
示例#3
0
文件: Till.cs 项目: Ripper555/SCS
        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 = "";
        }
示例#4
0
 /*
  * Add a transaction to the list.
  */
 public void addTransaction(Transaction t)
 {
     _transactionList.Add(t);
 }