Ejemplo n.º 1
0
        public ActionResult Get(int id)
        {
            //var efFaqs = _faqRepository.GetAllWithQuestionAnswer().ToList();
            var faqlist   = _faqRepository.GetAll();
            var faqSingle = _faqRepository.Get(id);

            Models.Faq.FaqViewModel model = new Models.Faq.FaqViewModel();
            model.AllFaq = faqlist;
            if (faqSingle != null)
            {
                model.CurrentFaq = faqSingle;
            }
            else
            {
                model.CurrentFaq = new Entity.FAQ();
            }
            List <BreadCrumbViewModel> breadcrumbs = new List <BreadCrumbViewModel>();

            breadcrumbs.Add(new BreadCrumbViewModel()
            {
                Link        = "/faq",
                FriendlyUrl = string.Format("/{0}", new GlobalOptionRepository().Get(Common.Constant.KeyFaq).OptionContent),
                Title       = "Актуальные вопросы"
            });
            breadcrumbs.Add(new BreadCrumbViewModel()
            {
                Title = model.CurrentFaq.Title
            });
            ViewBag.BredCrumbs = breadcrumbs;

            ViewBag.MetaTitle   = model.CurrentFaq.Title;
            ViewBag.MetaTitle   = model.CurrentFaq.Seo != null ? model.CurrentFaq.Seo.MetaTitle : model.CurrentFaq.Title;
            ViewBag.Keywords    = model.CurrentFaq.Seo != null ? model.CurrentFaq.Seo.MetaKeywords : null;
            ViewBag.Description = model.CurrentFaq.Seo != null ? model.CurrentFaq.Seo.MetaDescription : null;
            return(View("Index", model));
        }
Ejemplo n.º 2
0
        // GET: FAQ
        public ActionResult Index()
        {
            List <BreadCrumbViewModel> breadcrumbs = new List <BreadCrumbViewModel>();

            breadcrumbs.Add(new BreadCrumbViewModel()
            {
                Title = "Актуальные вопросы"
            });
            ViewBag.BredCrumbs = breadcrumbs;


            var faqlist = _faqRepository.GetAll();

            Models.Faq.FaqViewModel model = new Models.Faq.FaqViewModel();
            model.AllFaq = faqlist;

            if (model.CurrentFaq == null)
            {
                model.CurrentFaq = new Entity.FAQ();
            }

            ViewBag.MetaTitle = "Актуальные вопросы";
            return(View(model));
        }