public ArticlesViewModel(string keyword, string practice, string contributor, string country, string city, string page, List <City> cities, List <Country> countries) { this.FoundArticles = ArticleCore.GetFilteredArticles(keyword, practice, contributor, country, city, page); this.RelatedContributors = ContributorCore.GetContributorsById(FoundArticles.Select(x => x.ContributorID).ToList()); this.RelatedAreas = PracticeAreaCore.GetPracticeAreasById(FoundArticles.Select(x => x.PracticeAreaID).ToList()); this.Cities = cities; this.Countries = countries; this.Keyword = keyword; }
public IActionResult AddPracticeArea(string id) { if (!string.IsNullOrEmpty(id)) { PracticeArea practiceArea = PracticeAreaCore.GetPracticeAreasById(id); if (practiceArea != null) { return(View(new PracticeAreaAddEditModel(practiceArea))); } } return(View(new PracticeAreaAddEditModel())); }
public IActionResult AddArticle(string id) { if (!string.IsNullOrEmpty(id)) { Article article = ArticleCore.GetArticleByArticleId(id); if (article != null) { Contributor contributor = ContributorCore.GetContributorsById(article.ContributorID); PracticeArea practiceArea = PracticeAreaCore.GetPracticeAreasById(article.PracticeAreaID); List <ArticlePiece> pieces = ArticleCore.GetArticlePiecesByArticleId(article.ID); return(View(new ArticleAddEditModel(article, pieces, contributor, practiceArea))); } } return(View(new ArticleAddEditModel())); }