protected void MediaTypeFetch_Click(object sender, EventArgs e)
 {
     MessageUserControl.TryRun(() =>
     {
         //code to go here
         int id           = int.Parse(MediaTypeDDL.SelectedValue);
         SearchArgID.Text = id.ToString();
         TracksBy.Text    = "MediaType";
         TracksSelectionList.DataBind(); //causes the ODS to execute
     }, "Track Search", "Please select from the following list add to your playlist");
 }
        protected void ArtistFetch_Click(object sender, EventArgs e)
        {
            MessageUserControl.TryRun(() =>
            {
                TracksBy.Text    = "Artist";
                SearchArgID.Text = ArtistDDL.SelectedValue;

                TracksSelectionList.DataBind();
            },
                                      "Tracks by Artist",
                                      "Add a track to your playlist by clicking (+)");
        }
Example #3
0
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     //This Message user control for error handling in place of using "Try Catch"
     MessageUserControl.TryRun(() =>
     {
         //code to go here
         int id           = int.Parse(ArtistDDL.SelectedValue);
         SearchArgID.Text = id.ToString();
         TracksBy.Text    = "Artist";
         TracksSelectionList.DataBind(); //This statement causes the ODS to execute
     }, "Track Search", "Please select from the following list to add to your playlist.");
 }
Example #4
0
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     //validate that data exists if not put out a message
     if (string.IsNullOrEmpty(ArtistName.Text))
     {
         MessageUserControl.ShowInfo("Search entry error", "Enter a artist name or partial artist name, then press your button.");
         SearchArg.Text = "dddfgg";
     }
     TracksBy.Text  = "Artist";
     SearchArg.Text = ArtistName.Text;
     //to force the listview to rebind to execute again
     TracksSelectionList.DataBind();
 }
Example #5
0
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(ArtistName.Text))
     {
         //message to the user
         MessageUserControl.ShowInfo("Entry Error", "Select an artist name or part of.");
     }
     else
     {
         TracksBy.Text  = "Artist";
         SearchArg.Text = ArtistName.Text;
         TracksSelectionList.DataBind();
     }
 }
Example #6
0
 protected void MediaTypeDDL_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (MediaTypeDDL.SelectedIndex == 0)
     {
         //message to the user
         MessageUserControl.ShowInfo("Selection Error", "Enter a media type");
     }
     else
     {
         TracksBy.Text  = "MediaType";
         SearchArg.Text = MediaTypeDDL.SelectedValue;
         TracksSelectionList.DataBind();
     }
 }
        protected void MediaTypeFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "MediaType";
            //the ddl does not have a prompt line, therefore
            //    to selection test is requried
            //remember: SelectedValue returns contents as a string
            SearchArg.Text = MediaTypeDDL.SelectedValue;

            //to force the listview to rebind (to execute again)
            //NOTE there is NO DataSource assignment as that is
            //     accomplished using the ODS and a DataSourceID parameter
            //     on the ListView control
            TracksSelectionList.DataBind();
        }
Example #8
0
 protected void AlbumFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(AlbumTitle.Text))
     {
         //message to the user
         MessageUserControl.ShowInfo("Entry Error", "Enter an album title or part of.");
     }
     else
     {
         TracksBy.Text  = "Album";
         SearchArg.Text = AlbumTitle.Text;
         TracksSelectionList.DataBind();
     }
 }
Example #9
0
        protected void GenreFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "Genre";
            //there is no prompt test needed for this event BECAUSE the dropdownlist
            //    does not have a prompt
            //by default there will always be a value to use

            //HiddentField, though text fields, are accessed by the property Value, NOT Text
            SearchArg.Value = GenreDDL.SelectedValue.ToString(); //as an integer
            //SearchArg.Value = GenreDDL.SelectedItem.Text; //as a string

            //to cause an ODS to re-execute, you only need to do a .DataBind() against the display control
            TracksSelectionList.DataBind();
        }
