public bool ChangeUserSettings(UserData.UserSkill skill, UserData.TypeOfUser type, string email)
        {
            try {
                if (SystemSettings.IsInternetAvailable() == true && this.Connection.ConnectionString != "" && this.Connection.ConnectionString != null)
                {
                    SqlCommand changeUserSettings = new SqlCommand("ChangeUserSettings", this.Connection)
                    {
                        CommandType = CommandType.StoredProcedure
                    };

                    //this.Connection.Open();
                    changeUserSettings.Parameters.AddWithValue("@UserSkill", skill);
                    changeUserSettings.Parameters.AddWithValue("@TypeOfUser", type);
                    changeUserSettings.Parameters.AddWithValue("@Email", email);

                    changeUserSettings.ExecuteNonQuery();
                    this.Connection.Close();
                    MessageBox.Show("Account Settings Changed");

                    return(true);
                }
                else
                {
                    return(false);
                }
            } catch {
                MessageBox.Show("Error changing settings", "Error!", MessageBoxButton.OK, MessageBoxImage.Warning);
                this.Connection.Close();
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// Generates a descripton for the generated score.
        /// </summary>
        /// <returns></returns>

        protected override string GenerateScoreDescription(UserData.TypeOfUser typeOfUser, byte score)
        {
            switch (typeOfUser)
            {
            case UserData.TypeOfUser.Casual:
            {
                return(GetCasualScoreDesc(score));
            }

            case UserData.TypeOfUser.Websurfer:
            {
                return(GetWebScoreDesc(score));
            }

            case UserData.TypeOfUser.HighPerformance:
            {
                return(GetHighPerfScoreDesc(score));
            }

            case UserData.TypeOfUser.Video:
            {
                return(GetVideoDescription(score));
            }

            default:
            {
                return("Error generating the description.");
            }
            }
        }
Пример #3
0
        /// <summary>
        /// Returns a particular score description thats contingent upon
        /// the <see cref="UserData.TypeOfUser"/>.
        /// </summary>
        /// <param name="typeOfUser">The <see cref="UserData.TypeOfUser"/>.</param>
        /// <param name="score">The score of the test.</param>
        /// <returns></returns>

        protected abstract string GenerateScoreDescription(UserData.TypeOfUser typeOfUser, byte score);
Пример #4
0
 protected override string GenerateScoreDescription(UserData.TypeOfUser typeOfUser, byte score)
 {
     throw new NotImplementedException();
 }