Ejemplo n.º 1
0
        /// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2016/4/11 17:29:06</remarks>
        public bool Update(DicStararousalskillsEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_DicStararousalskills_Update");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx);
            database.AddInParameter(commandWrapper, "@PlayerId", DbType.Int32, entity.PlayerId);
            database.AddInParameter(commandWrapper, "@ArousalLv", DbType.Int32, entity.ArousalLv);
            database.AddInParameter(commandWrapper, "@ArousalSkillId", DbType.Int32, entity.ArousalSkillId);
            database.AddInParameter(commandWrapper, "@ArousalSkillCode", DbType.AnsiString, entity.ArousalSkillCode);
            database.AddInParameter(commandWrapper, "@RawSkillCode", DbType.AnsiString, entity.RawSkillCode);
            database.AddInParameter(commandWrapper, "@SkillName", DbType.String, entity.SkillName);
            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));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 将IDataReader的当前记录读取到DicStararousalskillsEntity 对象
        /// </summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public DicStararousalskillsEntity LoadSingleRow(IDataReader reader)
        {
            var obj = new DicStararousalskillsEntity();

            obj.Idx              = (System.Int32)reader["Idx"];
            obj.PlayerId         = (System.Int32)reader["PlayerId"];
            obj.ArousalLv        = (System.Int32)reader["ArousalLv"];
            obj.ArousalSkillId   = (System.Int32)reader["ArousalSkillId"];
            obj.ArousalSkillCode = (System.String)reader["ArousalSkillCode"];
            obj.RawSkillCode     = (System.String)reader["RawSkillCode"];
            obj.SkillName        = (System.String)reader["SkillName"];
            obj.Description      = (System.String)reader["Description"];

            return(obj);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>DicStararousalskillsEntity</returns>
        /// <remarks>2016/4/11 17:29:06</remarks>
        public DicStararousalskillsEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

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


            DicStararousalskillsEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2016/4/11 17:29:06</remarks>
 public bool Update(DicStararousalskillsEntity entity)
 {
     return(Update(entity, null));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2016/4/11 17:29:06</remarks>
 public bool Insert(DicStararousalskillsEntity entity)
 {
     return(Insert(entity, null));
 }
Ejemplo n.º 6
0
        public static bool Update(DicStararousalskillsEntity dicStararousalskillsEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new DicStararousalskillsProvider(zoneId);

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