/// <summary> /// Occurs when the user leaves the Adress field. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerAdressBox_Leave(object sender, EventArgs e) { bool verify = RegisterVerification.AdressVerification(registerAdressBox.Text); ChangeBackColorTextBox(registerAdressBox, verify); _isAdressOk = verify; }
/// <summary> /// Occurs when the user leaves the Phone field. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerPhoneBox_Leave(object sender, EventArgs e) { bool verify = RegisterVerification.PhoneVerifacation(registerPhoneBox.Text); ChangeBackColorTextBox(registerPhoneBox, verify); _isPhoneOk = verify; }
/// <summary> /// Checks if edit password is ok text changed /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void editPasswordBox_TextChanged(object sender, EventArgs e) { passwordOk = RegisterVerification.PasswordVertification(editPasswordBox.Text); if (editPasswordBox.Text != editPasswordBox.defaultText) { editPasswordBox.PasswordChar = '*'; } else { editPasswordBox.PasswordChar = '\0'; } if (passwordOk) { ChangeBackColorTextBox(editPasswordBox, true); } else { ChangeBackColorTextBox(editPasswordBox, false); } if (verifyEditPasswordBox.Text == editPasswordBox.Text) { ChangeBackColorTextBox(verifyEditPasswordBox, true); verifyPasswordOk = true; } else { ChangeBackColorTextBox(verifyEditPasswordBox, false); verifyPasswordOk = false; } if (editPasswordBox.Text == usernameBox.Text) { passwordStatusLabel.Text = "Password can not be the same as your username"; passwordStatusLabel.ForeColor = _wrongColor; } else { int strength = RegisterVerification.PasswordStrength(editPasswordBox.Text); if (strength == 0) { passwordStatusLabel.Text = ""; } else if (strength < 12) { ChangeLabelTextAndColor(passwordStatusLabel, "Weak", _wrongColor); } else if (strength < 22) { ChangeLabelTextAndColor(passwordStatusLabel, "Medium", Color.FromArgb(229, 200, 3)); } else { ChangeLabelTextAndColor(passwordStatusLabel, "Strong", _correctColor); } } }
/// <summary> /// Occurs when the user leaves the Firstname field. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerFirstnameBox_Leave(object sender, EventArgs e) { bool verify = RegisterVerification.InputOnlyLettersVerification(registerFirstnameBox.Text); ChangeBackColorTextBox(registerFirstnameBox, verify); _isFirstnameOk = verify; }
/// <summary> /// Occurs when the user leaves the Email field. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerEmailBox_Leave(object sender, EventArgs e) { //Check if email is unique in SQL - Error message: Email taken! bool verify = RegisterVerification.EmailVerification(registerEmailBox.Text); ChangeBackColorTextBox(registerEmailBox, verify); _isEmailOk = verify; }
/// <summary> /// Verification function for the Register CPR input /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The Event args</param> private void registerCprBox_Leave(object sender, EventArgs e) { //Check if CPR is already in SQL - Error message: CPR already exists! bool verify = RegisterVerification.CPRVerification(registerCprBox.Text); ChangeBackColorTextBox(registerCprBox, verify); _isCprOk = verify; }
/// <summary> /// Occurs when the user leaves the Username field. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerUsernameBox_Leave(object sender, EventArgs e) { //Check if username is unique in SQL - Error message: Username taken! bool verify = RegisterVerification.UsernameVerifacation(registerUsernameBox.Text); ChangeBackColorTextBox(registerUsernameBox, verify); _isUsernameOk = verify; }
/// <summary> /// Occurs when the user leaves the Zipcode field. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerZipBox_Leave(object sender, EventArgs e) { bool verify = RegisterVerification.ZipVerifacation(registerZipBox.Text); ChangeBackColorTextBox(registerZipBox, verify); _isZipOk = verify; if (verify) { registerCityBox.Text = JSONReader.GetCity(int.Parse(registerZipBox.Text)); } }
/// <summary> /// Checks if phone number is ok on leave /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void phoneBox_Leave(object sender, EventArgs e) { if (phoneBox.Text == _user.Phone) { phoneOk = true; } else { phoneOk = RegisterVerification.PhoneVerifacation(phoneBox.Text); } DefaultTextBox_Leave(phoneBox, phoneOk); }
/// <summary> /// Checks if username is ok on leave. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void usernameBox_Leave(object sender, EventArgs e) { if (usernameBox.Text == _user.Username) { usernameOk = true; } else { usernameOk = RegisterVerification.UsernameVerifacation(usernameBox.Text); } DefaultTextBox_Leave(usernameBox, usernameOk); }
/// <summary> /// Checks if email is ok on leave /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void emailBox_Leave(object sender, EventArgs e) { if (emailBox.Text == _user.Email) { emailOk = true; } else { emailOk = RegisterVerification.EmailVerification(emailBox.Text); } DefaultTextBox_Leave(emailBox, emailOk); }
public void SendRegistrationVerificationToken(long userid, string verficationToken) { RegisterVerification registerVerification = new RegisterVerification() { RegisterVerificationId = 0, GeneratedDate = DateTime.Now, GeneratedToken = verficationToken, UserId = userid, Status = true, VerificationStatus = false }; _frapperDbContext.RegisterVerification.Add(registerVerification); }
/// <summary> /// Here we can Send VerificationToken to User In Email or OTP On Mobile /// </summary> public void SendRegistrationVerificationToken(long?userid, string verficationToken) { RegisterVerification registerVerification = new RegisterVerification() { RegisterVerificationId = 0, GeneratedDate = DateTime.Now, GeneratedToken = verficationToken, UserId = userid, Status = true, VerificationStatus = false }; _databaseContext.RegisterVerification.Add(registerVerification); _databaseContext.SaveChanges(); }
/// <summary> /// Occurs when the text in the Password field is changed. /// Checks strength and validity of the password. /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void registerPasswordBox_TextChanged(object sender, EventArgs e) { if (registerPasswordBox.Text != registerPasswordBox.defaultText) { registerPasswordBox.PasswordChar = '*'; } else { registerPasswordBox.PasswordChar = '\0'; } bool usernameNotSameAsPassword = registerPasswordBox.Text != registerUsernameBox.Text; bool verify = RegisterVerification.PasswordVertification(registerPasswordBox.Text) && usernameNotSameAsPassword; ChangeBackColorTextBox(registerPasswordBox, verify); _isPasswordOk = verify; VerifyPassword(); if (!usernameNotSameAsPassword) { passwordStatusLabel.Text = "Password can not be the same as your username"; passwordStatusLabel.ForeColor = ColorScheme.MainWarningColor; } else { int strength = RegisterVerification.PasswordStrength(registerPasswordBox.Text); if (strength == 0) { passwordStatusLabel.Text = ""; } else if (strength < 12) { ChangeLabelTextAndColor(passwordStatusLabel, "Weak", ColorScheme.MainWarningColor); } else if (strength < 22) { ChangeLabelTextAndColor(passwordStatusLabel, "Medium", Color.FromArgb(229, 200, 3)); } else { ChangeLabelTextAndColor(passwordStatusLabel, "Strong", ColorScheme.MainThemeColorLight); } } }
public bool EmailVerification_CheckInput(string email) { return(RegisterVerification.EmailVerification(email)); }
public bool AdressVerification_CheckInput(string adress) { return(RegisterVerification.AdressVerification(adress)); }
public bool PasswordVerification_CheckInput(string password) { return(RegisterVerification.PasswordVertification(password)); }
public bool CityVerification_CheckInput(string city) { return(RegisterVerification.CityVerification(city)); }
public bool InputOnlyLettersVerification_CheckInput(string input) { return(RegisterVerification.InputOnlyLettersVerification(input)); }
/// <summary> /// Checks if adress is ok on leave /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void addressBox_Leave(object sender, EventArgs e) { addressOk = RegisterVerification.AdressVerification(addressBox.Text); DefaultTextBox_Leave(addressBox, addressOk); }
public void UpdateRegisterVerification(RegisterVerification registerVerification) { registerVerification.VerificationStatus = true; registerVerification.VerificationDate = DateTime.Now; _frapperDbContext.RegisterVerification.Update(registerVerification); }
/// <summary> /// Checks if lastname is ok on leave /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void lastnameBox_Leave(object sender, EventArgs e) { lastnameOk = RegisterVerification.InputOnlyLettersVerification(lastnameBox.Text); DefaultTextBox_Leave(lastnameBox, lastnameOk); }
public bool PhoneVerification_CheckInput(string phoneNo) { return(RegisterVerification.PhoneVerifacation(phoneNo)); }
public bool UsernameVerification_CheckInput(string username) { return(RegisterVerification.UsernameVerifacation(username)); }
public bool CPRVerification_CheckInput(string cpr) { return(RegisterVerification.CPRVerification(cpr)); }
/// <summary> /// Checks if zip is ok on leave /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void zipBox_Leave(object sender, EventArgs e) { zipOk = RegisterVerification.ZipVerifacation(zipBox.Text); DefaultTextBox_Leave(zipBox, zipOk); }
/// <summary> /// Checks if city is ok on leave /// </summary> /// <param name="sender">The object sender</param> /// <param name="e">The event args</param> private void cityBox_Leave(object sender, EventArgs e) { cityOk = RegisterVerification.CityVerification(cityBox.Text); DefaultTextBox_Leave(cityBox, cityOk); }
public bool ZipVerification_CheckInput(string zip) { return(RegisterVerification.ZipVerifacation(zip)); }