Beispiel #1
0
        public ActionResult AuditLogs(string start, string end)
        {
            JavaScriptSerializer jss = new JavaScriptSerializer();

            try
            {
                DateTime startDate = DateTime.ParseExact(start, "MM-dd-yyyy", CultureInfo.CurrentCulture);
                DateTime endDate   = DateTime.ParseExact(end, "MM-dd-yyyy", CultureInfo.CurrentCulture);
                AuditLog log       = new AuditLog();
                IEnumerable <AuditLogEntry> logs = log.GetLogs(startDate, endDate);
                return(Json(new { success = true, data = jss.Serialize(logs) }, "application/json"));
            }
            catch (Exception ex)
            {
                Log.Write(TraceEventType.Stop, "Logging Controller, AuditLogs | Exception {0}", ex);
                return(Json(new { success = false, message = ex.Message }, "text/json"));
            }
        }