public ActionResult SearchArticle(string keyword = "") { keyword = keyword.Trim(); Title = "Kết quả tìm kiếm với từ khóa '" + keyword + "' - Chăm sóc Khách hàng - Hangtot.com "; MetaDescription = "Trung tâm trợ giúp, chăm sóc Khách hàng - Tìm kiếm trợ giúp - Sàn giao dịch Thương mại điện tử Hangtot.com"; if (!string.IsNullOrEmpty(keyword.Trim())) { var lstHelpSearch = _helpArticleService.SearchHelpArticleByTitle(keyword).ToList(); var listHelpArticle = new List <HelpArticleSearchModel>(); ViewBag.KeyWord = keyword; if (lstHelpSearch != null && lstHelpSearch.Count > 0) { foreach (HelpArticle article in lstHelpSearch) { var helpArticleSearchModel = new HelpArticleSearchModel(); helpArticleSearchModel.Article = article; helpArticleSearchModel.ListHelpCategories = HelpHelper.GetBreadCrumb(article.CategoryId); listHelpArticle.Add(helpArticleSearchModel); } } ViewData["DataBreadcrumb"] = new HelpArticleSearchModel { ListHelpCategories = new List <HelpCategory>(), Article = null }; ViewData["currentCateId"] = 0; return(View(listHelpArticle)); } return(RedirectToAction("Index")); }
public ActionResult Index() { var lstArticle = _helpArticleService.GetAllHelpArticle(1, 14); Title = "Chăm sóc Khách hàng - Hangtot.com "; MetaDescription = "Trung tâm trợ giúp, chăm sóc Khách hàng - Hướng dẫn sử dụng, quy định, FAQ - Sàn giao dịch Thương mại điện tử Hangtot.com"; ViewData["DataBreadcrumb"] = new HelpArticleSearchModel { ListHelpCategories = new List <HelpCategory>(), Article = null }; ViewData["currentCateId"] = 0; return(View(lstArticle)); }
public ActionResult ListHelpArticlesByCate(int categoryId) { var helpCategory = _helpCategoryService.GetHelpCategoryById(categoryId); if (helpCategory == null || helpCategory.Status == HelpCategoryStatusConst.InActive) { return(RedirectToAction("Index")); } var helpCategoryModel = helpCategory.ToModel(); if (!helpCategory.HasChild) { helpCategoryModel.ListHelpArticle = _helpArticleService.GetHelpArticleByCateId(categoryId, 1, 1000).ToList(); //viet lai method } else { var helpCategories = _helpCategoryService.GetAllHelpCategoryByParentId(categoryId); var listHelpCates = new List <HelpCategoryModel>(); foreach (var helpCate in helpCategories) { if (helpCate.Status == HelpCategoryStatusConst.Active) { var helpCateModel = helpCate.ToModel(); helpCateModel.ListHelpArticle = _helpArticleService.GetHelpArticleByCateId(helpCate.Id, 1, 5).ToList(); listHelpCates.Add(helpCateModel); } } helpCategoryModel.SubCategory = listHelpCates; } ViewData["DataBreadcrumb"] = new HelpArticleSearchModel { ListHelpCategories = HelpHelper.GetBreadCrumb(categoryId), Article = null }; ViewData["currentCateId"] = categoryId; Title = helpCategoryModel.Name + " - Chăm sóc Khách hàng - Hangtot.com "; MetaDescription = "Trung tâm trợ giúp, chăm sóc Khách hàng - " + helpCategoryModel.Name + " - Sàn giao dịch Thương mại điện tử Hangtot.com"; return(View(helpCategoryModel)); }
// // GET: /Help/Details/5 public ActionResult Details(int id, int?categoryId, string alias) { var helpArticle = _helpArticleService.GetHelpArticleById(id); if (helpArticle == null || helpArticle.Status == HelpArticleStatusConst.InActive) { //ErrorNotification("Không tìm thấy bài viết nào thỏa mãn"); return(RedirectToAction("Index", "Helps")); } if (categoryId == null || !helpArticle.AliasTitle.Equals(alias, StringComparison.InvariantCultureIgnoreCase) || categoryId != helpArticle.CategoryId) { return(RedirectToActionPermanent("Details", new { id = id, categoryId = helpArticle.CategoryId, alias = helpArticle.AliasTitle })); } var title = helpArticle.Title; var helpCategory = _helpCategoryService.GetHelpCategoryById((int)categoryId); if (helpCategory != null) { title += " - " + helpCategory.Name; } Title = title + " - Trung tâm trợ giúp, chăm sóc Khách hàng - Hangtot.com"; CanonicalLink = FalconConfig.DomainName + Url.Action("Details", new { id = id, title = helpArticle.AliasTitle }); MetaKeyword = helpArticle.MetaKeyword + "," + MetaKeyword; MetaDescription = helpArticle.MetaDescription; var model = new HelpArticleDetailModel() { Article = helpArticle, OtherArticles = _helpArticleService.GetHelpArticleByCateId((int)categoryId, 1, 500).Where(a => a.Id != id).ToList() }; ViewData["DataBreadcrumb"] = new HelpArticleSearchModel { ListHelpCategories = HelpHelper.GetBreadCrumb(helpArticle.CategoryId), Article = helpArticle }; ViewData["currentCateId"] = helpArticle.CategoryId; return(View(model)); }