Ejemplo n.º 1
0
        /// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2014/10/21 18:01:47</remarks>
        public bool Update(ConfigRevelationvipEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigRevelationvip_Update");

            database.AddInParameter(commandWrapper, "@VipLevel", DbType.Int32, entity.VipLevel);
            database.AddInParameter(commandWrapper, "@Challenges", DbType.Int32, entity.Challenges);
            database.AddInParameter(commandWrapper, "@CDTime", DbType.Int32, entity.CDTime);
            database.AddInParameter(commandWrapper, "@ItemIsBind", DbType.Boolean, entity.ItemIsBind);


            int results = 0;

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


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

            obj.VipLevel   = (System.Int32)reader["VipLevel"];
            obj.Challenges = (System.Int32)reader["Challenges"];
            obj.CDTime     = (System.Int32)reader["CDTime"];
            obj.ItemIsBind = (System.Boolean)reader["ItemIsBind"];

            return(obj);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="vipLevel">vipLevel</param>
        /// <returns>ConfigRevelationvipEntity</returns>
        /// <remarks>2014/10/21 18:01:47</remarks>
        public ConfigRevelationvipEntity GetById(System.Int32 vipLevel)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

            database.AddInParameter(commandWrapper, "@VipLevel", DbType.Int32, vipLevel);


            ConfigRevelationvipEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
Ejemplo n.º 4
0
        public static bool Update(ConfigRevelationvipEntity configRevelationvipEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new ConfigRevelationvipProvider(zoneId);

            return(provider.Update(configRevelationvipEntity, trans));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2014/10/21 18:01:47</remarks>
 public bool Update(ConfigRevelationvipEntity entity)
 {
     return(Update(entity, null));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2014/10/21 18:01:47</remarks>
 public bool Insert(ConfigRevelationvipEntity entity)
 {
     return(Insert(entity, null));
 }