public LinkToSite(Guid guid, string desc, string ImageURI, TypeLink typeLink) : base(desc) { Id = guid; this.ImageURI = ImageURI; TypeLink = typeLink; }
public static string getLinkDefault(int id, TypeLink typeLink) { CNTTDHXDEntities _cnttDB = new CNTTDHXDEntities(); string rs = ""; switch((int) typeLink){ case (int)TypeLink.tintuc : gov_news newInfo = _cnttDB.gov_news.Find(id); if (newInfo != null) { rs = "/new/" + ConvertToUnSign(newInfo.gov_menu.title) + "/" + ConvertToUnSign(newInfo.title) + "-" + id.ToString(); } break; case (int)TypeLink.danhmuc: gov_menu menuInfo = _cnttDB.gov_menu.Find(id); if (menuInfo != null) { rs = "/chanel/" + ConvertToUnSign(menuInfo.title) + "-" + id.ToString(); } break; case (int)TypeLink.album: gov_album albumInfo = _cnttDB.gov_album.Find(id); if (albumInfo != null) { rs = "/album/" + ConvertToUnSign(albumInfo.album_title) + "-" + id.ToString(); } break; case (int)TypeLink.video: gov_video videoInfo = _cnttDB.gov_video.Find(id); if (videoInfo != null) { rs = "/video/" + ConvertToUnSign(videoInfo.title) + "-" + id.ToString(); } break; } return rs; }
public ActionResult GetLinkHeader(TypeLink type) { var link = dbContext.LinkHeaders.Where(x => x.Type == type).ToList(); return Json(link, JsonRequestBehavior.AllowGet); }