public void Add(SEOToolUpdate seoToolUpdate)
 {
     var seoTool = new SEOTool
       {
           FocusKeyword = seoToolUpdate.FocusKeyword,
           MetaDescription = seoToolUpdate.MetaDescription,
           SEOTitle = seoToolUpdate.SEOTitle
       };
     _seoToolRepo.Add(seoTool);
 }
        public ActionResult SubCategoryTours(string permalink, string subpermalink)
        {
            Category _category = _categoryQueryService.All().Where(v => v.Permalink == permalink).First();
            Session["Category"] = _category;
            var experiences = _experienceQueryService.Experiences(permalink);

            var subcategory = _category.SubCategories.Where(p => p.Permalink == subpermalink).ToList();
            var tours = subcategory.FirstOrDefault().Tours.ToList();

            SEOTool SEOTool = new SEOTool();

            if (_category.SEOTools != null && _category.SEOTools.Count > 0)
                SEOTool = _category.SEOTools.First();

            ViewBag.FocusKeyword = SEOTool.FocusKeyword;
            ViewBag.MetaDescription = SEOTool.MetaDescription;
            ViewBag.Title = SEOTool.SEOTitle;

            TempData["Info"] = _category;

            return View(new ExperiencesIndex
            {
                Count = experiences.Count(),
                CategoryName = _category.Name,
                CategoryPermalink = _category.Permalink,
                Experiences = Mapper.Map<List<ExperiencesIndexItem>>(experiences),
                subcategory = subcategory,
                Tours = tours
            });
        }
        public ActionResult Show(string permalink)
        {
            try
            {
                var perspectiveposts = _perspectiveService.PostByTour(permalink);
                var tour = _tourService.FindByPermalink(permalink);

                if (tour == null || !tour.IsPublished)
                    return HttpNotFound();
                int OrganizationId = UserContext.Organization.Id;
                var tourShow = PopulateTourShow(tour, OrganizationId);

                SEOTool SEOTool = new SEOTool();

                if (tour.SEOTools != null && tour.SEOTools.Count > 0)
                    SEOTool = tour.SEOTools.First();

                ViewBag.FocusKeyword = SEOTool.FocusKeyword;
                ViewBag.MetaDescription = SEOTool.MetaDescription;
                ViewBag.Title = SEOTool.SEOTitle;

                tourShow.PerspectivePosts = perspectiveposts.OrderByDescending(m => m.UpdatedAt).Take(2).ToList();

                return TourView(tourShow);
            }
            catch (Exception e)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(e);
                return HttpNotFound();
            }
        }
        public ActionResult Show(string permalink)
        {
            var giftcards=new GiftCardsIndex();
            try
            {

                var giftcard = _giftCardService.FindByPermalink(permalink);
                if (giftcard == null || !giftcard.IsPublished)
                    return HttpNotFound();

                var giftCardShow = Mapper.Map<GiftCardShow>(giftcard);

                giftCardShow.Color = TempData["color"].ToString();

                SEOTool SEOTool = new SEOTool();

                if (giftcard.SEOTools != null && giftcard.SEOTools.Count > 0)
                    SEOTool = giftcard.SEOTools.First();

                ViewBag.FocusKeyword = SEOTool.FocusKeyword;
                ViewBag.MetaDescription = SEOTool.MetaDescription;
                ViewBag.Title = SEOTool.SEOTitle;

                return View("show",giftCardShow);

            }
            catch (Exception e)
            {
                Elmah.ErrorSignal.FromCurrentContext().Raise(e);
                return HttpNotFound();
            }
        }
        public ActionResult PerspectivePost(LatestPerspectivePost latestPerspectivePost, int Id, string TourPermalink, string PerspectivePermalink)
        {
            if (ModelState.IsValid)
            {
                // var commentUpdate = Mapper.Map<CommentUpdate>(latestPerspectivePost.Comment);

                CommentUpdate commentUpdate = new CommentUpdate();
                commentUpdate.Name = latestPerspectivePost.Name;
                commentUpdate.Email = latestPerspectivePost.Email;
                commentUpdate.Content = latestPerspectivePost.Content;
                commentUpdate.PerspectivePostId = Id;
                commentUpdate.IsApproved = true;
                commentUpdate.PostedOn = DateTime.Now;

                _commentCommandService.Add(commentUpdate);
                //TempData["CommentSuccess"] = "Comment created successfully.";
                return RedirectToRoute("perspective-post", new { tourpermalink = TourPermalink, permalink = PerspectivePermalink });
            }

            var post = _perspectiveService.FindPerspectivePost(PerspectivePermalink);
            var allTours = _perspectiveService.AllTours().ToList();

            SEOTool SEOTool = new SEOTool();

            if (post != null && post.FirstOrDefault() != null && post.First().SEOTools != null && post.First().SEOTools.Count > 0)
                SEOTool = post.First().SEOTools.First();

            ViewBag.FocusKeyword = SEOTool.FocusKeyword;
            ViewBag.MetaDescription = SEOTool.MetaDescription;
            ViewBag.SEOTitle = SEOTool.SEOTitle;

            latestPerspectivePost.FocusKeyword = SEOTool.FocusKeyword;
            latestPerspectivePost.MetaDescription = SEOTool.MetaDescription;
            latestPerspectivePost.SEOTitle = SEOTool.SEOTitle;

            latestPerspectivePost.PerspectivePosts = post.ToList();
            latestPerspectivePost.selectedtourpermalink = TourPermalink;
            latestPerspectivePost.Tours = allTours;

            return View(latestPerspectivePost);
        }
        public ActionResult PerspectivePost(string tourpermalink, string permalink)
        {
            var post = _perspectiveService.FindPerspectivePost(permalink);
            var allTours = _perspectiveService.AllTours().ToList();

            SEOTool SEOTool = new SEOTool();

            if (post != null && post.FirstOrDefault() != null && post.First().SEOTools != null && post.First().SEOTools.Count > 0)
                SEOTool = post.First().SEOTools.First();

            ViewBag.FocusKeyword = SEOTool.FocusKeyword;
            ViewBag.MetaDescription = SEOTool.MetaDescription;
            ViewBag.Title = SEOTool.SEOTitle;

            return View(new LatestPerspectivePost
            {
                PerspectivePosts = post.ToList(),
                selectedtourpermalink = tourpermalink,
                Tours = allTours,
                FocusKeyword = SEOTool.FocusKeyword,
                MetaDescription = SEOTool.MetaDescription,
                SEOTitle = SEOTool.SEOTitle
                //Comment = new Models.Comments.CommentEdit()
            });
        }