// [ValidateInput(false)] public ActionResult Edit(Administration model) { if (!ModelState.IsValid) { ViewBag.ExamStatuses = statusList; ViewBag.Sources = sourceList; ViewBag.Exams = testList; return(View(model)); } model.LastUpdatedBy = User.Identity.Name; model.LastUpdatedOn = DateTime.Now; var result = examsession.Update(model); if (result.status) { ViewBag.token = result.message; // return RedirectToAction("View", new { id = model.Id }); //return RedirectToAction("Index"); return(Json(new { status = "success" })); } else { ViewBag.ErrorMessage = result.message; //return View("Error"); return(Json(new { status = "error" })); } }
public IActionResult UpdateTestDetails([FromBody] Administration model) { var result = examsession.Update(model); if (result.status) { return(Ok("Done")); } else { return(BadRequest(result.message)); } }