public CreateConsultationModal(int userId, SSS_Library.IS2G10_DBSSSDataSet.STUDENTRow studentData)
        {
            InitializeComponent();
            this.TopLevel = false;
            this.AutoScroll = true;
            this.Hide();

            _userId = userId;
            _studentData = studentData;
            _tutorDataTable = this.tutorTableAdapter1.GetData();

            PopulateData();

            dateComboBox.Enabled = false;
            timeComboBox.Enabled = false;
            BookButton.Enabled = false;
        }
        private void CreatePassword(SSS_Library.IS2G10_DBSSSDataSet.USERPROFILERow userProfile)
        {
            _password = null;
            using (var form = new CreatePassword())
            {
                var result = form.ShowDialog();
                if (result == DialogResult.OK)
                {
                    _password = form.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;
                userprofileTableAdapter1.Update(userProfile);

                MessageBox.Show(Resources.Login_CheckPassword_Password_Created_Successfully,
                    Resources.Login_CheckPassword_Password_Created_Successfully);
                medPassword.Clear();
                medUsername.Clear();
                medUsername.Focus();
            }

            if (_password != null && _password.Equals(""))
            {
                MessageBox.Show(Resources.Login_CheckPassword_Please_Enter_a_Password_,
                    Resources.Login_CheckPassword_Please_Enter_a_Password_);
            }

            if (_password == null)
            {
                MessageBox.Show(Resources.Login_CheckPassword_Please_Enter_a_Password_,
                    Resources.Login_CheckPassword_Please_Enter_a_Password_);
            }
        }
 private bool CheckPassword(SSS_Library.IS2G10_DBSSSDataSet.USERPROFILERow userProfile, string sPass)
 {
     var check = _passwordBuilder.CheckPassword(sPass, userProfile.password_hash, userProfile.password_salt);
     //check if password is right
     if (!check)
     {
         MessageBox.Show(Resources.IncorrectLoginDetailsMessage, Resources.IncorrectLoginDetailsMessage);
         medPassword.Clear();
         medUsername.Clear();
         medUsername.Focus();
     }
     return check;
 }
 private void DisplayStudentInformation(SSS_Library.IS2G10_DBSSSDataSet.SEARCH_TUTORRow tutor)
 {
     string trainingstatus;
     if (tutor.tutor_trainingstatus)
         trainingstatus = "Yes";
     else
         trainingstatus = "No";
     var message = String.Format("Student Name: {0} {1}\n" +
                                                          "Tutor Id: {2}\n" +
                                                          "Tutor's ID or Passport: {3}\n" +
                                                          "Date Of Birth: {4}\n" +
                                                          "Email: {5}\n" +
                                                          "Mobile Number: {6}\n" +
                                                          "Training Status: {7}",
                                                          tutor.tutor_firstname,
                                                          tutor.tutor_lastname,
                                                          tutor.tutor_id,
                                                          tutor.tutor_id_passport,
                                                          tutor.tutor_dateofbirth.Date.ToShortDateString(),
                                                          tutor.tutor_emailaddress,
                                                          tutor.tutor_cellnumber,
                                                          trainingstatus);
     MessageBox.Show(message, Resources.SearchTutorInformationHeading);
 }
 private void DisplayStudentInformation(SSS_Library.IS2G10_DBSSSDataSet.SEARCH_STUDENTRow student)
 {
     var message = String.Format("Student Name: {0} {1}\n" +
                                                          "Student Id: {2}\n" +
                                                          "Student's ID or Passport: {3}\n" +
                                                          "Date Of Birth: {4}\n" +
                                                          "Email: {5}\n" +
                                                          "Mobile Number: {6}\n" +
                                                          "Year Of Study: {7}\n" +
                                                          "Degree Programme: {8}\n" +
                                                          "Student Status: {9}\n" +
                                                          "Student Points: {10}",
                                                          student.student_firstname,
                                                          student.student_lastname,
                                                          student.student_id,
                                                          student.student_id_passport,
                                                          student.student_dateofbirth.Date.ToShortDateString(),
                                                          student.student_emailaddress,
                                                          student.student_mobilenumber,
                                                          student.student_yearofstudy,
                                                          student.student_degreeprogramme,
                                                          student.student_status,
                                                          student.student_points);
     MessageBox.Show(message, Resources.SearchStudentMessageBoxHeading);
 }