Exemple #1
0
        public IList<Core.Business.Actinlog> GetAllActinlog()
        {
            IList<Core.Business.Actinlog> actinloglist = new List<Core.Business.Actinlog>();
            SqlServerUtility sql = new SqlServerUtility();

            SqlDataReader reader = sql.ExecuteSqlReader(SqlGetAllActinlog);

            if(reader != null)
            {
                while(reader.Read())
                {
                    Core.Business.Actinlog actinlog = new Core.Business.Actinlog();

                    if (!reader.IsDBNull(0)) actinlog.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) actinlog.LogDate = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) actinlog.Logger = reader.GetString(2);
                    if (!reader.IsDBNull(3)) actinlog.ModuleId = reader.GetInt32(3);
                    if (!reader.IsDBNull(4)) actinlog.ModuleAction = reader.GetString(4);

                    actinlog.MarkOld();
                    actinloglist.Add(actinlog);
                }
                reader.Close();
            }
            return actinloglist;
        }
Exemple #2
0
        public IList<Actinlog> Search(DateTime beginDate, DateTime endDate, string logger)
        {
            IList<Core.Business.Actinlog> actinloglist = new List<Core.Business.Actinlog>();
            SqlServerUtility sql = new SqlServerUtility();
            sql.AddParameter("@beginDate", SqlDbType.DateTime, beginDate);
            sql.AddParameter("@endDate", SqlDbType.DateTime, endDate);
            sql.AddParameter("@Logger", SqlDbType.NVarChar,logger);

            SqlDataReader reader = sql.ExecuteSqlReader(sqlSearchActinlog);

            if (reader != null)
            {
                while (reader.Read())
                {
                    Core.Business.Actinlog actinlog = new Core.Business.Actinlog();

                    if (!reader.IsDBNull(0)) actinlog.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1)) actinlog.LogDate = reader.GetDateTime(1);
                    if (!reader.IsDBNull(2)) actinlog.Logger = reader.GetString(2);
                    if (!reader.IsDBNull(3)) actinlog.ModuleId = reader.GetInt32(3);
                    if (!reader.IsDBNull(4)) actinlog.ModuleAction = reader.GetString(4);

                    actinlog.MarkOld();
                    actinloglist.Add(actinlog);
                }
                reader.Close();
            }
            return actinloglist;
        }