/// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2015/10/19 11:11:43</remarks>
        public bool Update(DicSkillbuffmatchEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_DicSkillbuffmatch_Update");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx);
            database.AddInParameter(commandWrapper, "@Type", DbType.Int32, entity.Type);
            database.AddInParameter(commandWrapper, "@LinkId", DbType.AnsiString, entity.LinkId);
            database.AddInParameter(commandWrapper, "@LinkType", DbType.AnsiString, entity.LinkType);
            database.AddInParameter(commandWrapper, "@BuffEngineId", DbType.AnsiString, entity.BuffEngineId);


            int results = 0;

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


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

            obj.Idx          = (System.Int32)reader["Idx"];
            obj.Type         = (System.Int32)reader["Type"];
            obj.LinkId       = (System.String)reader["LinkId"];
            obj.LinkType     = (System.String)reader["LinkType"];
            obj.BuffEngineId = (System.String)reader["BuffEngineId"];

            return(obj);
        }
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>DicSkillbuffmatchEntity</returns>
        /// <remarks>2015/10/19 11:11:42</remarks>
        public DicSkillbuffmatchEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

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


            DicSkillbuffmatchEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2015/10/19 11:11:43</remarks>
 public bool Update(DicSkillbuffmatchEntity entity)
 {
     return(Update(entity, null));
 }
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2015/10/19 11:11:43</remarks>
 public bool Insert(DicSkillbuffmatchEntity entity)
 {
     return(Insert(entity, null));
 }
Beispiel #6
0
        public static bool Update(DicSkillbuffmatchEntity dicSkillbuffmatchEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new DicSkillbuffmatchProvider(zoneId);

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