Ejemplo n.º 1
0
        public ActionResult _GetLogs(LogSearchModel searchModel)
        {
            if (string.IsNullOrWhiteSpace(searchModel.UserEmail) &&
                searchModel.EventId == null)
            {
                ModelState.AddModelError("FilterOptions", "At least one filter option must be applied.");
            }

            if (!ModelState.IsValid)
            {
                return(Json(new { success = false, message = ModelState.GetErrors() }, JsonRequestBehavior.AllowGet));
            }

            var userEmail = searchModel.UserEmail?.Split('|')[1];

            var logs = LogServices.GetLogs(searchModel.EventId, userEmail, searchModel.DayRange);

            return(PartialView("_List", logs));
        }