public ThreadFormModel(IEnumerable<Category> availableCategories) { AvailableCategories = availableCategories; AvailableCategoriesItems = CategoryHelper.GetCategoryListItems(availableCategories, Resources.Thread.SelectCategory); ThreadForm = new ThreadForm(); if(ThreadForm.TemporaryAttachmentFolder == null) ThreadForm.GenerateTemporaryAttachmentFolder(); }
public virtual ActionResult QuestionListSeo(int keywordId, string title) { var keyword = Repository.SEOKeyword.Get(keywordId); PresetSeoKeyword(keyword); var threads = Repository.Thread.FindClosestMatches(keyword.Category, keyword.CategoryAttributes, PagerHelper.SeoSimiliarThreadsLimit, t => t.BySanitizationStatus(ThreadSanitizationStatus.Sanitized).ByInnerStatus(false)); var experts = Repository.Expert.FindClosestMatches(keyword.Category.Id, keyword.CategoryAttributes, PagerHelper.SimiliarExpertsListSize); var form = new ThreadForm() { Content = keyword.Phrase, CategoryId = keyword.Category.Id, AttributeValues = CategoryAttributeHelper.GetCategoryAttributeValueModel(keyword.CategoryAttributes), SeoKeywordId = keywordId }; form.GenerateTemporaryAttachmentFolder(); var seo = new SeoDetails() { Id = keyword.Id, Phrase = keyword.Phrase, Category = keyword.Category, Type = keyword.Type, Status = keyword.Status }; var categories = new List<Category>(); categories.Add(keyword.Category); var model = new ThreadDetailsSeo() { SeoDetails = seo, ThreadForm = form, Threads = threads, Experts = experts, AvailableCategories = categories }; ViewBag.PageTitle = model.SeoDetails.Phrase; return View(model); }
public virtual ActionResult ExpertListSeo(int keywordId, string title) { var keyword = Repository.SEOKeyword.Get(keywordId); PresetSeoKeyword(keyword); var experts = Repository.Expert.FindClosestMatches(keyword.Category.Id, keyword.CategoryAttributes, PagerHelper.SeoSimiliarExpertsLimit); var form = new ThreadForm() { CategoryId = keyword.Category.Id, AttributeValues = CategoryAttributeHelper.GetCategoryAttributeValueModel(keyword.CategoryAttributes), SeoKeywordId = keywordId }; form.GenerateTemporaryAttachmentFolder(); var seo = new SeoDetails() { Id = keyword.Id, Phrase = keyword.Phrase, Category = keyword.Category, Type = keyword.Type, Status = keyword.Status }; var categories = new List<Category>(); categories.Add(keyword.Category); var model = new ThreadDetailsSeo(Repository.Category.All()) { SeoDetails = seo, Experts = experts, ThreadForm = form, AvailableCategories = categories }; ViewBag.PageTitle = model.SeoDetails.Phrase; return View(model); }