コード例 #1
0
ファイル: Purchase.cs プロジェクト: jwbirdsa/PointOfSale
 public static void AddMerchandise(LineItem li)
 {
     Purchase.merchandise.Add(li);
     DiscountManager.Inspect();
     Purchase.masterDiscountApply = false;
     Purchase.masterDiscountApply = (Purchase.Subtotal() >= Utilities.GetMasterDiscountThreshhold());
 }
コード例 #2
0
ファイル: Purchase.cs プロジェクト: jwbirdsa/PointOfSale
 public static void DeleteMerchandise(string matchThis)
 {
     foreach (LineItem li in Purchase.merchandise)
     {
         if (li.Format().CompareTo(matchThis) == 0)
         {
             Purchase.merchandise.Remove(li);
             break;
         }
     }
     DiscountManager.Inspect();
     Purchase.masterDiscountApply = false;
     Purchase.masterDiscountApply = (Purchase.Subtotal() >= Utilities.GetMasterDiscountThreshhold());
 }
コード例 #3
0
        public void Setup()
        {
            Int32 systemButtonsLeft = this.mainWindow.Width - 10 - tapeDisplay.MainWidth - 20 - buttonHSpace;
            //systemButtonsLeft /= buttonHSpace;
            //systemButtonsLeft *= buttonHSpace;

            Int16 b = 0;
            Int32 systemButtonsTop = 10;

            Color systemButtonsColor = Color.YellowGreen;

            this.startPurchase           = new UniformButton();
            this.startPurchase.Parent    = this.mainWindow;
            this.startPurchase.Text      = "Start";
            this.startPurchase.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.startPurchase.Width     = buttonWidth;
            this.startPurchase.Height    = buttonHeight;
            this.startPurchase.BackColor = systemButtonsColor;
            this.startPurchase.Click    += new EventHandler(StartPurchase);

            b++;

            this.editPurchase           = new UniformButton();
            this.editPurchase.Parent    = this.mainWindow;
            this.editPurchase.Text      = "Remove Items";
            this.editPurchase.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.editPurchase.Width     = buttonWidth;
            this.editPurchase.Height    = buttonHeight;
            this.editPurchase.BackColor = systemButtonsColor;
            this.editPurchase.Click    += new EventHandler(EditPurchase);

            b++;

            this.tenderCash           = new UniformButton();
            this.tenderCash.Parent    = this.mainWindow;
            this.tenderCash.Text      = "Cash";
            this.tenderCash.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.tenderCash.Width     = buttonWidth;
            this.tenderCash.Height    = buttonHeight;
            this.tenderCash.BackColor = systemButtonsColor;
            this.tenderCash.Click    += new EventHandler(TenderCash);

            this.tenderCheck           = new UniformButton();
            this.tenderCheck.Parent    = this.mainWindow;
            this.tenderCheck.Text      = "Check";
            this.tenderCheck.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.tenderCheck.Width     = buttonWidth;
            this.tenderCheck.Height    = buttonHeight;
            this.tenderCheck.BackColor = systemButtonsColor;
            this.tenderCheck.Click    += new EventHandler(TenderCheck);

            this.tenderCredit           = new UniformButton();
            this.tenderCredit.Parent    = this.mainWindow;
            this.tenderCredit.Text      = "Credit";
            this.tenderCredit.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.tenderCredit.Width     = buttonWidth;
            this.tenderCredit.Height    = buttonHeight;
            this.tenderCredit.BackColor = systemButtonsColor;
            this.tenderCredit.Click    += new EventHandler(TenderCredit);

            this.cut           = new UniformButton();
            this.cut.Parent    = this.mainWindow;
            this.cut.Text      = "Cut";
            this.cut.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.cut.Width     = buttonWidth;
            this.cut.Height    = buttonHeight;
            this.cut.BackColor = systemButtonsColor;
            this.cut.Click    += new EventHandler(Cut);

            this.noSale           = new UniformButton();
            this.noSale.Parent    = this.mainWindow;
            this.noSale.Text      = "No Sale";
            this.noSale.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.noSale.Width     = buttonWidth;
            this.noSale.Height    = buttonHeight;
            this.noSale.BackColor = Color.YellowGreen;
            this.noSale.Click    += new EventHandler(NoSale);

            b++;

            this.reprintLastReceipt           = new UniformButton();
            this.reprintLastReceipt.Parent    = this.mainWindow;
            this.reprintLastReceipt.Text      = "Reprint Receipt";
            this.reprintLastReceipt.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.reprintLastReceipt.Width     = buttonWidth;
            this.reprintLastReceipt.Height    = buttonHeight;
            this.reprintLastReceipt.BackColor = systemButtonsColor;
            this.reprintLastReceipt.Click    += new EventHandler(ReprintLastReceipt);

            this.openDrawer           = new UniformButton();
            this.openDrawer.Parent    = this.mainWindow;
            this.openDrawer.Text      = "Open Drawer";
            this.openDrawer.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            this.openDrawer.Width     = buttonWidth;
            this.openDrawer.Height    = buttonHeight;
            this.openDrawer.BackColor = systemButtonsColor;
            this.openDrawer.Click    += new EventHandler(OpenDrawer);

            b++;

            UniformButton selPrinter = new UniformButton();

            selPrinter.Parent    = this.mainWindow;
            selPrinter.Text      = "Select Printer";
            selPrinter.Location  = new Point(systemButtonsLeft, systemButtonsTop + (buttonVSpace * b++));
            selPrinter.Width     = buttonWidth;
            selPrinter.Height    = buttonHeight;
            selPrinter.BackColor = systemButtonsColor;
            selPrinter.Click    += new EventHandler(SelPrinter);

            this.buttonManager.Setup();
            DiscountManager.Setup();

            SetUserInterfaceState(UserInterfaceStates.INITIALIZING);
        }