/// <summary> /// 将IDataReader的当前记录读取到ConfigRevelationsynthesizeionEntity 对象 /// </summary> /// <param name="reader"></param> /// <returns></returns> public ConfigRevelationsynthesizeionEntity LoadSingleRow(IDataReader reader) { var obj = new ConfigRevelationsynthesizeionEntity(); obj.Idx = (System.Int32)reader["Idx"]; obj.Value = (System.Int32)reader["Value"]; return(obj); }
/// <summary> /// GetById /// </summary> /// <param name="idx">idx</param> /// <returns>ConfigRevelationsynthesizeionEntity</returns> /// <remarks>2014/10/13 13:59:13</remarks> public ConfigRevelationsynthesizeionEntity GetById(System.Int32 idx) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("P_ConfigRevelationsynthesizeion_GetById"); database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, idx); ConfigRevelationsynthesizeionEntity obj = null; using (IDataReader reader = database.ExecuteReader(commandWrapper)) { if (reader.Read()) { obj = LoadSingleRow(reader); } } return(obj); }
/// <summary> /// 带事务的Update /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2014/10/13 13:59:13</remarks> public bool Update(ConfigRevelationsynthesizeionEntity entity, DbTransaction trans) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigRevelationsynthesizeion_Update"); database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx); database.AddInParameter(commandWrapper, "@Value", DbType.Int32, entity.Value); int results = 0; if (trans != null) { results = database.ExecuteNonQuery(commandWrapper, trans); } else { results = database.ExecuteNonQuery(commandWrapper); } return(Convert.ToBoolean(results)); }
public static bool Update(ConfigRevelationsynthesizeionEntity configRevelationsynthesizeionEntity, DbTransaction trans = null, string zoneId = "") { var provider = new ConfigRevelationsynthesizeionProvider(zoneId); return(provider.Update(configRevelationsynthesizeionEntity, trans)); }
/// <summary> /// Update /// </summary> /// <param name="entity"></param> /// <returns></returns> /// <remarks>2014/10/13 13:59:13</remarks> public bool Update(ConfigRevelationsynthesizeionEntity entity) { return(Update(entity, null)); }
/// <summary> /// Insert /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2014/10/13 13:59:13</remarks> public bool Insert(ConfigRevelationsynthesizeionEntity entity) { return(Insert(entity, null)); }