Пример #1
0
        public virtual ActionResult Index(AwardCreateModel a)
        {
            ViewData["a"] = a;
            if (!ModelState.IsValid)
            {
                return(View(Awards.All().WithDocuments()));
            }

            var x = a.CreateAward();

            try
            {
                Awards.Save(x);
                return(this.RedirectToAction(c => c.Edit(x.Document.Id)));
            }
            catch (Exception ex)
            {
                Notifier.Notify(ex);
                return(View(Awards.All().WithDocuments()));
            }
        }
Пример #2
0
        public virtual ActionResult Index(AwardCreateModel a)
        {
			ViewData["a"] = a;
			if (!ModelState.IsValid)
			{
                return View(Awards.All().WithDocuments());
			}
			
			var x = a.CreateAward();
            try
            {
				Awards.Save(x);
                return this.RedirectToAction(c => c.Edit(x.Document.Id));
            }
            catch (Exception ex)
            {
				Notifier.Notify(ex);
                return View(Awards.All().WithDocuments());
            }
        }