Esempio n. 1
0
        /// <summary>
        /// 获取历史歌单中的歌曲列表
        /// </summary>
        /// <returns></returns>
        public ActionResult GetHisSongList()
        {
            List <SongBookEntity> list = new List <SongBookEntity>();
            string listContent         = GetStrValFromReq("listContent");
            string storeCode           = GetStrValFromReq("storeCode");
            var    result = playListRepository.GetSongListByPlayListStr(listContent, storeCode);

            List <SongMarkEntity> songMarkList = songMarkRepository.GetSongMakList();

            foreach (var item in result)
            {
                string[] arr       = item.SongMark.Split(',');
                var      markNames = string.Empty;
                foreach (var markId in arr)
                {
                    if (!string.IsNullOrWhiteSpace(markId))
                    {
                        var songmark = songMarkList.FirstOrDefault(a => a.Id == Convert.ToInt32(markId));
                        if (songmark != null)
                        {
                            markNames += (songmark.MarkName + "、");
                        }
                    }
                }
                if (markNames.Length > 0)
                {
                    item.SongMarkStr = markNames.Substring(0, markNames.Length - 1);
                }
                else
                {
                    item.SongMarkStr = string.Empty;
                }
                list.Add(item);
            }
            return(Json(new { code = 0, msg = string.Empty, count = result == null ? 0 : result.Count, data = result }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ResponseResultDto <List <SongInfoParam> > GetHisSongListById(int id, string storeCode)
        {
            List <SongInfoParam> list = new List <SongInfoParam>();
            var result = storeSongManageRspository.GetSongListById(id, storeCode);

            List <SongMarkEntity> songMarkList = songMarkRepository.GetSongMakList();

            foreach (var item in result)
            {
                string[] arr       = item.SongMark.Split(',');
                var      markNames = string.Empty;
                foreach (var markId in arr)
                {
                    if (!string.IsNullOrWhiteSpace(markId))
                    {
                        var songmark = songMarkList.FirstOrDefault(a => a.Id == Convert.ToInt32(markId));
                        if (songmark != null)
                        {
                            markNames += (songmark.MarkName + "、");
                        }
                    }
                }
                if (markNames.Length > 0)
                {
                    item.SongMarkStr = markNames.Substring(0, markNames.Length - 1);
                }
                else
                {
                    item.SongMarkStr = string.Empty;
                }
                list.Add(item);
            }
            return(new ResponseResultDto <List <SongInfoParam> >
            {
                IsSuccess = true,
                ErrorMessage = string.Empty,
                Result = list
            });
        }
Esempio n. 3
0
        public ActionResult GetSongMakList()
        {
            var result = songMarkRepository.GetSongMakList();

            return(Json(new { code = 0, msg = "", count = result.Count, data = result }, JsonRequestBehavior.AllowGet));
        }