public RaceSpecialAbility GetRaceSpecialAbility(string RaceSpecialAbilityName) { return(GetSingleRaceSpecialAbility("Select_RaceSpecialAbility", " RaceSpecialAbilityName='" + RaceSpecialAbilityID.ToString() + "'", "")); }
public RaceSpecialAbility SaveRaceSpecialAbility() { 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_RaceSpecialAbility"; command.Parameters.Add(dbconn.GenerateParameterObj("@RaceSpecialAbilityID", SqlDbType.Int, RaceSpecialAbilityID.ToString(), 0)); command.Parameters.Add(dbconn.GenerateParameterObj("@RaceSpecialAbilityName", SqlDbType.VarChar, RaceSpecialAbilityName, 100)); command.Parameters.Add(dbconn.GenerateParameterObj("@RaceSpecialAbilityDescription", SqlDbType.VarChar, RaceSpecialAbilityDescription, 1000)); 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> /// Delete the RaceSpecialAbility. /// </summary> /// <returns>Boolean</returns> public bool DeleteRaceSpecialAbility() { 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_RaceSpecialAbility"; command.Parameters.Add(dbconn.GenerateParameterObj("@RaceSpecialAbilityID", SqlDbType.Int, RaceSpecialAbilityID.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); }