/// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2016/9/13 16:03:17</remarks>
        public bool Update(ConfigPenaltykickprizeEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigPenaltykickprize_Update");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx);
            database.AddInParameter(commandWrapper, "@PrizeType", DbType.Int32, entity.PrizeType);
            database.AddInParameter(commandWrapper, "@PrizeSub", DbType.Int32, entity.PrizeSub);
            database.AddInParameter(commandWrapper, "@ItemType", DbType.Int32, entity.ItemType);
            database.AddInParameter(commandWrapper, "@ItemCode", DbType.Int32, entity.ItemCode);
            database.AddInParameter(commandWrapper, "@ItemCount", DbType.Int32, entity.ItemCount);


            int results = 0;

            if (trans != null)
            {
                results = database.ExecuteNonQuery(commandWrapper, trans);
            }
            else
            {
                results = database.ExecuteNonQuery(commandWrapper);
            }


            return(Convert.ToBoolean(results));
        }
        /// <summary>
        /// 将IDataReader的当前记录读取到ConfigPenaltykickprizeEntity 对象
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public ConfigPenaltykickprizeEntity LoadSingleRow(IDataReader reader)
        {
            var obj = new ConfigPenaltykickprizeEntity();

            obj.Idx       = (System.Int32)reader["Idx"];
            obj.PrizeType = (System.Int32)reader["PrizeType"];
            obj.PrizeSub  = (System.Int32)reader["PrizeSub"];
            obj.ItemType  = (System.Int32)reader["ItemType"];
            obj.ItemCode  = (System.Int32)reader["ItemCode"];
            obj.ItemCount = (System.Int32)reader["ItemCount"];

            return(obj);
        }
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>ConfigPenaltykickprizeEntity</returns>
        /// <remarks>2016/9/13 16:03:17</remarks>
        public ConfigPenaltykickprizeEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

            DbCommand commandWrapper = database.GetStoredProcCommand("P_ConfigPenaltykickprize_GetById");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, idx);


            ConfigPenaltykickprizeEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
示例#4
0
        public static bool Update(ConfigPenaltykickprizeEntity configPenaltykickprizeEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new ConfigPenaltykickprizeProvider(zoneId);

            return(provider.Update(configPenaltykickprizeEntity, trans));
        }
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2016/9/13 16:03:17</remarks>
 public bool Update(ConfigPenaltykickprizeEntity entity)
 {
     return(Update(entity, null));
 }
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2016/9/13 16:03:17</remarks>
 public bool Insert(ConfigPenaltykickprizeEntity entity)
 {
     return(Insert(entity, null));
 }