Example #1
0
        public virtual ActionResult Index(AccountCreateModel a)
        {
            ViewData["a"] = a;
            if (!ModelState.IsValid)
            {
                return(View(Accounts.All().WithDocuments()));
            }

            var x = a.CreateAccount();

            try
            {
                Accounts.Save(x);

                return(this.RedirectToAction(c => c.Edit(x.Document.Id)));
            }
            catch (Exception ex)
            {
                Notifier.Notify(ex);
                return(View(Accounts.All().WithDocuments()));
            }
        }
        public virtual ActionResult Index(AccountCreateModel a)
        {
			ViewData["a"] = a;
			if (!ModelState.IsValid)
			{
                return View(Accounts.All().WithDocuments());
			}
			
			var x = a.CreateAccount();
            try
            {
				Accounts.Save(x);

                return this.RedirectToAction(c => c.Edit(x.Document.Id));
            }
            catch (Exception ex)
            {
				Notifier.Notify(ex);
                return View(Accounts.All().WithDocuments());
            }
        }