using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using BLL;
using Model;
using Helper;
using System.Data;
namespace WEBAPI
{
    public partial class getdata : System.Web.UI.Page
    {//getdata.aspx?source={0}&id={1}name={2}&artist={3}&album={4}&picid={5}
        protected void Page_Load(object sender, EventArgs e)
        {
            Music m = new Music(); ;
            try
            {
                m.Source = Request["source"];
                m.Id = Request["id"];
                m.Name = Request["name"];
                m.Artist = Request["artist"];
                m.Album = Request["album"];
                m.PicId = Request["picid"];
                MusicBLL bll = new MusicBLL(m.Source);
                bll.GetData(m);
            }
            catch (Exception ex)
            {
                m.Name = ex.Message;
                m.Artist = ex.GetType().ToString();
                m.Album = ex.TargetSite.ToString();
            }
            Response.Write(Music.ListToJson(new List<Music> { m }));
        }
    }
}
