Example #1
0
        public ActionResult Faq(Guid categoryId)
        {
            FaqCategory          category;
            List <FaqTableModel> faq = null;

            using (ContextManager.NewConnection())
            {
                category = faqService.GetFaqCategory(categoryId, false);
                if (category != null)
                {
                    faq = faqService.Search(new FaqQueryModel {
                        Category = new Nomenclature {
                            Id = categoryId
                        }, Status = EnumHelper.GetFaqStatus(FaqStatus.Public).Value
                    });
                }
            }

            if (category == null)
            {
                throw new UserException(Resource.NoDataFound);
            }

            ViewBag.CategoryId = categoryId;

            this.InitViewTitleAndBreadcrumbs(category.Names.GetValueForCurrentCulture(), new[] { new Breadcrumb {
                                                                                                     Title = Resource.FAQ
                                                                                                 } });
            return(View("Faq", faq));
        }
        public ActionResult UpsertCategory(Guid?id)
        {
            var model = new FaqCategoryViewModel();

            if (id.HasValue)
            {
                using (ContextManager.NewConnection())
                {
                    model = Mapper.Map <FaqCategoryViewModel>(faqService.GetFaqCategory(id.Value, true));
                }
            }

            return(PartialView(model));
        }