Beispiel #1
0
        /// <summary>
        /// Log entries table partial view
        /// </summary>
        //[Authorize]
        public ActionResult LogTable(SiteLogViewModel model)
        {
            List<string> lvls = CheckedBoxesToStringList(model);

            int rowsToShow = model.RowsToShow ?? 0;

            return PartialView("_LogEntryTable", DBRepository.GetLogAtLevels(lvls.ToArray<string>(), rowsToShow, true));
        }
Beispiel #2
0
        public ActionResult Index()
        {
            SiteLogViewModel m = new SiteLogViewModel()
            {
                RowsToShow = DEF_ROWS,
                Trace = true,
                Debug = true,
                Application = true,
                Warning = true,
                Error = true,
                Fatal = true
                //DateToPurge = DateTime.Now
            };

            return View(m);
        }
Beispiel #3
0
        private List<string> CheckedBoxesToStringList(SiteLogViewModel model)
        {
            List<string> lvls = new List<string>();

            if (model.Trace)
                lvls.Add("Trace");
            if (model.Debug)
                lvls.Add("Debug");
            if (model.Application)
                lvls.Add("Info");
            if (model.Warning)
                lvls.Add("Warn");
            if (model.Error)
                lvls.Add("Error");
            if (model.Fatal)
                lvls.Add("Fatal");
            return lvls;
        }