Example #1
0
        // GET api/spTICK_Playlist_Details_Get_Result
        //public IEnumerable<spTICK_Playlist_Details_Get_Result> GetspTICK_Playlist_Details_Get_Results()
        //public DataSourceResult GetspTICK_Playlist_Details_Get_Results([ModelBinder(typeof(Ticker.ModelBinders.DataSourceRequestModelBinder))] DataSourceRequest request)
        //{
        //    //return db.spTICK_Playlist_Details_Get_Results.AsEnumerable();
        //    //return db.spTICK_Playlist_Details_Get_Results.Where(gw => gw.ClientID == 1).AsEnumerable().ToDataSourceResult(request, g => new
        //    return db.spTICK_Playlist_Details_Get(playlistID).OrderBy(pldo => pldo.SortOrder).AsEnumerable().ToDataSourceResult(request, g => new
        //    {
        //        // Skip the EntityState and EntityKey properties inherited from EF. It would break model binding.
        //        g.ID,
        //        g.OnAirName,
        //        g.EntryTypeID,
        //        g.EntryID,
        //        g.PlaylistID,
        //        g.SortOrder
        //    });

        //}

        // GET api/spTICK_Playlist_Details_Get_Result/5
        //public spTICK_Playlist_Details_Get_Result GetspTICK_Playlist_Details_Get_Result(int id)
        public IEnumerable <dynamic> GetspTICK_Playlist_Details_Get_Result(int id)
        {
            //spTICK_Playlist_Details_Get_Result spTICK_Playlist_Details_Get_Result = db.spTICK_Playlist_Details_Get_Results.Find(id);
            var spTICK_Playlist_Details_Get_Result = db.spTICK_Playlist_Details_Get(id).OrderBy(pldo => pldo.SortOrder);

            if (spTICK_Playlist_Details_Get_Result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(spTICK_Playlist_Details_Get_Result.Select(g => new
            {
                // Skip the EntityState and EntityKey properties inherited from EF. It would break model binding.
                g.EntryID,
                g.OnAirName,
                g.EntryTypeID,
                g.Header,
                g.PlaylistID,
                g.SortOrder,
                g.Name,
                g.SportDescription,
                g.SportID,
                g.SportShortDisplay,
                g.SportType,
                g.TeamCityName,
                g.TeamID,
                g.TeamNickName,
                g.TeamPrimaryColor,
                g.TeamSecondaryColor,
                g.Type
                , hasChildren = true
            }));;
        }
Example #2
0
        // GET api/spTICK_Playlist_Details_Get_Result
        //public IEnumerable<spTICK_Playlist_Details_Get_Result> GetspTICK_Playlist_Details_Get_Results()
        //public DataSourceResult GetspTICK_Playlist_Details_Get_Results([ModelBinder(typeof(Ticker.ModelBinders.DataSourceRequestModelBinder))] DataSourceRequest request)
        //{
        //    //return db.spTICK_Playlist_Details_Get_Results.AsEnumerable();
        //    //return db.spTICK_Playlist_Details_Get_Results.Where(gw => gw.ClientID == 1).AsEnumerable().ToDataSourceResult(request, g => new
        //    return db.spTICK_Playlist_Details_Get(playlistID).OrderBy(pldo => pldo.SortOrder).AsEnumerable().ToDataSourceResult(request, g => new
        //    {
        //        // Skip the EntityState and EntityKey properties inherited from EF. It would break model binding.
        //        g.ID,
        //        g.OnAirName,
        //        g.EntryTypeID,
        //        g.EntryID,
        //        g.PlaylistID,
        //        g.SortOrder
        //    });

        //}

        // GET api/spTICK_Playlist_Details_Get_Result/5
        //public spTICK_Playlist_Details_Get_Result GetspTICK_Playlist_Details_Get_Result(int id)
        public DataSourceResult GetspTICK_Playlist_Details_Get_Result(int id, [ModelBinder(typeof(Ticker.ModelBinders.DataSourceRequestModelBinder))] DataSourceRequest request)
        {
            //spTICK_Playlist_Details_Get_Result spTICK_Playlist_Details_Get_Result = db.spTICK_Playlist_Details_Get_Results.Find(id);
            var spTICK_Playlist_Details_Get_Result = db.spTICK_Playlist_Details_Get(id).OrderBy(pldo => pldo.SortOrder);

            if (spTICK_Playlist_Details_Get_Result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(spTICK_Playlist_Details_Get_Result.ToList().ToDataSourceResult(request, g => new
            {
                // Skip the EntityState and EntityKey properties inherited from EF. It would break model binding.
                g.EntryID,
                g.OnAirName,
                g.EntryTypeID,
                g.Header,
                g.PlaylistID,
                g.SortOrder,
                g.Name,
                g.SportDescription,
                g.SportID,
                g.SportShortDisplay,
                g.SportType,
                g.TeamCityName,
                g.TeamID,
                g.TeamNickName,
                g.TeamPrimaryColor,
                g.TeamSecondaryColor,
                g.Type
            }));;
        }
Example #3
0
        public void Load(int PlaylistID)//, List<spTICK_Playlist_Details_Get_Result> spTICK_Playlist_Details_Get_ResultsOmitted, List<GameObject> GamesOmitted, List<NoteObject> NotesOmitted)
        {
            ID = PlaylistID;
            //spTICK_Playlist_Details_Get_ResultsOmitted = spTICK_Playlist_Details_Get_ResultsOmitted;
            //gamesOmitted = GamesOmitted;
            //notesOmitted = NotesOmitted;
            spTICK_Playlist_Details_Get_Results = null;
            spTICK_Playlist_Details_Get_Results = db.spTICK_Playlist_Details_Get(ID).ToList();
            spTICK_Playlist_Details_Get_Results = spTICK_Playlist_Details_Get_Results.Except(playlistdetailsOmitted, new spTICK_Playlist_Details_Get_ResultComparer()).ToList();
            spTICK_Playlist_Details_Get_Results = spTICK_Playlist_Details_Get_Results.OrderBy(pldo => pldo.SortOrder).ToList();
            if (spTICK_Playlist_Details_Get_Results == null)
            {
                throw new Exception("No Playlist Details available.");
            }

            iespTICK_Playlist_Details_Get_Results = spTICK_Playlist_Details_Get_Results.GetEnumerator();
            Reset();
            logger.Trace("PlaylistObject Load", PlaylistID, spTICK_Playlist_Details_Get_Results.Count());
        }
Example #4
0
        public IEnumerable <dynamic> GetPlaylistItems(int cid, int playlistID)
        {
            var spTICK_Playlist_Details_Get_Result = db.spTICK_Playlist_Details_Get(playlistID).OrderBy(pldo => pldo.SortOrder);

            if (spTICK_Playlist_Details_Get_Result == null)
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(spTICK_Playlist_Details_Get_Result.Select(g => new
            {
                // Skip the EntityState and EntityKey properties inherited from EF. It would break model binding.
                g.PlaylistDetailsID,
                g.EntryID,
                g.OnAirName,
                g.EntryTypeID,
                g.Header,
                g.HivePrefix,
                g.PlaylistID,
                g.SortOrder,
                g.Name,
                g.SportDescription,
                g.SportID,
                g.SportShortDisplay,
                g.SportType,
                g.TeamCityName,
                g.TeamID,
                g.TeamNickName,
                g.TeamPrimaryColor,
                g.TeamSecondaryColor,
                g.Type
                ,
                g.DataSource,
                hasChildren = (g.EntryTypeID == (int)Ticker.Data.Enums.EntryType.Group ? db.Notes.Where(gn => gn.GroupID == g.EntryID).Any() :
                               g.EntryTypeID == (int)Ticker.Data.Enums.EntryType.HiveGame ? db.GameHiveNotes.Where(gn => gn.HiveID == g.Header).Any() :
                               g.EntryTypeID == (int)Ticker.Data.Enums.EntryType.GroupOfGames ? db.GroupGames.Where(gn => gn.GroupID == g.EntryID).Any() :
                               db.GameNotes.Where(gn => gn.GameID == g.EntryID).Any()) // true//GetPlaylistItems(id, g.EntryID, g.EntryTypeID).Any()
                ,
                g.RipCount,
                g.NotesTypeID
            }));;
        }