Пример #1
0
 protected void Search_Click(object sender, EventArgs e)
 {
     AlbumID.Text             = "";
     AlbumTitle.Text          = "";
     AlbumReleaseYear.Text    = "";
     AlbumReleaseLabel.Text   = "";
     ArtistList.SelectedIndex = 0;
     if (string.IsNullOrEmpty(SearchArg.Text))
     {
         MessageUserControl1.ShowInfo("Enter an album title or part of the title.");
     }
     else
     {
         MessageUserControl1.TryRun(() =>
         {
             AlbumController sysmgr = new AlbumController();
             List <Album> albumlist = sysmgr.Albums_GetbyTitle(SearchArg.Text);
             if (albumlist.Count == 0)
             {
                 MessageUserControl1.ShowInfo("Search Result", "No data for album title or partial title " + SearchArg.Text);
                 AlbumList.DataSource = null;
                 AlbumList.DataBind();
             }
             else
             {
                 MessageUserControl1.ShowInfo("Search Result", "Select the desired album for maintanence");
                 AlbumList.DataSource = albumlist;
                 AlbumList.DataBind();
             }
         });
     }
 }
Пример #2
0
    protected void Search_Click(object sender, EventArgs e)
    {
        //clear out the old album information on the Maintain tab
        Clear_Click(sender, e);

        if (string.IsNullOrEmpty(SearchArg.Text))
        {
            //(message string)
            MessageUserControl1.ShowInfo("Enter an album title or part of the title.");
        }
        else
        {
            //do a look of the data in the db via the controller
            //all actions that are external to the webpage should be done in a try/catch
            //   for friendly error handling
            //we will use MessageUserControl to handle the error messages for this semester
            MessageUserControl1.TryRun(() =>
            {
                //coding block I wish MessageUserControl to try and run checking for
                //any errors, catching the errors, and displaying said error(s) for me
                //in its error panel
                //what is leave for me to do: simply the logic for the event

                //standard lookup
                AlbumController sysmgr = new AlbumController();
                List <Album> albumlist = sysmgr.Albums_GetbyTitle(SearchArg.Text);
                if (albumlist.Count == 0)
                {
                    //(title string, message string)
                    MessageUserControl1.ShowInfo("Search Result",
                                                 "No data for album title or partial tile " + SearchArg.Text);
                    AlbumList.DataSource = null;
                    AlbumList.DataBind();
                }
                else
                {
                    MessageUserControl1.ShowInfo("Search Result",
                                                 "Select the desired album for maintenance.");
                    AlbumList.DataSource = albumlist;
                    AlbumList.DataBind();
                }
            });
        }
    }
    protected void Search_Click(object sender, EventArgs e)
    {
        //Clear out the old album information on the maintain tab.
        Clear_Click(sender, e);
        if (string.IsNullOrEmpty(SearchArg.Text))
        {
            MessageUserControl1.ShowInfo("Please Enter an Album Title or part of the title");
        }
        else
        {
            //Lookup of the data in the database.We are the controller all actions all the external to the
            //web page should be done through a try catch. From a friendly error handling.
            //We will use the mesageusercotrol to handle error messages for this semester.
            MessageUserControl1.TryRun(() =>
            {
                //Coding block I wish message user control to try and run and check the checking for
                //any errors catching the errors and displaying set errors sfor me in its error panel.
                //What is left for me to do is simply the logicc for me to do the event.

                //This is a standard lookup
                AlbumController sysmgr = new AlbumController();
                List <Album> albumlist = sysmgr.Albums_GetbyTitle(SearchArg.Text);
                if (albumlist.Count == 0)
                {
                    //Title String,message string
                    MessageUserControl.ShowInfo("Search Result",
                                                "No data for the album title or the partial title  " + SearchArg.Text);
                    AlbumList.DataSource = null;
                    AlbumList.DataBind();
                }
                else
                {
                    MessageUserControl.ShowInfo("Using Instructions",
                                                "Select the desired album for the maintenece.");
                    AlbumList.DataSource = albumlist;
                    AlbumList.DataBind();
                }
            }
                                       );
        }
    }