Example #10
0
        protected void ArtistFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "Artist";
            if (string.IsNullOrEmpty(ArtistName.Text))
            {
                MessageUserControl.ShowInfo("Artist Search", "No artist name was supplied");
            }

            //HiddentField, though text fields, are accessed by the property Value, NOT Text
            SearchArg.Value = ArtistName.Text;

            //to cause an ODS to re-execute, you only need to do a .DataBind() against the display control
            TracksSelectionList.DataBind();
        }
Example #11
0
 protected void MediaTypeDDL_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (MediaTypeDDL.SelectedIndex == 0)
     {
         MessageUserControl.ShowInfo("Select Error", "You must select a media type");
         TracksBy.Text  = "";
         SearchArg.Text = "";
     }
     else
     {
         TracksBy.Text  = "MediaType";
         SearchArg.Text = MediaTypeDDL.SelectedValue;
         TracksSelectionList.DataBind();  //force an ODS to re-execute
     }
 }
Example #12
0
 protected void AlbumFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(AlbumTitle.Text))
     {
         MessageUserControl.ShowInfo("Select Error", "You must enter an album title or part of");
         TracksBy.Text  = "";
         SearchArg.Text = "";
     }
     else
     {
         TracksBy.Text  = "Album";
         SearchArg.Text = AlbumTitle.Text;
         TracksSelectionList.DataBind();  //force an ODS to re-execute
     }
 }
Example #13
0
        protected void GenreFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "Genre";
            //the DDL does not have a prompt line therefore
            //  no selection test required
            //REMEMBER: SelectedValue returns contents as a string
            SearchArg.Text = GenreDDL.SelectedValue;


            //to force the listview to rebind (to execute again)
            //NOTE there is NO DataSource assignment as that is
            //     accomplished using the ODS and a DataSourceID parameter
            //     on the ListView control
            TracksSelectionList.DataBind();
        }
Example #14
0
 protected void AlbumFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(AlbumTitle.Text))
     {
         MessageUserControl.ShowInfo("Missing data", "Enter all or part of an album title. ");
     }
     else
     {
         MessageUserControl.TryRun(() =>
         {
             SearchArg.Text = AlbumTitle.Text;
             TracksBy.Text  = "Album";
             TracksSelectionList.DataBind(); //executes ods
         }, "Track Search", "Select songs to add to playlist.");
     }
 }
        protected void GenreFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "Genre";
            //if you had a prompt on your DDL, you would verify that a selection was made

            //you could use the value field of the DDL
            //SearchArg.Value = GenreDDL.SelectedValue;

            //Can I use something else from the DDL instead of the value field
            //there is the display field
            //Warning: using the display field for the lookup in this example is possible bc each description is unique
            SearchArg.Value = GenreDDL.SelectedItem.Text;

            //to force the re-execution of an ODS attached to a control, rebind the display control
            TracksSelectionList.DataBind();
        }
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     TracksBy.Text = "Artist";
     if (string.IsNullOrEmpty(ArtistName.Text))
     {
         MessageUserControl.ShowInfo("You did not supply an artist name");
         //The HiddenField content access is in .Value, not .Text
         SearchArg.Value = "sfsfds";
     }
     else
     {
         SearchArg.Value = ArtistName.Text;
     }
     //to force the re-execution of an ODS attached to a control, rebind the display control
     TracksSelectionList.DataBind();
 }
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(ArtistName.Text))
     {
         MessageUserControl.ShowInfo("Missing Data", "Enter the partial artist name");
     }
     else
     {
         MessageUserControl.TryRun(() =>
         {
             SearchArg.Text = ArtistName.Text;
             TracksBy.Text  = "Artist";
             TracksSelectionList.DataBind();
         }, "Track Search", "Select from the following list to add to your playlist");
     }
 }
Example #18
0
 protected void AlbumFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(AlbumTitle.Text))
     {
         MessageUserControl.ShowInfo("Missing Data", "Enter a partial album name.");
     }
     else
     {
         MessageUserControl.TryRun(() =>
         {
             SearchArg.Text = AlbumTitle.Text;
             TracksBy.Text  = "Album";
             TracksSelectionList.DataBind();//cause the ODS to execute
         }, "TrackSearch", "Select from the following list to add to your playlist");
     }
 }
