using Helper;
using Newtonsoft.Json;
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 search : System.Web.UI.Page
    {
        ///search.aspx?source=qq&word=微微&page=1&num=30
        protected void Page_Load(object sender, EventArgs e)
        {
            List<Music> list = new List<Music>();
            string result = "";
            try
            {

                    string word = Request["word"];
                    int page = Convert.ToInt32(Request["page"]);
                    int num = Convert.ToInt32(Request["num"]);
                    list.AddRange(MusicHelper.Search(Request["source"], word, page, num));
                    result = JsonConvert.SerializeObject(list);

            }
            catch (Exception ex)
            {
                result = JsonConvert.SerializeObject(ex);
            }
            Response.Write(result);
        }
    }
}