/// <summary> /// 带事务的Update /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2016/6/10 15:36:00</remarks> public bool Update(ConfigEuropeprizeEntity entity, DbTransaction trans) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigEuropeprize_Update"); database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx); database.AddInParameter(commandWrapper, "@Step", DbType.Int32, entity.Step); database.AddInParameter(commandWrapper, "@WinNumber", DbType.Int32, entity.WinNumber); database.AddInParameter(commandWrapper, "@PrizeType", DbType.Int32, entity.PrizeType); database.AddInParameter(commandWrapper, "@PrizeCode", DbType.Int32, entity.PrizeCode); database.AddInParameter(commandWrapper, "@PrizeCount", DbType.Int32, entity.PrizeCount); int results = 0; if (trans != null) { results = database.ExecuteNonQuery(commandWrapper, trans); } else { results = database.ExecuteNonQuery(commandWrapper); } return(Convert.ToBoolean(results)); }
/// <summary> /// 将IDataReader的当前记录读取到ConfigEuropeprizeEntity 对象 /// </summary> /// <param name="reader"></param> /// <returns></returns> public ConfigEuropeprizeEntity LoadSingleRow(IDataReader reader) { var obj = new ConfigEuropeprizeEntity(); obj.Idx = (System.Int32)reader["Idx"]; obj.Step = (System.Int32)reader["Step"]; obj.WinNumber = (System.Int32)reader["WinNumber"]; obj.PrizeType = (System.Int32)reader["PrizeType"]; obj.PrizeCode = (System.Int32)reader["PrizeCode"]; obj.PrizeCount = (System.Int32)reader["PrizeCount"]; return(obj); }
/// <summary> /// GetById /// </summary> /// <param name="idx">idx</param> /// <returns>ConfigEuropeprizeEntity</returns> /// <remarks>2016/6/10 15:36:00</remarks> public ConfigEuropeprizeEntity GetById(System.Int32 idx) { var database = new SqlDatabase(this.ConnectionString); DbCommand commandWrapper = database.GetStoredProcCommand("P_ConfigEuropeprize_GetById"); database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, idx); ConfigEuropeprizeEntity obj = null; using (IDataReader reader = database.ExecuteReader(commandWrapper)) { if (reader.Read()) { obj = LoadSingleRow(reader); } } return(obj); }
public static bool Update(ConfigEuropeprizeEntity configEuropeprizeEntity, DbTransaction trans = null, string zoneId = "") { var provider = new ConfigEuropeprizeProvider(zoneId); return(provider.Update(configEuropeprizeEntity, trans)); }
/// <summary> /// Update /// </summary> /// <param name="entity"></param> /// <returns></returns> /// <remarks>2016/6/10 15:36:00</remarks> public bool Update(ConfigEuropeprizeEntity entity) { return(Update(entity, null)); }
/// <summary> /// Insert /// </summary> /// <param name="entity"></param> /// <param name="trans">The trans.</param> /// <returns></returns> /// <remarks>2016/6/10 15:36:00</remarks> public bool Insert(ConfigEuropeprizeEntity entity) { return(Insert(entity, null)); }