Example #1
0
        /// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2015/10/31 13:51:36</remarks>
        public bool Update(ConfigLeagueprizeEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigLeagueprize_Update");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx);
            database.AddInParameter(commandWrapper, "@LeagueID", DbType.Int32, entity.LeagueID);
            database.AddInParameter(commandWrapper, "@ResultType", DbType.Int32, entity.ResultType);
            database.AddInParameter(commandWrapper, "@PrizeType", DbType.Int32, entity.PrizeType);
            database.AddInParameter(commandWrapper, "@ItemCode", DbType.Int32, entity.ItemCode);
            database.AddInParameter(commandWrapper, "@Count", DbType.Int32, entity.Count);
            database.AddInParameter(commandWrapper, "@IsBindIng", DbType.Boolean, entity.IsBindIng);


            int results = 0;

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


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

            obj.Idx        = (System.Int32)reader["Idx"];
            obj.LeagueID   = (System.Int32)reader["LeagueID"];
            obj.ResultType = (System.Int32)reader["ResultType"];
            obj.PrizeType  = (System.Int32)reader["PrizeType"];
            obj.ItemCode   = (System.Int32)reader["ItemCode"];
            obj.Count      = (System.Int32)reader["Count"];
            obj.IsBindIng  = (System.Boolean)reader["IsBindIng"];

            return(obj);
        }
Example #3
0
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>ConfigLeagueprizeEntity</returns>
        /// <remarks>2015/10/31 13:51:36</remarks>
        public ConfigLeagueprizeEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

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


            ConfigLeagueprizeEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
Example #4
0
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2015/10/31 13:51:36</remarks>
 public bool Update(ConfigLeagueprizeEntity entity)
 {
     return(Update(entity, null));
 }
Example #5
0
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2015/10/31 13:51:36</remarks>
 public bool Insert(ConfigLeagueprizeEntity entity)
 {
     return(Insert(entity, null));
 }
        public static bool Update(ConfigLeagueprizeEntity configLeagueprizeEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new ConfigLeagueprizeProvider(zoneId);

            return(provider.Update(configLeagueprizeEntity, trans));
        }