public ActionResult GetSlogan(int menuId) { var staticContent = _staticContentService.Get(x => x.Id == menuId, true); if (staticContent == null) { return(HttpNotFound()); } var staticContentLocalized = staticContent.ToModel(); return(PartialView(staticContentLocalized)); }
public ActionResult GetStaticContent(int menuId, string virtualId, string title) { var breadCrumbs = new List <BreadCrumb>(); var virtualIds = virtualId.Split('/'); for (var i = 0; i < virtualIds.Length; i++) { var str = virtualIds[i]; var menuLink = _menuLinkService.GetByParentId(menuId, str); if (menuLink != null) { breadCrumbs.Add(new BreadCrumb { Title = menuLink.GetLocalized(x => x.MenuName, menuLink.Id), Current = false, Url = Url.Action("GetContent", "Menu", new { area = "", menu = menuLink.SeoUrl }) }); } } breadCrumbs.Add(new BreadCrumb { Current = true, Title = title }); ViewBag.BreadCrumb = breadCrumbs; var staticContent = _staticContentService.Get(x => x.MenuId == menuId, true); if (staticContent != null) { staticContent = staticContent.ToModel(); var viewCount = staticContent; viewCount.ViewCount = viewCount.ViewCount + 1; _staticContentService.Update(staticContent); //Lấy bannerId từ post để hiển thị banner trên post ViewBag.BannerId = staticContent.MenuId; ViewBag.Title = staticContent.Title; } ViewBag.MenuId = menuId; return(PartialView(staticContent)); }
public JsonResult GetIntro(int menuId) { var staticContent = _staticContentService.Get(x => x.Id == menuId, true); var staticContentLocalized = staticContent.ToModel(); var jsonResult = Json(new { success = true, list = this.RenderRazorViewToString("_Footer.Intro", staticContentLocalized) }, JsonRequestBehavior.AllowGet); return(jsonResult); }