예제 #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());
            }
        }