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

            var x = t.CreateTenant();
            try
            {
                Tenants.Save(x);
                return this.RedirectToAction(c => c.Edit(x.Document.Id));
            }
            catch (Exception ex)
            {
                Notifier.Notify(ex);
                return View(Tenants.All().WithDocuments());
            }

        }
Пример #2
0
        public virtual ActionResult Index(TenantCreateModel t)
        {
            ViewData["create"] = t;
            if (!ModelState.IsValid)
            {
                return(View(Tenants.All().WithDocuments()));
            }

            var x = t.CreateTenant();

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