Beispiel #1
0
        /// <summary>
        /// 带事务的Update
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="trans">The trans.</param>
        /// <returns></returns>
        /// <remarks>2017/2/22 17:28:08</remarks>
        public bool Update(ConfigCoachinfoEntity entity, DbTransaction trans)
        {
            var       database       = new SqlDatabase(this.ConnectionString);
            DbCommand commandWrapper = database.GetStoredProcCommand("dbo.P_ConfigCoachinfo_Update");

            database.AddInParameter(commandWrapper, "@Idx", DbType.Int32, entity.Idx);
            database.AddInParameter(commandWrapper, "@Name", DbType.String, entity.Name);
            database.AddInParameter(commandWrapper, "@Offensive", DbType.Int32, entity.Offensive);
            database.AddInParameter(commandWrapper, "@Organizational", DbType.Int32, entity.Organizational);
            database.AddInParameter(commandWrapper, "@Defense", DbType.Int32, entity.Defense);
            database.AddInParameter(commandWrapper, "@BodyAttr", DbType.Int32, entity.BodyAttr);
            database.AddInParameter(commandWrapper, "@Goalkeeping", DbType.Int32, entity.Goalkeeping);
            database.AddInParameter(commandWrapper, "@IsSkill", DbType.Boolean, entity.IsSkill);
            database.AddInParameter(commandWrapper, "@SkillId", DbType.Int32, entity.SkillId);
            database.AddInParameter(commandWrapper, "@DebrisCode", DbType.Int32, entity.DebrisCode);


            int results = 0;

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


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

            obj.Idx            = (System.Int32)reader["Idx"];
            obj.Name           = (System.String)reader["Name"];
            obj.Offensive      = (System.Int32)reader["Offensive"];
            obj.Organizational = (System.Int32)reader["Organizational"];
            obj.Defense        = (System.Int32)reader["Defense"];
            obj.BodyAttr       = (System.Int32)reader["BodyAttr"];
            obj.Goalkeeping    = (System.Int32)reader["Goalkeeping"];
            obj.IsSkill        = (System.Boolean)reader["IsSkill"];
            obj.SkillId        = (System.Int32)reader["SkillId"];
            obj.DebrisCode     = (System.Int32)reader["DebrisCode"];

            return(obj);
        }
Beispiel #3
0
        /// <summary>
        /// GetById
        /// </summary>
        /// <param name="idx">idx</param>
        /// <returns>ConfigCoachinfoEntity</returns>
        /// <remarks>2017/2/22 17:28:08</remarks>
        public ConfigCoachinfoEntity GetById(System.Int32 idx)
        {
            var database = new SqlDatabase(this.ConnectionString);

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

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


            ConfigCoachinfoEntity obj = null;

            using (IDataReader reader = database.ExecuteReader(commandWrapper))
            {
                if (reader.Read())
                {
                    obj = LoadSingleRow(reader);
                }
            }
            return(obj);
        }
        public static bool Update(ConfigCoachinfoEntity configCoachinfoEntity, DbTransaction trans = null, string zoneId = "")
        {
            var provider = new ConfigCoachinfoProvider(zoneId);

            return(provider.Update(configCoachinfoEntity, trans));
        }
Beispiel #5
0
 /// <summary>
 /// Update
 /// </summary>
 /// <param name="entity"></param>
 /// <returns></returns>
 /// <remarks>2017/2/22 17:28:08</remarks>
 public bool Update(ConfigCoachinfoEntity entity)
 {
     return(Update(entity, null));
 }
Beispiel #6
0
 /// <summary>
 /// Insert
 /// </summary>
 /// <param name="entity"></param>
 /// <param name="trans">The trans.</param>
 /// <returns></returns>
 /// <remarks>2017/2/22 17:28:08</remarks>
 public bool Insert(ConfigCoachinfoEntity entity)
 {
     return(Insert(entity, null));
 }