Пример #1
0
        /// <summary>
        /// Saves the character class level.
        /// </summary>
        /// <returns>CharacterSkill Object</returns>
        public CharacterSkill SaveCharacterSkill()
        {
            SqlDataReader      result;
            DatabaseConnection dbconn     = new DatabaseConnection();
            SqlCommand         command    = new SqlCommand();
            SqlConnection      connection = new SqlConnection(dbconn.SQLSEVERConnString);

            try
            {
                connection.Open();
                command.Connection  = connection;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = "InsertUpdate_CharacterSkill";
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterID", SqlDbType.Int, CharacterID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SkillID", SqlDbType.Int, SkillID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@HalfLevel", SqlDbType.Int, HalfLevel.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityMod", SqlDbType.Int, AbilityMod.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Trained", SqlDbType.Int, Trained.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SkillFocus", SqlDbType.Int, SkillFocus.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Miscellaneous", SqlDbType.Int, Miscellaneous.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@FeatTalentMod", SqlDbType.Int, FeatTalentMod.ToString(), 0));
                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message + "                     Inner Exception= " + e.InnerException);
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }
Пример #2
0
        public override string ToString()
        {
            string temp = Name + " +" + Mod.ToString() + " = +" + Rank.ToString() + " ranks, +" + AbilityMod.ToString() + PathfinderConstants.SPACE + Ability;

            if (ClassSkill > 0)
            {
                temp += ", +" + ClassSkill.ToString() + " class skill";
                if (ExtraSkillUsed)
                {
                    temp += "*";
                }
            }
            if (ExtraMod != 0)
            {
                //  temp += ", +" + ExtraMod.ToString() + " extra mods";
            }
            if (ArmorCheckPenalty != 0)
            {
                temp += ", +" + ArmorCheckPenalty.ToString() + " Armor Check Penalty";
            }

            if (Formula.Length > 0)
            {
                temp += PathfinderConstants.SPACE + Formula;
            }

            temp = temp.Replace("+-", "-");

            return(temp);
        }