public ActionResult SendOrder(ExaminationModel model) { ModelState.Remove("PostDate"); string captcha = AccountUtil.GetCaptcha(); if (!captcha.Equals(model.ConfirmationCode, StringComparison.OrdinalIgnoreCase)) { ModelState.AddModelError("ConfirmationCode", "驗證碼錯誤"); if (model.QuestionSelects2 != null && model.QuestionSelects2.Count() > 0) { ModelState.Remove("Question2"); } if (model.QuestionSelects3 != null && model.QuestionSelects3.Count() > 0) { ModelState.Remove("Question3"); } if (model.QuestionSelects9 != null && model.QuestionSelects9.Count() > 0) { ModelState.Remove("Question9"); } if (model.QuestionSelects10 != null && model.QuestionSelects10.Count() > 0) { ModelState.Remove("Question10"); } } else { if (model.IsValid()) { model.Insert(); model.SendOrderOk = true; } } if (model.SendOrderOk) { return View("SendOrderOK"); } else { return View("Index", model); } }
public ActionResult Edit(ExaminationModel model, string cdts) { GetConditions(cdts); model.Update(); return RedirectToAction("AdminIndex", new { Page = model.Page, Cdts = cdts }); }
public ActionResult Create(ExaminationModel model, string cdts) { GetConditions(cdts); model.Insert(); return View("AdminIndex"); }