Exemplo n.º 1
0
        /// <summary>
        /// 将IDataReader的当前记录读取到ConfigRevelationsynthesizeionEntity 对象
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public ConfigRevelationsynthesizeionEntity LoadSingleRow(IDataReader reader)
        {
            var obj = new ConfigRevelationsynthesizeionEntity();

            obj.Idx   = (System.Int32)reader["Idx"];
            obj.Value = (System.Int32)reader["Value"];

            return(obj);
        }
Exemplo n.º 2
0
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>ConfigRevelationsynthesizeionEntity</returns>
        /// <remarks>2014/10/13 13:59:13</remarks>
        public ConfigRevelationsynthesizeionEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

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


            ConfigRevelationsynthesizeionEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2014/10/13 13:59:13</remarks>
        public bool Update(ConfigRevelationsynthesizeionEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigRevelationsynthesizeion_Update");

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


            int results = 0;

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


            return(Convert.ToBoolean(results));
        }
        public static bool Update(ConfigRevelationsynthesizeionEntity configRevelationsynthesizeionEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new ConfigRevelationsynthesizeionProvider(zoneId);

            return(provider.Update(configRevelationsynthesizeionEntity, trans));
        }
Exemplo n.º 5
0
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2014/10/13 13:59:13</remarks>
 public bool Update(ConfigRevelationsynthesizeionEntity entity)
 {
     return(Update(entity, null));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2014/10/13 13:59:13</remarks>
 public bool Insert(ConfigRevelationsynthesizeionEntity entity)
 {
     return(Insert(entity, null));
 }