private void CreatePassword(IS2G10_DBSSSDataSet.USERPROFILERow userProfile)
        {
            _password = null;

            var createPasswordWindow = new CreatePassword();
            if (createPasswordWindow.ShowDialog() == true)
            {
                _password = createPasswordWindow.Password; //values preserved after close
            }

            if (_password != null && !_password.Equals(""))
            {
                string hash;
                string salt;
                _passwordBuilder.CreateHash(_password, out hash, out salt);
                userProfile.resetPassword = false;
                userProfile.password_hash = hash;
                userProfile.password_salt = salt;
                _userProfileTableAdapter.Update(userProfile);

                _dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.Login_CheckPassword_Password_Created_Successfully);
            }

            if (_password != null && _password.Equals("") || _password == null)
            {
                _dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.Login_CheckPassword_Please_Enter_a_Password_);
            }
        }
 private bool CheckPassword(IS2G10_DBSSSDataSet.USERPROFILERow userProfile, string sPass)
 {
     var check = _passwordBuilder.CheckPassword(sPass, userProfile.password_hash, userProfile.password_salt);
     //check if password is right
     if (!check)
     {
         _dialogService.CallMessageModal(this, "", SSS_Library.Properties.Resources.IncorrectLoginDetailsMessage);
         PasswordTextBox.Clear();
         UsernameTextBox.Clear();
         UsernameTextBox.Focus();
     }
     return check;
 }
        private void DisplayConsultationInformation(IS2G10_DBSSSDataSet.CONSULTATION_FULL_DATARow consultation)
        {
            string rating;
            if (consultation.consultation_rating == -1)
                rating = "Not Yet Rated";
            else
                rating = ""+ consultation.consultation_rating;

            var message = string.Format("Id: {0}\n"+
                "Date: {1}\n" +
                "Details: {2}\n" +
                "Rating: {3}\n" +
                "Student Id: {4}\n" +
                "Student Name: {5} {6}\n" +
                "Tutor Id: {7}\n" +
                "Tutor Name: {8} {9}",
                consultation.consultation_id, consultation.consultation_date, consultation.consultation_details,
                rating, consultation.student_id, consultation.student_firstname, consultation.student_lastname,
                consultation.tutor_id, consultation.tutor_firstname, consultation.tutor_lastname);
            MessageBox.Show(message);
        }