mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-24 05:23:33 +08:00
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Logging;
|
||||
using Orchard.MultiTenancy.Services;
|
||||
using Orchard.MultiTenancy.ViewModels;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Notify;
|
||||
using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.MultiTenancy.Controllers {
|
||||
[ValidateInput(false)]
|
||||
@@ -21,10 +22,12 @@ namespace Orchard.MultiTenancy.Controllers {
|
||||
|
||||
Services = orchardServices;
|
||||
T = NullLocalizer.Instance;
|
||||
Logger = NullLogger.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
public IOrchardServices Services { get; set; }
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public ActionResult Index() {
|
||||
return View(new TenantsIndexViewModel { TenantSettings = _tenantService.GetTenants() });
|
||||
@@ -61,9 +64,9 @@ namespace Orchard.MultiTenancy.Controllers {
|
||||
});
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
catch (Exception exception) {
|
||||
Services.Notifier.Error(T("Creating Tenant failed: {0}", exception.Message));
|
||||
} catch (Exception exception) {
|
||||
this.Error(exception, T("Creating Tenant failed: {0}", exception.Message), Logger, Services.Notifier);
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
}
|
||||
@@ -115,9 +118,9 @@ namespace Orchard.MultiTenancy.Controllers {
|
||||
});
|
||||
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
catch (Exception exception) {
|
||||
Services.Notifier.Error(T("Failed to edit tenant: {0} ", exception.Message));
|
||||
} catch (Exception exception) {
|
||||
this.Error(exception, T("Failed to edit tenant: {0} ", exception.Message), Logger, Services.Notifier);
|
||||
|
||||
return View(viewModel);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user