コード例 #1
0
        /// <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;
        }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        /// <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);
                }
            }
        }
コード例 #4
0
        /// <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;
        }
コード例 #5
0
        /// <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;
        }
コード例 #6
0
        /// <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;
        }
コード例 #7
0
        /// <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;
        }
コード例 #8
0
        /// <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));
            }
        }
コード例 #9
0
        /// <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);
        }
コード例 #10
0
        /// <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);
        }
コード例 #11
0
        /// <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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
        /// <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();
        }
コード例 #14
0
        /// <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);
                }
            }
        }
コード例 #15
0
 public bool EmailVerification_CheckInput(string email)
 {
     return(RegisterVerification.EmailVerification(email));
 }
コード例 #16
0
 public bool AdressVerification_CheckInput(string adress)
 {
     return(RegisterVerification.AdressVerification(adress));
 }
コード例 #17
0
 public bool PasswordVerification_CheckInput(string password)
 {
     return(RegisterVerification.PasswordVertification(password));
 }
コード例 #18
0
 public bool CityVerification_CheckInput(string city)
 {
     return(RegisterVerification.CityVerification(city));
 }
コード例 #19
0
 public bool InputOnlyLettersVerification_CheckInput(string input)
 {
     return(RegisterVerification.InputOnlyLettersVerification(input));
 }
コード例 #20
0
 /// <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);
 }
コード例 #21
0
 public void UpdateRegisterVerification(RegisterVerification registerVerification)
 {
     registerVerification.VerificationStatus = true;
     registerVerification.VerificationDate   = DateTime.Now;
     _frapperDbContext.RegisterVerification.Update(registerVerification);
 }
コード例 #22
0
 /// <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);
 }
コード例 #23
0
 public bool PhoneVerification_CheckInput(string phoneNo)
 {
     return(RegisterVerification.PhoneVerifacation(phoneNo));
 }
コード例 #24
0
 public bool UsernameVerification_CheckInput(string username)
 {
     return(RegisterVerification.UsernameVerifacation(username));
 }
コード例 #25
0
 public bool CPRVerification_CheckInput(string cpr)
 {
     return(RegisterVerification.CPRVerification(cpr));
 }
コード例 #26
0
 /// <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);
 }
コード例 #27
0
        /// <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);
        }
コード例 #28
0
 public bool ZipVerification_CheckInput(string zip)
 {
     return(RegisterVerification.ZipVerifacation(zip));
 }