예제 #1
0
 public ActionResult New(SiteNewModel model)
 {
     if (ModelState.IsValid)
     {
         if (!SiteModel.NewSite(new Sites()
         {
             domain = model.domain, name = model.name
         }))
         {
             ModelState.AddModelError("", "域名已经存在。");
         }
         else
         {
             ViewBag.Message = "添加站点成功。";
             Model.ScriptRedirect(ViewBag, Url.Action("Index", "Site"));
         }
     }
     return(View());
 }