示例#1
0
        /// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2016/3/3 17:18:10</remarks>
        public bool Update(DicActivitystepEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_DicActivitystep_Update");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx);
            database.AddInParameter(commandWrapper, "@ActivityId", DbType.Int32, entity.ActivityId);
            database.AddInParameter(commandWrapper, "@ActivityStep", DbType.Int32, entity.ActivityStep);
            database.AddInParameter(commandWrapper, "@Condition", DbType.AnsiString, entity.Condition);
            database.AddInParameter(commandWrapper, "@Description", DbType.String, entity.Description);


            int results = 0;

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


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

            obj.Idx          = (System.Int32)reader["Idx"];
            obj.ActivityId   = (System.Int32)reader["ActivityId"];
            obj.ActivityStep = (System.Int32)reader["ActivityStep"];
            obj.Condition    = (System.String)reader["Condition"];
            obj.Description  = (System.String)reader["Description"];

            return(obj);
        }
示例#3
0
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>DicActivitystepEntity</returns>
        /// <remarks>2016/3/3 17:18:10</remarks>
        public DicActivitystepEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

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


            DicActivitystepEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
示例#4
0
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2016/3/3 17:18:10</remarks>
 public bool Update(DicActivitystepEntity entity)
 {
     return(Update(entity, null));
 }
示例#5
0
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2016/3/3 17:18:10</remarks>
 public bool Insert(DicActivitystepEntity entity)
 {
     return(Insert(entity, null));
 }
示例#6
0
        public static bool Update(DicActivitystepEntity dicActivitystepEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new DicActivitystepProvider(zoneId);

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