Example #19
0
        protected void AlbumFetch_Click(object sender, EventArgs e)
        {
            // click on fetch by artist logic
            // bind information to the hidden labels
            TracksBy.Text = "Album";
            if (string.IsNullOrEmpty(AlbumTitle.Text)) // .Value if using HiddenField
            {
                MessageUserControl.ShowInfo("oopsies", "input some damn data in the Album search Field!");
            }
            else
            {
                SearchArg.Text = AlbumTitle.Text;
            }
            //to force exicution to ODS attached to a control - re-bind the Display control

            TracksSelectionList.DataBind();
        }
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(ArtistName.Text))
     {
         //using MessageUserControl to display a message.
         MessageUserControl.ShowInfo("Missing Data", "Enter Partial Artist Name.");
     }
     else
     {
         MessageUserControl.TryRun(() =>
         {
             SearchArg.Text = ArtistName.Text;
             TracksBy.Text  = "Artist";
             TracksSelectionList.DataBind();//Causes the ODS to execute.
         }, "Tracks Search", "Select from the following list to add to yotur Playlist");
     }
 }
Example #21
0
 protected void AlbumFetch_Click(object sender, EventArgs e)
 {
     TracksBy.Text = "Album";
     //The Hidden field content access is .Value Not .Text
     if (string.IsNullOrEmpty(AlbumTitle.Text))
     {
         MessageUserControl.ShowInfo("You did not supply an album name");
         SearchArg.Value = "xdcxe";
     }
     else
     {
         SearchArg.Value = AlbumTitle.Text;
     }
     //to force the re-execution of an ODS attached to a display control
     //rebind the display control
     TracksSelectionList.DataBind();
 }
Example #22
0
        protected void AlbumFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text  = "Album";
            SearchArg.Text = AlbumTitle.Text;
            if (string.IsNullOrEmpty(AlbumTitle.Text))
            {
                MessageUserControl.ShowInfo("Search entry error",
                                            "Enter an album title or partial album title. Press the album Fetch button");
                SearchArg.Text = "dgcudfk";
            }

            //to force the ListView to rebind (to execute again)
            //Note there is NO DataSource assignment as that is
            //     accomplished using the ODS and a DataSourceID  parameter
            //      on the ListView control
            TracksSelectionList.DataBind();
        }
Example #23
0
        protected void GenreFetch_Click(object sender, EventArgs e)
        {
            //code to go here

            TracksBy.Text = "Genre";

            //if(GenreDDL.SelectedIndex<=-1)
            //{
            //    MessageUserControl.ShowInfo("Pls select a genre to begin");
            //}else
            //{
            //    SearchArg.Value = GenreDDL.SelectedValue;
            //}

            SearchArg.Value = GenreDDL.SelectedItem.Text;
            TracksSelectionList.DataBind();
        }
 protected void ArtistFetch_Click(object sender, EventArgs e)
 {
     //first thing we probably want to do is validation, if we don't have that already on the form.
     if (string.IsNullOrEmpty(ArtistName.Text))
     {
         //using MessageUserControl to display a message
         MessageUserControl.ShowInfo("You done f*cked up", "Enter a partial artist name.");
     }
     else
     {
         //do a lookup by the artist name and bind our code.
         MessageUserControl.TryRun(() =>
         {
             SearchArg.Text = ArtistName.Text;
             TracksBy.Text  = "Artist";
             TracksSelectionList.DataBind(); //this line causes the ODS to execute. So if I need to do it again, then I can just do a data bind.
         }, "Track Search", "Select from the following list to add to your playlist.");
     }
 }
