예제 #1
0
 public SalesManager(ModelI m)
 {
     dataBase     = m;
     transHandler = new TransactionHandler(createTransaction);
     itemHandler  = new ItemHandler(addItem);
     endHandler   = new EndTransactionHandler(endTransaction);
 }
예제 #2
0
        static void Main()
        {
            // Set up model
            Database dataBase        = new Database();
            ModelI   controllerModel = dataBase;
            Database viewModel       = dataBase;

            // Set up controllers
            SalesManager   transactionController  = new SalesManager(controllerModel);
            SalesManager   trasactionController_C = new SalesManager(controllerModel);
            ReturnsManager returnController       = new ReturnsManager(controllerModel);
            RebateManager  rebateController       = new RebateManager(controllerModel);

            // Set up output
            GeneratedCode.ReciptOutputView    reciptOutput    = new GeneratedCode.ReciptOutputView(dataBase);
            GeneratedCode.RebateOutputView    rebateOutput    = new GeneratedCode.RebateOutputView(dataBase);
            GeneratedCode.uxForm              genRebateOutput = new GeneratedCode.uxForm(dataBase);
            GeneratedCode.ConsoleReciptOutput consoleOutput   = new GeneratedCode.ConsoleReciptOutput(dataBase);

            // Set up input views
            cashierView  = new GeneratedCode.CashierInputView(transactionController.transHandler, transactionController.itemHandler, transactionController.endTransaction);
            customerView = new GeneratedCode.uxReturnList(returnController.returnItem, returnController.endReturn);
            rebateView   = new GeneratedCode.RebateInputView(rebateController.enterRebate, rebateController.genRebate);
            consoleInput = new GeneratedCode.ConsoleInput(trasactionController_C.transHandler, trasactionController_C.itemHandler, trasactionController_C.endTransaction);

            // Add observers
            transactionController.register(reciptOutput.run);
            trasactionController_C.register(consoleOutput.run);
            returnController.register(reciptOutput.run);
            rebateController.register(rebateOutput.run, genRebateOutput.run);

            // Set up and run application
            Application.EnableVisualStyles();

            //runs forms on own threads
            new Thread(Driver1).Start();
            new Thread(Driver2).Start();
            new Thread(Driver3).Start();
            new Thread(Driver4).Start();
        }
예제 #3
0
 public ReturnsManager(ModelI m)
 {
     dataBase      = m;
     returnHandler = new ReturnHandler(returnItem);
 }
예제 #4
0
 public RebateManager(ModelI d)
 {
     dataBase           = d;
     enterRebateHandler = new EnterRebateHandler(enterRebate);
     genRebateHandler   = new GenRebateHandler(genRebate);
 }