private void EnterButton_Click(object sender, EventArgs e) { try { // what state are we in? switch (eInternalState) { case eStates.eConnected: DisableEverything(); // check for Account Number filled in and PIN complete _accountString = AccountInputBox.Text.Trim(); if (_accountString.Length == 0) { throw new Exception("This just ain't right - no Account"); } if (_pinString.Length != 4) { throw new Exception("This just ain't right - PIN Incomplete"); } // hide the PIN box PINBox.Visible = false; PINBox.SendToBack(); // create an account handler, with all the available info _accountHandler = new AccountHandler(m_Connection); // set the trace window _accountHandler.TraceTextBox = this.ScreenText; // try to logon the account _accountHandler.ValidateAccount(_accountString, _pinString); // get all of the accounts already _accountHandler.RetrieveAccounts(); // say that we now have the main menu SetMainMenu(); break; default: throw new Exception("This just ain't right, Default = " + eInternalState.ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); // as this is a failure to log in, set up the original state SetOpeningState(); } }
private void WorkWithCustomer_Click(object sender, EventArgs e) { try { // flip the buttons this.WorkWithCustomer.Enabled = false; this.ReconfigureButton.Enabled = false; this.FinishWithCustomer.Enabled = true; // create an account handler, with all the available info if (_use3270) { AccountHandler3270 accHandler3270 = new AccountHandler3270(m_Handler); _accountHandler = accHandler3270 as AccountHandler; accHandler3270.TraceBox = ScreenText; } else { _accountHandler = new AccountHandlerTI() as AccountHandler; } // go get the customers info _accountHandler.ValidateCustomer(this.InputCustomerBox.Text); // save the account name, add it to the appropriate boxes _accountName = this.InputCustomerBox.Text; // Add the tabs as appropriate: check for this being an existing customer if (_accountHandler.IsExistingCustomer) { // fill out the customer data CustomerDetailsFromHandler(); EnableCustomersTab(); EnableAccountsTab(); MoveToCustomersTab(); } else { EnableAccountsTab(); MoveToAccountsTab(); this.SSNBox.Text = ""; _SSNValid = false; this.StreetBox.Text = ""; _StreetValid = false; this.CityBox.Text = ""; _CityValid = false; this.StateBox.Text = ""; _StateValid = false; this.ZIPBox.Text = ""; _ZIPValid = false; this.PhoneBox.Text = ""; _PhoneValid = false; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }