Пример #1
0
        /// <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));
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
        public static bool Update(ConfigRevelationthebadgeawaryEntity configRevelationthebadgeawaryEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new ConfigRevelationthebadgeawaryProvider(zoneId);

            return(provider.Update(configRevelationthebadgeawaryEntity, trans));
        }
Пример #5
0
 /// <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));
 }
Пример #6
0
 /// <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));
 }