public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
 {
     List<DynamicNode> returnValue = null;
     var cache = DataCache.Cache;
     string cacheKey = "SMAPCELEB:O:00";
     returnValue = (List<DynamicNode>)cache[cacheKey];
     // Build value 
     if (returnValue == null)
     {
         try
         {
             returnValue = new List<DynamicNode>();
             var context = new IPTV2_Model.IPTV2Entities();
             // Create a node for each celebrity 
             var celebs = context.Celebrities.ToList();
             foreach (var celeb in celebs)
             {
                 DynamicNode node = new DynamicNode();
                 node.Key = "Celebrity-" + celeb.CelebrityId;
                 node.Title = "Celebrity - " + celeb.FullName;
                 //node.Controller = "Celebrity";
                 //node.Action = "Profile";
                 node.RouteValues.Add("id", celeb.CelebrityId);
                 returnValue.Add(node);
             }
             var cacheDuration = new TimeSpan(2, 0, 0);
             cache.Put(cacheKey, returnValue, cacheDuration);
         }
         catch (Exception) { returnValue = new List<DynamicNode>(); }
     }
     // Return 
     return returnValue;
 }
        /// <summary>
        /// Gets the dynamic node collection.
        /// </summary>
        /// <returns>
        /// A dynamic node collection represented as a <see cref="IEnumerable&lt;MvcSiteMapProvider.Extensibility.DynamicNode&gt;"/> instance 
        /// </returns>
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            // Create a node for each genre
            foreach (var genre in storeDB.Genres)
            {
                DynamicNode node = new DynamicNode("Genre_" + genre.Name, genre.Name);
                node.RouteValues.Add("genre", genre.Name);

                yield return node;
            }
        }
Example #3
0
 public override IEnumerable<DynamicNode> GetDynamicNodeCollection( )
 {
     var returnValue = new List<DynamicNode>();
     var news = DependencyResolver.Current.GetService<INewsService>().GetCategories();
     foreach (var article in news) {
         DynamicNode node = new DynamicNode();
         node.Title = article.Name;
         node.RouteValues.Add("id", article.ID);
         returnValue.Add(node);
     }
     return returnValue;
 }
Example #4
0
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            List<DynamicNode> returnValue = null;
            var cache = DataCache.Cache;
            string cacheKey = "SMAPSHOW:O:00";
            returnValue = (List<DynamicNode>)cache[cacheKey];
            // Build value
            if (returnValue == null)
            {
                try
                {
                    returnValue = new List<DynamicNode>();
                    var context = new IPTV2_Model.IPTV2Entities();
                    var service = context.PackageTypes.Find(GlobalConfig.serviceId);
                    var showIds = service.GetAllIptvShowIds("US");
                    // Create a node for each show
                    foreach (var i in showIds)
                    {
                        var show = (IPTV2_Model.Show)context.CategoryClasses.Find(i);
                        DynamicNode node = new DynamicNode();
                        node.Key = "Show-" + show.CategoryId;
                        node.Title = "Show - " + show.CategoryName;
                        node.Controller = "Show";
                        node.Action = "Details";
                        node.RouteValues.Add("id", show.CategoryId);
                        var dbSlug = MyUtility.GetSlug(show.Description);
                        node.RouteValues.Add("slug", dbSlug);
                        returnValue.Add(node);

                        //// get episodes of show
                        //foreach (var episode in show.Episodes.Where(e => e.Episode.OnlineStatusId == 1))
                        //{
                        //    DynamicNode episodeNode = new DynamicNode();
                        //    episodeNode.Key = "Episodes-" + episode.Episode.EpisodeId;
                        //    episodeNode.Title = "Episode - " + episode.Episode.EpisodeName;
                        //    episodeNode.Controller = "Episode";
                        //    episodeNode.Action = "Details";
                        //    episodeNode.ParentKey = node.Key;
                        //    episodeNode.RouteValues.Add("id", episode.Episode.EpisodeId);
                        //    returnValue.Add(episodeNode);
                        //}                   
                    }
                    var cacheDuration = new TimeSpan(2, 0, 0);
                    cache.Put(cacheKey, returnValue, cacheDuration);
                }
                catch (Exception) { returnValue = new List<DynamicNode>(); }

            }
            // Return
            return returnValue;
        }
        /// <summary>
        /// Gets the dynamic node collection.
        /// </summary>
        /// <returns>
        /// A dynamic node collection represented as a <see cref="IEnumerable&lt;MvcSiteMapProvider.Extensibility.DynamicNode&gt;"/> instance 
        /// </returns>
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            // Create a node for each localisation
            var locs = LocalisationRepository.GetAll();
            foreach (var loc in locs)
            {
                DynamicNode node = new DynamicNode("Id_" + loc.ID.ToString(), loc.Name);
                node.RouteValues.Add("culture", "fr");
                node.RouteValues.Add("id", loc.ID);
                node.RouteValues.Add("name", MiscHelpers.GetSeoString(loc.Name));
                node.RouteValues.Add("type", Localisation.GetLocalisationSeoType(loc.TypeValue));

                yield return node;
            }
        }
