Ejemplo n.º 1
0
        public JsonResult GuardianREALTimeMonitor()
        {
            var id   = Request.Params["id"];
            var name = Request.Params["name"];

            id   = Encoder.HtmlEncode(id);
            name = Encoder.HtmlEncode(name);

            var dto = DbPostTestsUtils.VerifyPostTest("GuardianREALTimeMonitor", Request.Params);

            if (dto.IsSuccessful)
            {
                //get the person id
                var nameId = int.Parse(id);
                //save test as completed
                DbPostTestsUtils.AddAndUpdateTestCompleted(nameId, "Guardian REAL-Time Monitor");
            }

            var incorrect = "";

            if (dto.Messages.Count > 0)
            {
                incorrect = dto.Messages.Aggregate(incorrect, (current, s) => current + (s + ","));
                incorrect = incorrect.Substring(0, incorrect.Length - 1);
            }

            _logger.LogInfo("Post-tests GuardianREALTimeMonitor: " + name + ", " + dto.Message + incorrect);
            return(Json(dto));
        }