Пример #1
0
 public ActionResult Create(string siteShortName, Term term)
 {
     if (ModelState.IsValid)
     {
         try
         {
             term.Site = site;
             dataRepository.CreateTerm(term);
             return RedirectToAction("Index", new { siteShortName = siteShortName });
         }
         catch (RuleViolationException)
         {
             ModelState.AddModelErrors(term.GetRuleViolations());
         }
         catch (Exception ex)
         {
             ModelState.AddModelError("_FORM", ex.Message);
         }
     }
     return View(term);
 }
Пример #2
0
 public ActionResult Create(string siteShortName)
 {
     Term term = new Term() { StartDate = DateTime.Now, EndDate = DateTime.Now.AddMonths(5) };
     return View(term);
 }