예제 #1
0
        public ActionResult Sites()
        {
            SiteListModel listOfSites = new SiteListModel();
            listOfSites.Sites = siteModule.GetSitesByUser(Session.User);
            listOfSites.Session = Session;
            ViewData.Model = listOfSites;

            return View("SitesNew");
        }
예제 #2
0
        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();
        }
예제 #3
0
 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());
     }
 }