public ActionResult Sites() { SiteListModel listOfSites = new SiteListModel(); listOfSites.Sites = siteModule.GetSitesByUser(Session.User); listOfSites.Session = Session; ViewData.Model = listOfSites; return View("SitesNew"); }
public ActionResult Sites(SiteListModel model) { if (ModelState.IsValid) { var site = new Site() {Domain = model.SiteModel.Domain, ContainsSubdomains = model.SiteModel.IgnoreSubdomains }; siteModule.CreateSite(Session.User, site); model.SiteModel.Domain = string.Empty; return Redirect(Url.Sites()); } return Sites(); }
public ActionResult EditSite(SiteListModel model) { if (Session.User != null) { siteModule.EditDomain( new Site() { Id = model.SiteModel.Id, UserId = Session.User.Id, Domain = model.SiteModel.Domain, ContainsSubdomains = model.SiteModel.IgnoreSubdomains }); return Redirect(Url.Sites()); } else { return Redirect(Url.Logon()); } }