Exemplo n.º 1
0
 public ActionResult Create(Term term)
 {
     if (ModelState.IsValid)
     {
         _termRepository.InsertOrUpdate(term);
         _termRepository.Save();
         return(RedirectToAction("Management"));
     }
     return(View(term));
 }
Exemplo n.º 2
0
        public void StartNewTerm()
        {
            if (!CurrentTerm.CanBeClosed())
            {
                throw new TermException();
            }

            CloseCurrentTerm();
            _termRepository.Save(CurrentTerm);

            CurrentTerm = new Term(CurrentTerm.Id + 1)
            {
                Sum = _user.Sum
            };
        }