public IList <IViewUserFavoritesSongs> GetFavoriteSongsByProfileId(int profileId, int page = 0, int rowCount = 0)
        {
            IList <IViewUserFavoritesSongs> retorno = new List <IViewUserFavoritesSongs>();

            IDataQuery query = new DataQuery();

            query.Page     = page;
            query.RowCount = rowCount;
            query.Where    = string.Format(" (profileId={0}) ", profileId);

            var getFavorires = _repository.Find(query).ToList <IViewUserFavoritesSongs>();
            IList <IViewUserFavoritesSongs> filteredResult = getFavorires;

            query.From = "ViewUserFavoritesSongs";
            _total     = _repository.Count(query);

            _collection = filteredResult;

            return(filteredResult);
        }
Пример #2
0
        public IList <IPieChartItem> GetTotals()
        {
            IList <IPieChartItem> retorno = new List <IPieChartItem>();

            IDataQuery query = new DataQuery();

            IViewGenderTotal viewGenderTotal = _repository.Find(query).FirstOrDefault();

            IPieChartItem totalFemale = new PieChartItem();

            totalFemale.Value  = ((decimal)(viewGenderTotal.Total * viewGenderTotal.TotalFemale) / 100);
            totalFemale.Legend = "Female";

            IPieChartItem totalMale = new PieChartItem();

            totalMale.Value  = ((decimal)(viewGenderTotal.Total * viewGenderTotal.TotalMale) / 100);
            totalMale.Legend = "Male";

            retorno.Add(totalMale);
            retorno.Add(totalFemale);

            return(retorno);
        }
        public IList <IViewAlbumArtistSongTotalVotes> GetTopMostVotedSong(int page = 0, int rowCount = 0)
        {
            IDataQuery query = new DataQuery();

            query.OrderBy = " total DESC ";
            if (!String.IsNullOrEmpty(_orderBy))
            {
                query.OrderBy = _orderBy;
            }

            query.Page     = page;
            query.RowCount = rowCount;

            IList <IViewAlbumArtistSongTotalVotes> result = _repository.Find(query);

            query.From = "ViewAlbumArtistSongTotalVotes";
            this.Total = _repository.Count(query);

            return(result);
        }