コード例 #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new TellerForm());

            //Construct the models.
            CustomerDB cDatabase = new CustomerDB();
            AccountDB aDatabase = new AccountDB();

            //Create virtual Donald Trump.
            cDatabase.addNewCustomer("D. Trump", "Atlantic City, NJ");
            aDatabase.addNewAccount(1, 80);
            MessageBox.Show("Account number 100 constructed for D.Trump.", "New Customer Created");

            //Create Virtual Bill Gates. He gets $10,000 and a custoemr number of 2.
            cDatabase.addNewCustomer("Bill Gates", "Microsoft Lane, United States");
            aDatabase.addNewAccount(2, 10000);
            MessageBox.Show("Account number 101 constructed for Bill Gates.", "New Customer Created");

            //Construct the controllers for the ATM's.
            AtmPresenter ATMController1 = new AtmPresenter(cDatabase, aDatabase);
            AtmPresenter ATMController2 = new AtmPresenter(cDatabase, aDatabase);

            //Construct the controller for the Teller form.
            TellerController TellerConroller1 = new TellerController(aDatabase, cDatabase);

            //Construct the threads for the ATM's.
            new Thread(ATMThread1).Start(ATMController1);
            new Thread(ATMThread2).Start(ATMController2);

            //Construct the thread for the Teller assmebly.
            new Thread(TellerThread1).Start(TellerConroller1);
        }
コード例 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Construct the models.
            CustomerDB cDatabase = new CustomerDB();
            AccountDB aDatabase = new AccountDB();

            //Create virtual Donald Trump.
            cDatabase.addNewCustomer("D. Trump", "Atlantic City, NJ");
            aDatabase.addNewAccount(1, 80);
            MessageBox.Show("Account number 100 constructed for D.Trump.", "New Customer Created");

            //Construct the controller.
            AtmPresenter controller = new AtmPresenter(cDatabase, aDatabase);
            AtmPresenter controller2 = new AtmPresenter(cDatabase, aDatabase);
            //Construct the view.
            new Thread(ATMThread1).Start(controller);
            new Thread(ATMThread2).Start(controller2);
        }
コード例 #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Construct the models.
            CustomerDB cDatabase = new CustomerDB();
            AccountDB  aDatabase = new AccountDB();

            //Create virtual Donald Trump.
            cDatabase.addNewCustomer("D. Trump", "Atlantic City, NJ");
            aDatabase.addNewAccount(1, 80);
            MessageBox.Show("Account number 100 constructed for D.Trump.", "New Customer Created");

            //Construct the controller.
            AtmPresenter controller  = new AtmPresenter(cDatabase, aDatabase);
            AtmPresenter controller2 = new AtmPresenter(cDatabase, aDatabase);

            //Construct the view.
            new Thread(ATMThread1).Start(controller);
            new Thread(ATMThread2).Start(controller2);
        }
コード例 #4
0
 /// <summary>
 /// Constructor for the form.
 /// </summary>
 public ATMForm(AtmPresenter controller)
 {
     InitializeComponent();
     uxDisplayMenuLabel.Text = message[state];
     this.controller         = controller;
 }
コード例 #5
0
 /// <summary>
 /// Constructor for the form.
 /// </summary>
 public ATMForm(AtmPresenter controller)
 {
     InitializeComponent();
     uxDisplayMenuLabel.Text = message[state];
     this.controller = controller;
 }