Beispiel #1
0
 public override string ToString()
 {
     return("ID: " + CharacterRelationshipID.ToString() +
            "   CharacterID: " + CharacterID.ToString() +
            "   RelationCharacterID: " + RelationCharacterID.ToString() +
            "   RelationTypeID: " + RelationTypeID.ToString());
 }
        ///TODO JLB Fix cPicture Save to use cUtilities
        /// <summary>
        /// Save an picture record to the database. Use this if you have a connection open.
        /// </summary>
        /// <param name="sUserUpdating">Name of the user who is saving the record.</param>
        public void Save(string sUserUpdating)
        {
            MethodBase lmth          = MethodBase.GetCurrentMethod();
            string     lsRoutineName = lmth.DeclaringType + "." + lmth.Name;

            if (RecordStatus == RecordStatuses.Delete)
            {
                SortedList sParams = new SortedList();
                sParams.Add("@CharacterItemID", ItemPictureID.ToString());
                cUtilities.LoadDataTable("uspDelCHCharacterItem", sParams, "LARportal", "", lsRoutineName);
            }
            else
            {
                SortedList sParams = new SortedList();
                sParams.Add("@CharacterItemID", ItemPictureID.ToString());
                sParams.Add("@CharacterID", CharacterID.ToString());
                sParams.Add("@ItemDescription", ItemDescription);
                sParams.Add("@ItemPictureID", ItemPictureID.ToString());
                DataTable dtItem = new DataTable();
                dtItem = cUtilities.LoadDataTable("uspInsUpdCHCharacterItems", sParams, "LARportal", "", lsRoutineName);

                foreach (DataRow dRow in dtItem.Rows)
                {
                    int ItemID;
                    if (int.TryParse(dRow["CharacterItemID"].ToString(), out ItemID))
                    {
                        CharacterItemID = ItemID;
                    }
                }
            }
        }
Beispiel #3
0
        private void btn_Search_Click(object sender, EventArgs e)
        {
            int CharacterID;

            try
            {
                CharacterID = int.Parse(txt_CharacterID.Text);
                if (CharacterID > 0 && CharacterID < 2139)
                {
                    FindCharacter(CharacterID.ToString());
                }
                else
                {
                    MessageBox.Show("The Character ID entered is not valid, please try again!");
                }
            }

            catch (FormatException)
            {
                MessageBox.Show("The Character ID entered is not valid, please try again!");
            }
        }
Beispiel #4
0
 public override string ToString()
 {
     return(CharacterID.ToString() + ": " + ClassID.ToString() + " // lv" + Level.ToString() + " exp" + Experience.ToString());
 }
Beispiel #5
0
        public CharacterEquipment SaveCharacterEquipment()
        {
            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_CharacterEquipment";
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterEquipmentID", SqlDbType.Int, CharacterEquipmentID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterID", SqlDbType.Int, CharacterID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@EquipmentID", SqlDbType.Int, EquipmentID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Notes", SqlDbType.VarChar, Notes, 100));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Quantity", SqlDbType.Int, Quantity.ToString(), 0));

                //    command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterLevelArmor", SqlDbType.Int, CharacterLevelArmor.ToString(), 0));
                //    command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityMod", SqlDbType.Int, AbilityMod.ToString(), 0));
                //    command.Parameters.Add(dbconn.GenerateParameterObj("@ClassMod", SqlDbType.Int, ClassMod.ToString(), 0));
                //    command.Parameters.Add(dbconn.GenerateParameterObj("@RaceMod", SqlDbType.Int, RaceMod.ToString(), 0));
                //    command.Parameters.Add(dbconn.GenerateParameterObj("@FeatTalentMod", SqlDbType.Int, FeatTalentMod.ToString(), 0));
                //    command.Parameters.Add(dbconn.GenerateParameterObj("@MiscellaneousMod", SqlDbType.Int, MiscellaneousMod.ToString(), 0));

                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message.ToString());
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }
        /// <summary>
        /// Saves the character class level.
        /// </summary>
        /// <returns>CharacterWeapon Object</returns>
        public CharacterWeapon SaveCharacterWeapon()
        {
            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_CharacterWeapon";
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterWeaponID", SqlDbType.Int, CharacterWeaponID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterID", SqlDbType.Int, CharacterID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponID", SqlDbType.Int, WeaponID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@RangeAttackBonus", SqlDbType.Int, RangeAttackBonus.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@RangeDamageBonus", SqlDbType.Int, RangeDamageBonus.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@MeleeAttackBonus", SqlDbType.Int, MeleeAttackBonus.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@MeleeDamageBonus", SqlDbType.Int, MeleeDamageBonus.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Notes", SqlDbType.VarChar, Notes.ToString(), 100));
                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);
        }
        /// <summary>
        /// Delete the CharacterWeapon.
        /// </summary>
        /// <returns>Boolean</returns>
        public bool DeleteCharacterWeapon()
        {
            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 = "Delete_CharacterWeapon";
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterID", SqlDbType.Int, CharacterID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@WeaponID", SqlDbType.Int, WeaponID.ToString(), 0));
                result = command.ExecuteReader();
            }
            catch
            {
                Exception e = new Exception();
                this._deleteOK = false;
                this._deletionMessage.Append(e.Message + "                     Inner Exception= " + e.InnerException);
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this.DeleteOK);
        }
Beispiel #8
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);
        }
Beispiel #9
0
 public void LoadTexture(CharacterID characterID)
 {
     textures[characterID.ToString()] = contentManager.Load <Texture2D>(characterID.ToString());
 }
Beispiel #10
0
 // 画像のサイズを持ってくる
 public Vector2 GetHalfSize(CharacterID characterID)
 {
     return(new Vector2(textures[characterID.ToString()].Width / 2, textures[characterID.ToString()].Height));
 }
Beispiel #11
0
 public void DrawTexture(CharacterID name, Vector2 position, Color color)
 {
     spriteBatch.Draw(textures[name.ToString()], position, color);
 }
Beispiel #12
0
        public CharacterAbility SaveCharacterAbility()
        {
            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_CharacterAbility";
                command.Parameters.Add(dbconn.GenerateParameterObj("@CharacterID", SqlDbType.Int, CharacterID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@AbilityID", SqlDbType.Int, AbilityID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Score", SqlDbType.Int, Score.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ScoreMod", SqlDbType.Int, ScoreMod.ToString(), 0));
                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message.ToString());
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }