public void bindGridView2()
 {
     try
     {
         if (txbLocation.Text == "")
         {
             Label1.Text = "Enter a location!";
         }
         else
         {
             Playlist pl = new Playlist();
             DataSet ds = pl.LoadByLocationMP(txbLocation.Text);
             bool check = IsEmpty(ds);
             if (!check)
             {
                 GridView1.DataSource = ds;
                 GridView1.DataBind();
                 Label1.Text = "";
                 ViewState["flag"] = "false";
             }
             else
             {
                 Label1.Text = "No data found!";
             }
         }
     }
     catch (Exception e)
     {
         Label1.Text = "The Server is down! Try again later!";
     }
 }
        public void getDadosiRadioDei(string namePlaylist, string[] musics, string location)
        {
            Playlist pl = new Playlist();
            int reg1 = pl.RegisterMP(namePlaylist, location);

            Music mus = new Music();

            for (int i = 0; i < musics.Length; i++)
            {
                int reg2 = mus.Register(musics[i], reg1);
            }
        }
 public void bindGridView1()
 {
     try
     {
         Playlist pl = new Playlist();
         DataSet ds = pl.LoadAllMP();
         bool check = IsEmpty(ds);
         if (!check)
         {
             GridView1.DataSource = ds;
             GridView1.DataBind();
             Label1.Text = "";
             ViewStat["flag"] = "true";
         }
         else
         {
             Label1.Text = "No data found!";
         }
     }
     catch (Exception e)
     {
         Label1.Text = "The Server is down! Try again later!";
     }
 }
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Playlist pl = new Playlist();
            DataSet ds;

            if (Page.IsPostBack)
            {
                // Retrieve and display the property value.
                flag = (string)ViewState["flag"];
            }

            if (flag == "true")
            {
                ds = pl.LoadAllMP();
            }
            else
            {
                ds = pl.LoadByLocationMP(txbLocation.Text);
            }

            int currentPage = GridView1.PageIndex;
            int pos = currentPage * 10;

            DataRow dr = ds.Tables[0].Rows[GridView1.SelectedIndex + pos];
            int index = (int)dr["id_playlist"];

            Music mus = new Music();
            DataSet ds2 = mus.LoadById_playlist(index);
            GridView2.DataSource = ds2;
            GridView2.DataBind();
        }