//Get Users phone number from txtbox, verify that it is indeed a proper phone number public string grabPhoneNumber() { try { string input = loginWindow_textBox_EnterPhone.Text; input = JeffToolBox.RemoveSpecialCharacters(input); input = JeffToolBox.RemoveLetters(input); if (input.Length > 10 || input.Length < 10) { MessageBox.Show("You number had: " + input.Length + "digits. You did not enter the correct number of digits (10) for an American Phone Number. Please try again."); return(null); } input = "+1" + input; return(input); } catch (Exception) { MessageBox.Show("You have entered in an invalid number, please retry. \n Enter in phonenumber in this format: 1234567890"); return(null); } }
//Ensures Authorization Code only contains Numbers, then tests Auth Code to see if it matches correct code public bool TestAuthCode() { string UsersEnteredCodeString = getCodeInput(); string input = JeffToolBox.RemoveLetters(UsersEnteredCodeString); input = JeffToolBox.RemoveSpecialCharacters(input); //MEssed up /// if (JeffToolBox.hasLetters(input)) // { // loginWindow_textBox_VerificationCode.Text = ""; // return false; // } //Logic to see if code is correct and matches saved code decimal UsersEnteredCode = Decimal.Parse(input); if (UsersEnteredCode == RandomGeneratedNumber) { return(true); } else { return(false); } }
//Get Code Input from user public string getCodeInput() { string input = loginWindow_textBox_VerificationCode.Text; input = JeffToolBox.RemoveSpecialCharacters(input); input = JeffToolBox.RemoveLetters(input); return(input); }