public ActionResult Copy(string siteName) { var site = new Site(siteName); CopySiteModel model = new CopySiteModel() { Parent = site.Parent == null ? "" : site.Parent.FullName }; return View(model); }
public ActionResult Copy(string siteName,CopySiteModel model) { var site = new Site(siteName); var data = new JsonResultEntry(ViewData.ModelState); if (ModelState.IsValid) { try { var createdSite = Kooboo.CMS.Sites.Services.ServiceFactory.SiteManager.Copy(site, model.Name, model.Repository); } catch (Exception e) { Kooboo.HealthMonitoring.Log.LogException(e); } } return Json(data); }
public ActionResult Copy(CopySiteModel model) { var data = new JsonResultData(ViewData.ModelState); if (ModelState.IsValid) { data.RunWithTry((resultData) => { if (string.IsNullOrEmpty(model.Membership)) { model.Membership = Site.AsActual().Membership; } var options = model.ToCreateSiteOptions(); options.UserName = User.Identity.Name; var createdSite = Kooboo.CMS.Sites.Services.ServiceFactory.SiteManager.Copy(Site, model.Name, options); resultData.RedirectUrl = Url.Action("SiteMap", new { controller = "Home", siteName = createdSite.FullName }); }); } return Json(data); }
public ActionResult Copy() { CopySiteModel model = new CopySiteModel() { Parent = Site.Parent == null ? "" : Site.Parent.FullName }; return View(model); }
public ActionResult Copy(CopySiteModel model) { var data = new JsonResultData(ViewData.ModelState); if (ModelState.IsValid) { data.RunWithTry((resultData) => { var createdSite = Kooboo.CMS.Sites.Services.ServiceFactory.SiteManager.Copy(Site, model.Name, model.Repository); resultData.RedirectUrl = Url.Action("SiteMap", new { controller = "Home", siteName = createdSite.FullName }); }); } return Json(data); }