Пример #1
0
        private void PersonalDetailsContinueButton_Click(object sender, EventArgs e)
        {
            DateTime.TryParse(dateOfBirth.Text, out DateTime dob);
            Account acc     = new CurrentAccount(100m, 1234567890L);
            Address address = new Address
            {
                Line1    = AddressLine1TextBox.Text,
                Line2    = AddressLine2TextBox.Text,
                City     = CityTextBox.Text,
                County   = CountyTextBox.Text,
                Postcode = PostcodeTextbox.Text
            };
            AccountHolder ah = new AccountHolder
            {
                MyAccount   = acc,
                LastName    = LastNameTextBox.Text,
                Prefix      = TitleTextBox.Text,
                FirstName   = FirstNameTextBox.Text,
                MiddleName  = MiddleNameTextBox.Text,
                DateOfBirth = dob,
                MyAddress   = address,
                AccountType = AccountTypeComboBox.Text
            };

            bool isSuccess = NewAccountController.Process(ah);
        }
Пример #2
0
        public NewAccountView()
        {
            // Create the controller
            controller = new NewAccountController();

            // Handlers for external events
            controller.DomainsReceivedFromServer += new NewAccountController.ExternalEventHandler(OnDomainsReceived);
            controller.DomainsTimeOut            += new NewAccountController.ExternalEventHandler(OnDomainsTimeOut);
            controller.LocalVerificationComplete += new NewAccountController.ExternalEventHandler(OnLocalVerificationComplete);
            controller.CreateAccountDeny         += new NewAccountController.ExternalEventHandler(OnCreateAccountDeny);
            controller.UsernameTaken             += new NewAccountController.ExternalEventHandler(OnUsernameTaken);
            controller.Timeout                  += new NewAccountController.ExternalEventHandler(OnTimeOut);
            controller.CreateAccountInit        += new NewAccountController.ExternalEventHandler(OnCreateAccountInit);
            controller.QuizesReceivedFromServer += new NewAccountController.ExternalEventHandler(OnStartTest);

            // Register the controller handlers to the service
            controller.RegisterHandlers();

            // Initialize Component
            InitializeComponent();

            // Set the parent and display the window
            SetMdiParent();
            ShowForm();

            // Handlers for internal events
            this.FormClosing          += new System.Windows.Forms.FormClosingEventHandler(OnFormClosing);
            CreateNewAccountBtn.Click += new System.EventHandler(CreateNewAccountBtn_Click);
            CancelBtn.Click           += new System.EventHandler(CancelBtn_Click);
            tryagain.Click            += new System.EventHandler(tryagain_Click);
            username.MouseEnter       += new System.EventHandler(username_MouseEnter);
            password.MouseEnter       += new System.EventHandler(password_MouseEnter);
            confirm.MouseEnter        += new System.EventHandler(confirm_MouseEnter);
            email.MouseEnter          += new System.EventHandler(email_MouseEnter);
            domains.MouseEnter        += new System.EventHandler(domains_MouseEnter);
            username.KeyDown          += new System.Windows.Forms.KeyEventHandler(username_KeyDown);
            password.KeyDown          += new System.Windows.Forms.KeyEventHandler(password_KeyDown);
            confirm.KeyDown           += new System.Windows.Forms.KeyEventHandler(confirm_KeyDown);
            email.KeyDown             += new System.Windows.Forms.KeyEventHandler(email_KeyDown);

            username.Focus();
        }