Example #25
0
        protected void ArtistFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text  = "Artist";
            SearchArg.Text = ArtistName.Text;
            //validate that data exists if not put out a message
            if (string.IsNullOrEmpty(ArtistName.Text))
            {
                MessageUserControl.ShowInfo("Search entry error",
                                            "Enter a artist name or partial artist name. The press your button.");
                SearchArg.Text = "xcfdrte";
            }


            //to force the listview to rebind (to execute again)
            //NOTE there is NO DataSource assignment as that is
            //     accomplished using the ODS and a DataSourceID parameter
            //     on the ListView control
            TracksSelectionList.DataBind();
        }
        protected void GenreFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "Genre";
            //if you had a prompt on the dropdownlist, you would verify that a selection
            //  was made.

            // //you could use the value field off the dropdownlist.
            //SearchArg.Value = GenreDDL.SelectedValue;

            // /Can i use something else from the dropdownlist instead of the value field?
            // // There is the display field.
            // / / / /WARNING: Using the display field for the local, in this example, is possible because
            //                  EACH description is unique!!!!!
            SearchArg.Value = GenreDDL.SelectedItem.Text;

            //to force the re-execution of an ODS attached to a display control
            //      rebind the display control
            TracksSelectionList.DataBind();
        }
        protected void GenreFetch_Click(object sender, EventArgs e)
        {
            TracksBy.Text = "Genre";
            //the HiddenField content access is .Value NOT .Text
            //if (string.IsNullOrEmpty(ArtistName.Text))
            //{
            //    MessageUserControl.ShowInfo("You did not supply an artist name.");
            //the HiddenField content access is .Value NOT .Text
            //    SearchArg.Value = "zxcvg";
            //}
            //else
            //{
            //    //the HiddenField content access is .Value NOT .Text
            //    SearchArg.Value = ArtistName.Text;
            //}


            ////----APPLICABLE TO ONE AND SECOND WAY TO DISPLAY RESULTS OF GENRE, ALBUM and ARTIST (found in TrackController)
            //// if you had a prompt in your ddl, you would verify that a
            ////      selection was made
            //// you could use the value field of the dropdownlist
            //SearchArg.Value = GenreDDL.SelectedValue; //------->this can be used too
            ////----ENDOF APPLICABLE TO ONE AND SECOND WAY TO DISPLAY RESULTS OF GENRE, ALBUM and ARTIST (found in TrackController)

            ////---------THIRD WAY TO DISPLAY RESULTS OF GENRE, ALBUM and ARTIST using SelectedItem
            // Can I use something else from the ddl instead of the value field???
            // there is the display field
            // WARNING: using the display field for the lookup, in this example, is possible
            //      bec EACH description is unique!!!!
            SearchArg.Value = GenreDDL.SelectedItem.Text;
            ////---------ENDOF THIRD WAY TO DISPLAY RESULTS OF GENRE, ALBUM and ARTIST using SelectedItem



            // to force the re-execution of an ODS attached to a display control
            //      rebind the display control
            TracksSelectionList.DataBind();
        }
        protected void Tracks_Button_Command(Object sender, System.Web.UI.WebControls.CommandEventArgs e)
        {
            TracksBy.Text = e.CommandName;
            switch (e.CommandName)
            {
            case ("Artist"):
                if (string.IsNullOrEmpty(ArtistName.Text))
                {
                    MessageUserControl.ShowInfo("", "ERROR: Select an artist name or part of.");
                }
                else
                {
                    SearchArg.Text = ArtistName.Text;
                }
                break;

            case ("MediaType"):
                SearchArg.Text = MediaTypeDDL.SelectedValue;
                break;

            case ("Genre"):
                SearchArg.Text = GenreDDL.SelectedValue;
                break;

            case ("Album"):
                if (string.IsNullOrEmpty(AlbumTitle.Text))
                {
                    MessageUserControl.ShowInfo("", "ERROR: Enter an album title or part of.");
                }
                else
                {
                    SearchArg.Text = AlbumTitle.Text;
                }
                break;
            }
            TracksSelectionList.DataBind();
        }
Example #29
0
 protected void GenreFetch_Click(object sender, EventArgs e)
 {
     TracksBy.Text  = "Genre";
     SearchArg.Text = GenreDDL.SelectedValue;
     TracksSelectionList.DataBind();
 }
Example #30
0
 protected void MediaTypeFetch_Click(object sender, EventArgs e)
 {
     TracksBy.Text  = "MediaType";
     SearchArg.Text = MediaTypeDDL.SelectedValue;
     TracksSelectionList.DataBind();
 }