コード例 #1
0
 private void btnFindMovie_Click(object sender, EventArgs e)
 {
     if (int.TryParse(txtMovieID.Text, out MovieId))
     {
         try
         {
             HollywoodLibrary.Movies movie = new HollywoodLibrary.Movies();
             dgvActors.DataSource = movie.GetActors(Convert.ToInt32(txtMovieID.Text));
             lblResult.Text       = movie.LastError;
         }
         catch (Exception ex)
         {
             lblResult.Text = ex.Message;
         }
     }
     else
     {
         MessageBox.Show("Enter numeric data for the movie id", "Error");
     }
 }
コード例 #2
0
 private void btnFindMovie_Click(object sender, EventArgs e)
 {
     if (int.TryParse (txtMovieID.Text, out MovieId))
     {
         try
         {
             HollywoodLibrary.Movies movie = new HollywoodLibrary.Movies();
             dgvActors.DataSource = movie.GetActors(Convert.ToInt32(txtMovieID.Text));
             lblResult.Text = movie.LastError;
         }
         catch (Exception ex)
         {
             lblResult.Text = ex.Message;
         }
     }
     else
     {
         MessageBox.Show("Enter numeric data for the movie id", "Error");
     }
 }