Exemple #1
0
        private void CompleteHostRegistration(User user)
        {
            Host   host = GetHost(user);
            Window hostRegistrationWindow = new HostRegistrationWindow(host);

            hostRegistrationWindow.Show();
            this.Close();
        }
        public BankBranchWindow(Window window)
        {
            InitializeComponent();

            comboBoxBanks.ItemsSource = null;
            this.window = window as HostRegistrationWindow;

            bg.DoWork               += Bg_DoWork;
            bg.RunWorkerCompleted   += Bg_RunWorkerCompleted;
            bg.ProgressChanged      += Bg_ProgressChanged;
            bg.WorkerReportsProgress = true;
        }
Exemple #3
0
        private void CompleteHostRegistration()
        {
            Host host = GetHost(newUser);

            host.BankBranchDetails = new BankBranch()
            {
                BankName = "", BankNumber = 0, BranchAddress = "", BranchCity = "", BranchNumber = 0
            };
            try
            {
                bl.AddHost(host);
                Window hostRegistrationWindow = new HostRegistrationWindow(host);
                hostRegistrationWindow.Show();
                Close();
            }
            catch (BlArgumentNullException)
            {
                MessageBox.Show("There was a problem. Please try again later.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlMailAlreadyExistException)
            {
                MessageBox.Show("Mail address already exist in the system. Please try another address.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlNickAlreadyExistException)
            {
                MessageBox.Show("Nickname already exist in the system. Please try another nickname.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlUsernameInvalidException)
            {
                MessageBox.Show("Username invalid.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlPasswordInvalidException)
            {
                MessageBox.Show("Password invalid.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlInvalidEmailException)
            {
                MessageBox.Show("Mail address invalid.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            catch (BlFileErrorException)
            {
                MessageBox.Show("There was file error. Please try again later.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }