예제 #1
0
        /// <summary>
        /// Delete the ClassLevelInfo.
        /// </summary>
        /// <returns>Boolean</returns>
        public bool DeleteClassLevelInfo()
        {
            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_ClassLevel";
                command.Parameters.Add(dbconn.GenerateParameterObj("@ClassLevelID", SqlDbType.Int, ClassLevelID.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);
        }
예제 #2
0
        /// <summary>
        /// Saves the ClassLevelInfo.
        /// </summary>
        /// <returns>ClassLevelInfo Object</returns>
        public ClassLevelInfo SaveClassLevelInfo()
        {
            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_ClassLevel";

                command.Parameters.Add(dbconn.GenerateParameterObj("@ClassLevelID", SqlDbType.Int, ClassLevelID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ClassID", SqlDbType.Int, ClassID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ClassLevel", SqlDbType.Int, ClassLevel.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@BonusFeat", SqlDbType.Int, BonusFeat.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Talent", SqlDbType.Int, Talent.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@BaseAttack", SqlDbType.Int, BaseAttack.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ForcePointBase", SqlDbType.Int, ForcePointBase.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ForceTechnique", SqlDbType.Int, ForceTechnique.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ForceSecret", SqlDbType.Int, ForceSecret.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@MedicalSecret", SqlDbType.Int, MedicalSecret.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);
        }