コード例 #1
0
        public IList<Core.Business.InstantlyKillingLog> GetAllInstantlyKillingLog()
        {
            IList<Core.Business.InstantlyKillingLog> instantlyKillingLoglist = new List<Core.Business.InstantlyKillingLog>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllInstantlyKillingLog);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.InstantlyKillingLog instantlyKillingLog = new Core.Business.InstantlyKillingLog();

                    if (!reader.IsDBNull(0)) instantlyKillingLog.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) instantlyKillingLog.Count = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) instantlyKillingLog.DateCreated = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) instantlyKillingLog.Integral = reader.GetDouble(3);
                    if (!reader.IsDBNull(4)) instantlyKillingLog.InstanceId = reader.GetInt64(4);
                    if (!reader.IsDBNull(5)) instantlyKillingLog.AccountId = reader.GetInt64(5);
                    if (!reader.IsDBNull(6)) instantlyKillingLog.AccountName = reader.GetString(6);

                    instantlyKillingLog.MarkOld();
                    instantlyKillingLoglist.Add(instantlyKillingLog);
                }
                reader.Close();
            }
            return instantlyKillingLoglist;
        }
コード例 #2
0
        public Core.Business.InstantlyKillingLog Select(Int64 id)
        {
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            sql.AddParameter("@Id", SqlDbType.BigInt, id);
            SqlDataReader reader = sql.ExecuteSqlReader(SqlSelectInstantlyKillingLog);

            if (reader != null && !reader.IsClosed && reader.Read())
            {
                Core.Business.InstantlyKillingLog instantlyKillingLog = new Core.Business.InstantlyKillingLog();

                if (!reader.IsDBNull(0)) instantlyKillingLog.Id = reader.GetInt64(0);
                if (!reader.IsDBNull(1)) instantlyKillingLog.Count = reader.GetInt32(1);
                if (!reader.IsDBNull(2)) instantlyKillingLog.DateCreated = reader.GetDateTime(2);
                if (!reader.IsDBNull(3)) instantlyKillingLog.Integral = reader.GetDouble(3);
                if (!reader.IsDBNull(4)) instantlyKillingLog.InstanceId = reader.GetInt64(4);
                if (!reader.IsDBNull(5)) instantlyKillingLog.AccountId = reader.GetInt64(5);
                if (!reader.IsDBNull(6)) instantlyKillingLog.AccountName = reader.GetString(6);

                reader.Close();
                return instantlyKillingLog;
            }
            else
            {
                if (reader != null && !reader.IsClosed)
                    reader.Close();

                return null;
            }
        }
コード例 #3
0
        public IList<Core.Business.InstantlyKillingLog> GetTopIKLog(long Id, int PageSize, String Order)
        {
            IList<Core.Business.InstantlyKillingLog> instantlyKillingLoglist = new List<Core.Business.InstantlyKillingLog>();
            SqlServerUtility sql = new SqlServerUtility(connectionString);

            StringBuilder StrSql = new StringBuilder();
            StrSql.Append("SELECT TOP (" + PageSize + ") [Id],[Count],[DateCreated],[Integral],[InstanceId],[AccountId],[AccountName] ");
            StrSql.Append("FROM [InstantlyKillingLog] WHERE [InstanceId]=" + Id + " ORDER BY [Id] " + Order);

            SqlDataReader reader = sql.ExecuteSqlReader(StrSql.ToString());

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.InstantlyKillingLog instantlyKillingLog = new Core.Business.InstantlyKillingLog();

                    if (!reader.IsDBNull(0)) instantlyKillingLog.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) instantlyKillingLog.Count = reader.GetInt32(1);
                    if (!reader.IsDBNull(2)) instantlyKillingLog.DateCreated = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) instantlyKillingLog.Integral = reader.GetDouble(3);
                    if (!reader.IsDBNull(4)) instantlyKillingLog.InstanceId = reader.GetInt64(4);
                    if (!reader.IsDBNull(5)) instantlyKillingLog.AccountId = reader.GetInt64(5);
                    if (!reader.IsDBNull(6)) instantlyKillingLog.AccountName = reader.GetString(6);

                    instantlyKillingLog.MarkOld();
                    instantlyKillingLoglist.Add(instantlyKillingLog);
                }
                reader.Close();
            }
            return instantlyKillingLoglist;
        }