Пример #3
0
        public NewAccountView()
        {
            // Create the controller
            controller = new NewAccountController();

            // Handlers for external events
            controller.DomainsReceivedFromServer += new NewAccountController.ExternalEventHandler(OnDomainsReceived);
            controller.DomainsTimeOut += new NewAccountController.ExternalEventHandler(OnDomainsTimeOut);
            controller.LocalVerificationComplete += new NewAccountController.ExternalEventHandler(OnLocalVerificationComplete);
            controller.CreateAccountDeny += new NewAccountController.ExternalEventHandler(OnCreateAccountDeny);
            controller.UsernameTaken += new NewAccountController.ExternalEventHandler(OnUsernameTaken);
            controller.Timeout += new NewAccountController.ExternalEventHandler(OnTimeOut);
            controller.CreateAccountInit += new NewAccountController.ExternalEventHandler(OnCreateAccountInit);
            controller.QuizesReceivedFromServer += new NewAccountController.ExternalEventHandler(OnStartTest);

            // Register the controller handlers to the service
            controller.RegisterHandlers();

            // Initialize Component
            InitializeComponent();

            // Set the parent and display the window
            SetMdiParent();
            ShowForm();

            // Handlers for internal events
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(OnFormClosing);
            CreateNewAccountBtn.Click += new System.EventHandler(CreateNewAccountBtn_Click);
            CancelBtn.Click += new System.EventHandler(CancelBtn_Click);
            tryagain.Click += new System.EventHandler(tryagain_Click);
            username.MouseEnter += new System.EventHandler(username_MouseEnter);
            password.MouseEnter += new System.EventHandler(password_MouseEnter);
            confirm.MouseEnter += new System.EventHandler(confirm_MouseEnter);
            email.MouseEnter += new System.EventHandler(email_MouseEnter);
            domains.MouseEnter += new System.EventHandler(domains_MouseEnter);
            username.KeyDown += new System.Windows.Forms.KeyEventHandler(username_KeyDown);
            password.KeyDown += new System.Windows.Forms.KeyEventHandler(password_KeyDown);
            confirm.KeyDown += new System.Windows.Forms.KeyEventHandler(confirm_KeyDown);
            email.KeyDown += new System.Windows.Forms.KeyEventHandler(email_KeyDown);

            username.Focus();
        }
Пример #4
0
        public NewAccountTestView(int type, Form parent)
        {
            // Create the controller
            controller = new NewAccountController();

            // Handlers for external events
            controller.Tick             += new NewAccountController.ExternalEventHandler(OnTick);
            controller.TimeExpired      += new NewAccountController.ExternalEventHandler(OnTimeExpired);
            controller.QuestionChanged  += new NewAccountController.ExternalEventHandler(OnQuestionChanged);
            controller.TestChanged      += new NewAccountController.ExternalEventHandler(OnTestChanged);
            controller.AllTestsFinished += new NewAccountController.ExternalEventHandler(OnAllTestsFinished);

            // Register the controller handlers to the service
            controller.RegisterHandlers();

            // Initialize Component
            InitializeComponent();

            // Set the parent and display the window
            SetMdiParent();
            ShowForm();

            // Handlers for internal events
            this.FormClosing             += new System.Windows.Forms.FormClosingEventHandler(OnFormClosing);
            timer1.Tick                  += new System.EventHandler(timer1_Tick);
            NextQuestionButton.Click     += new System.EventHandler(NextQuestionButton_Click);
            PreviousQuestionButton.Click += new System.EventHandler(PreviousQuestionButton_Click);
            FinishTestButton.Click       += new System.EventHandler(FinishTestButton_Click);
            ReturnToLogin.Click          += new System.EventHandler(ReturnToLogin_Click);
            varA.Click += new System.EventHandler(varA_Click);
            varB.Click += new System.EventHandler(varB_Click);
            varC.Click += new System.EventHandler(varC_Click);
            varD.Click += new System.EventHandler(varD_Click);

            this.type       = type;
            this.parentForm = parent;
        }
Пример #5
0
        public NewAccountTestView(int type, Form parent)
        {
            // Create the controller
            controller = new NewAccountController();

            // Handlers for external events
            controller.Tick += new NewAccountController.ExternalEventHandler(OnTick);
            controller.TimeExpired += new NewAccountController.ExternalEventHandler(OnTimeExpired);
            controller.QuestionChanged += new NewAccountController.ExternalEventHandler(OnQuestionChanged);
            controller.TestChanged += new NewAccountController.ExternalEventHandler(OnTestChanged);
            controller.AllTestsFinished += new NewAccountController.ExternalEventHandler(OnAllTestsFinished);

            // Register the controller handlers to the service
            controller.RegisterHandlers();

            // Initialize Component
            InitializeComponent();

            // Set the parent and display the window
            SetMdiParent();
            ShowForm();

            // Handlers for internal events
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(OnFormClosing);
            timer1.Tick += new System.EventHandler(timer1_Tick);
            NextQuestionButton.Click += new System.EventHandler(NextQuestionButton_Click);
            PreviousQuestionButton.Click += new System.EventHandler(PreviousQuestionButton_Click);
            FinishTestButton.Click += new System.EventHandler(FinishTestButton_Click);
            ReturnToLogin.Click += new System.EventHandler(ReturnToLogin_Click);
            varA.Click += new System.EventHandler(varA_Click);
            varB.Click += new System.EventHandler(varB_Click);
            varC.Click += new System.EventHandler(varC_Click);
            varD.Click += new System.EventHandler(varD_Click);

            this.type = type;
            this.parentForm = parent;
        }