コード例 #1
0
ファイル: Sys_LogProvider.cs プロジェクト: dalinhuang/cy-csts
        public IList<Core.Business.Sys_Log> GetAllSys_Log()
        {
            IList<Core.Business.Sys_Log> sys_Loglist = new List<Core.Business.Sys_Log>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllSys_Log);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Sys_Log sys_Log = new Core.Business.Sys_Log();

                    if (!reader.IsDBNull(0)) sys_Log.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) sys_Log.Sys_CreateTime = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) sys_Log.Sys_Message = reader.GetString(2);
                    if (!reader.IsDBNull(3)) sys_Log.Sys_Manage = reader.GetString(3);
                    if (!reader.IsDBNull(4)) sys_Log.IP = reader.GetString(4);
                    if (!reader.IsDBNull(5)) sys_Log.Person = reader.GetString(5);

                    sys_Log.MarkOld();
                    sys_Loglist.Add(sys_Log);
                }
                reader.Close();
            }
            return sys_Loglist;
        }
コード例 #2
0
ファイル: Sys_LogProvider.cs プロジェクト: dalinhuang/cy-csts
        public Core.Business.Sys_Log Select(Int64 id)
        {
            SqlServerUtility sql = new SqlServerUtility();

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

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

                if (!reader.IsDBNull(0)) sys_Log.Id = reader.GetInt64(0);
                if (!reader.IsDBNull(1)) sys_Log.Sys_CreateTime = reader.GetDateTime(1);
                if (!reader.IsDBNull(2)) sys_Log.Sys_Message = reader.GetString(2);
                if (!reader.IsDBNull(3)) sys_Log.Sys_Manage = reader.GetString(3);
                if (!reader.IsDBNull(4)) sys_Log.IP = reader.GetString(4);
                if (!reader.IsDBNull(5)) sys_Log.Person = reader.GetString(5);

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

                return null;
            }
        }
コード例 #3
0
ファイル: Sys_LogProvider.cs プロジェクト: dalinhuang/cy-csts
        public IEnumerable<Sys_Log> SearchLogs(DateTime startDate, DateTime endDate, string content, string name)
        {
            IList<Core.Business.Sys_Log> sys_Loglist = new List<Core.Business.Sys_Log>();

            SqlServerUtility sql = new SqlServerUtility();

            sql.AddParameter("@content", SqlDbType.NVarChar, content);

            sql.AddParameter("@startdate", SqlDbType.DateTime, startDate);

            sql.AddParameter("@enddate", SqlDbType.DateTime, endDate);

            sql.AddParameter("@name", SqlDbType.NVarChar, name);

            SqlDataReader reader = sql.ExecuteSPReader("usp_SearchLog");

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Sys_Log sys_Log = new Core.Business.Sys_Log();

                    if (!reader.IsDBNull(0)) sys_Log.Id = reader.GetInt64(0);
                    if (!reader.IsDBNull(1)) sys_Log.Sys_Message = reader.GetString(1);
                    if (!reader.IsDBNull(2)) sys_Log.Sys_CreateTime = reader.GetDateTime(2);
                    if (!reader.IsDBNull(3)) sys_Log.Sys_Manage = reader.GetString(3);
                    if (!reader.IsDBNull(4)) sys_Log.IP = reader.GetString(4);
                    if (!reader.IsDBNull(5)) sys_Log.Person = reader.GetString(5);

                    sys_Log.MarkOld();
                    sys_Loglist.Add(sys_Log);
                }
                reader.Close();
            }
            return sys_Loglist;
        }