using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZSMusic.BLL;
using ZSMusic.Model;

namespace WEB
{
    public partial class detail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Music m = new Music();
                m.Source = Request["source"];
                m.Id = Request["id"];
                m.Name = Request["name"];
                m.Artist = Request["artist"];
                m.Album = Request["album"];
                m.AlbumId = Request["album"];
                if (!MusicHelper.GetData(m))
                { m = MusicHelper.ReSearch(m, 0.75); }
                lblName.Text = m.Name;
                lblArtist.Text = m.Artist;
                lblAlbum.Text = m.Album;
                //lblUrl.Text = m.Url;
                lblUrl.NavigateUrl = m.Url;
                Response.Write(string.Format("<audio src=\"{0}\"  autoplay=\"autoplay\"></audio>", m.Url));
                picAlbum.ImageUrl = m.PicUrl;
                if (m.Lrc != null)
                {
                    txtLrc.Text = m.Lrc.Replace("\n","\r\n");
                }

            }
        }
    }
}