/// <summary> /// 带事务的Update /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2014/11/5 16:36:19</remarks> public bool Update(ConfigRevelationthebadgeawaryEntity entity, DbTransaction trans) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigRevelationthebadgeawary_Update"); database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx); database.AddInParameter(commandWrapper, "@PlayersId", DbType.Int32, entity.PlayersId); database.AddInParameter(commandWrapper, "@PersonalResume", DbType.String, entity.PersonalResume); database.AddInParameter(commandWrapper, "@TheBadgeID", DbType.Int32, entity.TheBadgeID); int results = 0; if (trans != null) { results = database.ExecuteNonQuery(commandWrapper, trans); } else { results = database.ExecuteNonQuery(commandWrapper); } return(Convert.ToBoolean(results)); }
/// <summary> /// 将IDataReader的当前记录读取到ConfigRevelationthebadgeawaryEntity 对象 /// </summary> /// <param name="reader"></param> /// <returns></returns> public ConfigRevelationthebadgeawaryEntity LoadSingleRow(IDataReader reader) { var obj = new ConfigRevelationthebadgeawaryEntity(); obj.Idx = (System.Int32)reader["Idx"]; obj.PlayersId = (System.Int32)reader["PlayersId"]; obj.PersonalResume = (System.String)reader["PersonalResume"]; obj.TheBadgeID = (System.Int32)reader["TheBadgeID"]; return(obj); }
/// <summary> /// GetById /// </summary> /// <param name="idx">idx</param> /// <returns>ConfigRevelationthebadgeawaryEntity</returns> /// <remarks>2014/11/5 16:36:19</remarks> public ConfigRevelationthebadgeawaryEntity GetById(System.Int32 idx) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("P_ConfigRevelationthebadgeawary_GetById"); database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, idx); ConfigRevelationthebadgeawaryEntity obj = null; using (IDataReader reader = database.ExecuteReader(commandWrapper)) { if (reader.Read()) { obj = LoadSingleRow(reader); } } return(obj); }
public static bool Update(ConfigRevelationthebadgeawaryEntity configRevelationthebadgeawaryEntity, DbTransaction trans = null, string zoneId = "") { var provider = new ConfigRevelationthebadgeawaryProvider(zoneId); return(provider.Update(configRevelationthebadgeawaryEntity, trans)); }
/// <summary> /// Update /// </summary> /// <param name="entity"></param> /// <returns></returns> /// <remarks>2014/11/5 16:36:19</remarks> public bool Update(ConfigRevelationthebadgeawaryEntity entity) { return(Update(entity, null)); }
/// <summary> /// Insert /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2014/11/5 16:36:19</remarks> public bool Insert(ConfigRevelationthebadgeawaryEntity entity) { return(Insert(entity, null)); }