Пример #1
0
        public async Task <ActionResult> Index(SEOViewModel model)
        {
            // Call a business logic to check and process the input
            try
            {
                // Proceed if only the model is valid
                if (ModelState.IsValid)
                {
                    var directTextOption = model.UserInputModel.AnalysisOptions.Where(x => x.Value == "DirectText").FirstOrDefault();
                    if (directTextOption != null && directTextOption.Selected == true)
                    {
                        // Call a Text Processor
                        gProcessor        = new TextProcessor(new LinkExtractor(), new HtmlExtractor(), new MetaExtractor());
                        model.ResultModel = await gProcessor.ProcessInput(model);

                        //model.ResultModel = gProcessor
                    }
                    else
                    {
                        // Call a Url Processor
                        gProcessor        = new UrlProcessor(new LinkExtractor(), new HtmlExtractor(), new MetaExtractor());
                        model.ResultModel = await gProcessor.ProcessInput(model);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }


            return(View(model));
        }
        public ActionResult Create(SEOViewModel viewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var entity = Mapper.Map <SEOViewModel, SEO>(viewModel);

                    _seoService.Insert(entity);

                    viewModel.Locales.ToList().ForEach(l =>
                    {
                        _localizedEntityService.SaveLocalizedValue(entity, e => e.Description, l.Description, l.LanguageId);
                        _localizedEntityService.SaveLocalizedValue(entity, e => e.Keywords, l.Keywords, l.LanguageId);
                    });

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
            }

            viewModel.SEOKeysSelectList = GetSelectListForKeys();

            return(View(viewModel));
        }
Пример #3
0
        public ActionResult Index()
        {
            ISEOViewModel model = new SEOViewModel(new UserInputModel(), new ResultModel());

            model.UserInputModel = new UserInputModel(new AnalysisOptions());
            //model.ResultModel = new ResultModel();
            return(View(model));
        }
        // GET: Admin/SEO/Create
        public ActionResult Create()
        {
            var viewModel = new SEOViewModel();

            viewModel.SEOKeysSelectList = GetSelectListForKeys();

            AddLocales(viewModel.Locales, (locale, languageId) => { });

            return(View(viewModel));
        }
Пример #5
0
        public ActionResult Services()
        {
            SEOViewModel viewModel = new SEOViewModel
            {
                Description = "Bridge Books LLC provides accounting, bookkeeping, payroll, and financial consulting services.",
                Canonical   = "/services"
            };

            return(View(viewModel));
        }
Пример #6
0
        public ActionResult OurTeam()
        {
            SEOViewModel viewModel = new SEOViewModel
            {
                Description = "Bridge Books LLC has over 38 combined years experience in the financial and accounting industy.",
                Canonical   = "/ourteam"
            };

            return(View(viewModel));
        }
Пример #7
0
        public ActionResult Index()
        {
            SEOViewModel viewModel = new SEOViewModel
            {
                Description = "Bridge Books LLC specializes in small business and non-profit accounting.",
                Canonical   = "/"
            };

            return(View(viewModel));
        }
Пример #8
0
        //AJAX: Admin/Blog/SEO/<PostSerial>
        public ActionResult SEO(Guid id)
        {
            ContentPage page = new ContentPage(id);
            SEO         seo  = page.seo;

            ViewBag.TypeOG    = seo.GetOGOptions(seo.ogType);
            ViewBag.PostURL   = "/admin/pages/seo";
            ViewBag.ImageBase = "/blog";
            SEOViewModel seoViewModel = new SEOViewModel(seo);

            return(PartialView("_SEO", seoViewModel));
        }
        public ActionResult Delete(SEOViewModel viewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var entity = Mapper.Map <SEOViewModel, SEO>(viewModel);

                    _seoService.Delete(entity);

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("", e.Message);
            }

            return(View(viewModel));
        }
Пример #10
0
        //AJAX: Admin/Listing/SEO/<ListingSerial>
        public ActionResult SEO(int id)
        {
            News news = new News(id);
            SEO  seo  = news.seo;

            ViewBag.TypeOG    = seo.GetOGOptions(seo.ogType);
            ViewBag.PostURL   = "/admin/contentnews/updateseo/" + news.NewsSerial;
            ViewBag.ImageBase = "/img/listing";
            SEOViewModel seoViewModel = new SEOViewModel(seo);

            if (string.IsNullOrEmpty(seoViewModel.MetaTitle))
            {
                seoViewModel.MetaTitle = news.Headline;
            }
            if (string.IsNullOrEmpty(seoViewModel.MetaDescription))
            {
                seoViewModel.MetaDescription = news.ShortDescription;
            }
            return(PartialView("_SEO", seoViewModel));
        }
Пример #11
0
        //AJAX: Admin/Blog/SEO/<PostSerial>
        public ActionResult SEO(int id)
        {
            BlogPost blogPost = new BlogPost(id);
            SEO      seo      = blogPost.seo;

            ViewBag.TypeOG    = seo.GetOGOptions(seo.ogType);
            ViewBag.PostURL   = "/admin/blog/seo";
            ViewBag.ImageBase = "/blog";
            SEOViewModel seoViewModel = new SEOViewModel(seo);

            if (string.IsNullOrEmpty(seoViewModel.MetaTitle))
            {
                seoViewModel.MetaTitle = blogPost.Title;
            }
            if (string.IsNullOrEmpty(seoViewModel.MetaDescription))
            {
                seoViewModel.MetaDescription = blogPost.Description;
            }

            return(PartialView("_SEO", seoViewModel));
        }
Пример #12
0
        public JsonResult SEO(SEOViewModel data)
        {
            //TODO: look into image uploads.
            //TODO: Look into sizing images
            //TODO: Show image samples
            BlogPost blogPost = new BlogPost(data.EntityID);
            SEO      seo      = blogPost.seo;

            seo.gDescription       = data.gDescription;
            seo.gImage             = data.gImage;
            seo.gName              = data.gName;
            seo.MetaDescription    = data.MetaDescription;
            seo.MetaKeywords       = data.MetaKeywords;
            seo.MetaTitle          = data.MetaTitle;
            seo.ogDescription      = data.ogDescription;
            seo.ogImage            = data.ogImage;
            seo.ogTitle            = data.ogTitle;
            seo.ogType             = data.ogType;
            seo.twitterDescription = data.twitterDescription;
            seo.twitterImage       = data.twitterImage;
            seo.twitterTitle       = data.twitterTitle;

            return(Json(true));
        }
Пример #13
0
        public ActionResult UpdateSEO(int id, SEOViewModel data)
        {
            //TODO: look into image uploads.
            //TODO: Look into sizing images
            //TODO: Show image samples
            News news = new News(id);
            SEO  seo  = new SEO(news.NewsID);

            seo.gDescription       = data.gDescription;
            seo.gImage             = data.gImage;
            seo.gName              = data.gName;
            seo.MetaDescription    = data.MetaDescription;
            seo.MetaKeywords       = data.MetaKeywords;
            seo.MetaTitle          = data.MetaTitle;
            seo.ogDescription      = data.ogDescription;
            seo.ogImage            = data.ogImage;
            seo.ogTitle            = data.ogTitle;
            seo.ogType             = data.ogType;
            seo.twitterDescription = data.twitterDescription;
            seo.twitterImage       = data.twitterImage;
            seo.twitterTitle       = data.twitterTitle;

            return(Json(true));
        }