Esempio n. 1
0
        private void TenderCredit(object sender, EventArgs e)
        {
            SetUserInterfaceState(UserInterfaceStates.TENDERING);

            TenderDialog dlg = new TenderDialog();

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.CashValidator = 0.00m;
            dlg.Label         = "Auth #";
            DialogResult dr = dlg.ShowDialog(this.mainWindow);

            if (dr == DialogResult.OK)
            {
                this.printer.OpenDrawer();
                DateTime timeOfPurchase = DateTime.Now;
                this.printer.PrintReceipt(timeOfPurchase, "credit", dlg.OtherData, Purchase.TotalDue());

                Purchase.WriteLogs(timeOfPurchase);

                this.tapeDisplay.Clear();
                SetUserInterfaceState(UserInterfaceStates.IDLE);
            }
            else
            {
                SetUserInterfaceState(UserInterfaceStates.INPROGRESS);
            }
        }
Esempio n. 2
0
        private void TenderCash(object sender, EventArgs e)
        {
            SetUserInterfaceState(UserInterfaceStates.TENDERING);

            TenderDialog dlg = new TenderDialog();

            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.CashValidator = Purchase.TotalDue();
            DialogResult dr = dlg.ShowDialog(this.mainWindow);

            if (dr == DialogResult.OK)
            {
                this.printer.OpenDrawer();
                DateTime timeOfPurchase = DateTime.Now;
                this.printer.PrintReceipt(timeOfPurchase, "cash", "", dlg.TenderedCash);

                Purchase.WriteLogs(timeOfPurchase);

                ChangeDue change = new ChangeDue(dlg.TenderedCash - Purchase.TotalDue());
                change.StartPosition = FormStartPosition.CenterParent;
                dr = change.ShowDialog(this.mainWindow);

                this.tapeDisplay.Clear();
                SetUserInterfaceState(UserInterfaceStates.IDLE);
            }
            else
            {
                SetUserInterfaceState(UserInterfaceStates.INPROGRESS);
            }
        }