public ActionResult SendOrder(EpaperExaminationModel model)
        {
            ModelState.Remove("PostDate");
            ModelState.Remove("Question10");
            ModelState.Remove("Question11");
            ModelState.Remove("Question12");
            string captcha = AccountUtil.GetCaptcha();

            if (!captcha.Equals(model.ConfirmationCode, StringComparison.OrdinalIgnoreCase))
            {
                ModelState.AddModelError("ConfirmationCode", "驗證碼錯誤");
            }
            else
            {
                if (model.IsValid())
                {
                    model.Insert();
                    model.SendOrderOk = true;
                }
            }
            if (model.SendOrderOk)
            {
                return(View("SendOrderOK"));
            }
            else
            {
                return(View("Index", model));
            }
        }
Пример #2
0
 public ActionResult Edit(EpaperExaminationModel model, string cdts)
 {
     GetConditions(cdts);
     model.Update();
     return(RedirectToAction("AdminIndex", new { Page = model.Page, Cdts = cdts }));
 }
Пример #3
0
 public ActionResult Create(EpaperExaminationModel model, string cdts)
 {
     GetConditions(cdts);
     model.Insert();
     return(View("AdminIndex"));
 }