Example #6
0
 public override IEnumerable<DynamicNode> GetDynamicNodeCollection( )
 {
     var returnValue = new List<DynamicNode>();
     var news = DependencyResolver.Current.GetService<IArticleService>().GetArticles();
     foreach (var article in news) {
         DynamicNode node = new DynamicNode();
         node.Title = article.Title;
         node.RouteValues.Add("id", article.ID);
         if (!string.IsNullOrEmpty(article.Path)) {
             node.RouteValues.Add("path", article.Path);
         }
         returnValue.Add(node);
     }
     return returnValue;
 }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            var nodes = new List<DynamicNode>();
            IDs.Add("1");
            IDs.Add("2");
            IDs.Add("3");
            foreach (var id in IDs)
            {
                DynamicNode node = new DynamicNode();
                node.RouteValues.Add("id", id);
                node.Title = node.Title + id;
                nodes.Add(node);
            }

            return nodes;
        }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            using (var dataContext = new RiftDataDataContext())
            {
                var nodes = new List<DynamicNode>();

                dataContext.Fish.ToList().ForEach(t =>
                    {
                        var node = new DynamicNode { Controller = "Fish", Title = t.Name, Action = "Index" };

                        node.RouteValues.Add("fishName", t.UrlName);

                        nodes.Add(node);
                    });
                return nodes;
            }
        }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            using (var dataContext = new RiftDataDataContext())
            {
                var nodes = new List<DynamicNode>();

                dataContext.GenusTypes.ToList().ForEach(t =>
                {
                    var node = new DynamicNode { Controller = "GenusTypes", Title = t.Name, Action = "Index", Area = "Mobile"};

                    node.RouteValues.Add("genusTypeName", t.Name);

                    nodes.Add(node);
                });
                return nodes;
            }
        }
        /// <summary>
        /// Gets the dynamic node collection.
        /// </summary>
        /// <returns>
        /// A dynamic node collection represented.
        /// </returns>
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            // Create a node for each album
            foreach (var album in storeDB.Albums.Include("Genre"))
            {
                DynamicNode node = new DynamicNode();
                node.Title = album.Title;
                node.ParentKey = "Genre_" + album.Genre.Name;
                node.RouteValues.Add("id", album.AlbumId);

                if (album.Title.Contains("Hit") || album.Title.Contains("Best"))
                {
                    node.Attributes.Add("bling", "<span style=\"color: Red;\">hot!</span>");
                }

                yield return node;
            }
        }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            var returnValue = new List<DynamicNode>();

            // fix for not being about to get ninject to worj with DynamicNodeProviderBase
            var newsItemService = DependencyResolver.Current.GetService<INewsItemService>();

            foreach (var item in newsItemService.GetAll())
            {
                DynamicNode node = new DynamicNode();
                node.Title = item.Title;
                node.Action = "detail";
                node.RouteValues.Add("url", item.Url);
                returnValue.Add(node);
            }

            return returnValue;
        }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            // Build value
            var returnValue = new List<DynamicNode>();

            // Create a node for each album
            foreach (var category in db.Categories)
            {
                DynamicNode node = new DynamicNode();
                node.Title = category.Name;
                node.ParentKey = "Categories";
                node.RouteValues.Add("category", category.Name);

                returnValue.Add(node);
            }

            // Return
            return returnValue;
        }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            // Build value
            var returnValue = new List<DynamicNode>();

            // Create a node for each album
            foreach (var post in db.Posts)
            {
                DynamicNode node = new DynamicNode();
                node.Title = post.Title;
                node.ParentKey = "Blog";
                node.RouteValues.Add("id", post.PostId);

                returnValue.Add(node);
            }

            // Return
            return returnValue;
        }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            // Build value
            var returnValue = new List<DynamicNode>();
            var repo = new SectionRepo();

            // Create a node for each sectionType
            foreach (var item in repo.GetAll()) {

                DynamicNode node = new DynamicNode();
                node.Title = item;
                node.ParentKey = "Home_Index";
                node.RouteValues.Add("type", item.ToLower());
                node.Key = string.Format("{0}_{1}", "section_", item.ToLower());

                returnValue.Add(node);
            }

            // Return
            return returnValue;
        }
Example #15
0
 public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
 {
     if (GlobalConfig.IsProfileSiteMapEnabled)
     {
         List<DynamicNode> returnValue = null;
         var cache = DataCache.Cache;
         string cacheKey = "SMAPPROFILE:O:00";
         returnValue = (List<DynamicNode>)cache[cacheKey];
         // Build value  
         if (returnValue == null)
         {
             try
             {
                 returnValue = new List<DynamicNode>();
                 var context = new IPTV2_Model.IPTV2Entities();
                 // Create a node for each show
                 var users = context.Users.Where(u => u.StatusId == 1).ToList();
                 foreach (var user in users)
                 {
                     DynamicNode node = new DynamicNode();
                     node.Key = "User-" + user.UserId.ToString();
                     node.Title = "User - " + user.FirstName + " " + user.LastName;
                     node.RouteValues.Add("id", user.UserId.ToString());
                     returnValue.Add(node);
                 }
                 var cacheDuration = new TimeSpan(2, 0, 0);
                 cache.Put(cacheKey, returnValue, cacheDuration);
             }
             catch (Exception)
             {
                 returnValue = new List<DynamicNode>();
             }
         }
         // Return 
         return returnValue;
     }
     else return new List<DynamicNode>();
 }
        public override IEnumerable<DynamicNode> GetDynamicNodeCollection()
        {
            using (var dataContext = new RiftDataDataContext())
            {
                var nodes = new List<DynamicNode>();

                dataContext.Species.ToList().ForEach(t =>
                {
                    var node = new DynamicNode();

                    node.Area = "Mobile";

                    node.Controller = "Species";

                    node.Action = "Index";

                    node.RouteValues.Add("speciesName", "Cyathochromis_obliquidens");

                    nodes.Add(node);
                });
                return nodes;
            }
        }
Example #17
0
 public override IEnumerable<DynamicNode> GetDynamicNodeCollection( )
 {
     var returnValue = new List<DynamicNode>();
     var users = DependencyResolver.Current.GetService<IUserService>().GetUsers();
     foreach (var user in users) {
         DynamicNode node = new DynamicNode();
         node.Title = user.NickName;
         node.RouteValues.Add("userid", user.UserID);
         returnValue.Add(node);
     }
     return returnValue;
 }