예제 #1
0
        public ActionResult Playlist()
        {
            string checkbox = Request["checkbox"];//取得连播ID

            try
            {
                if (Session["CurrentUser"] != null)
                {
                    UserInfo uf = (UserInfo)Session["CurrentUser"];
                    tianlairepository.AddToPlayList(checkbox, uf.Uid);
                    string mids = tianlairepository.SelectMid(uf.Uid);
                    return(View(tianlairepository.AddList(mids)));
                }
                else
                {
                    return(View(tianlairepository.AddList(checkbox)));
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
                return(Content("<script language='javascript'>alert('未选择歌曲!');window.location.href='../MusicPlay/Default';</script>"));
            }
        }
예제 #2
0
 //播放列表
 public ActionResult UserPlaylist(string uid)
 {
     if (UserConfirm(uid))
     {
         ViewData["uid"] = uid;
         TianLianRepository tianlairepository = new TianLianRepository();
         try
         {
             string mids = tianlairepository.SelectMid(uid);
             return(View(tianlairepository.AddList(mids)));
         }
         catch (Exception ex)
         {
             ex.ToString();
         }
         return(Content("播放列表暂无歌曲,请添加后再试!"));
     }
     return(View("Error"));
 }