public ActionResult Details(string id, ServiceHostSettings model)
 {
     var serviceHost = reader.GetServiceHost(id);
     ViewBag.Trail = serviceHost.GetTrail();
     if (!serviceHost.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     ViewBag.Name = serviceHost.ConfigSet.Name;
     ViewBag.System = serviceHost.ConfigSet.System;
     ViewBag.HostId = serviceHost.Id;
     CreateLayerSelectList(serviceHost);
     serviceHost.Description = model.Description;
     serviceHost.Visualization = model.Visualization;
     serviceHost.Level = model.Level;
     serviceHost.Alias = model.Alias;
     if (model.Name.ContainsCharacters() && (model.Name != serviceHost.Name))
         serviceHost.Name = model.Name;
     reader.UpdateServiceHost(serviceHost);
     ViewBag.Visializations = new List<string> { "ellipse", "circle", "database", "box" };
     return View(serviceHost);
 }
 public ActionResult Create(string id, ServiceHostSettings model)
 {
     var configSet = reader.GetConfigSet(id);
     if (!configSet.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     ViewBag.Id = configSet.Id;
     var serviceHost = reader.CreateServiceHost(configSet, model.Name);
     return RedirectToAction("Details", new { id = serviceHost.Id });
 }
 public ActionResult Delete(string id, ServiceHostSettings model)
 {
     var host = reader.GetServiceHost(id);
     var name = host.ConfigSet.Name;
     var system = host.ConfigSet.System;
     if (!host.UserHasAccessTo()) throw new UnauthorizedAccessException("Access denied to configset");
     ViewBag.Id = host.Id;
     reader.DeleteServiceHost(host);
     return RedirectToAction("Details","ConfigSet", new { name=name,system=system });
 }