public ActionResult Create(t_testimony t, bool captchaValid, string captchaErrorMessage) { if (ModelState.IsValid) { if (!captchaValid) { ModelState.AddModelError("recaptcha", captchaErrorMessage); return View(t); } t.date = DateTime.Now; t.patient_userId =connectedUserId; testimonyService.AddTestimony(t); return RedirectToAction("Index"); } else { return View(); } }
public ActionResult Edit(t_testimony testimony) { if (ModelState.IsValid) { // t_testimony testimony = testimonyService.GetById(id); testimonyService.UpdateTestimony(testimony); return RedirectToAction("Index"); } else { return View(); } }