Example #1
0
        private void btnAddMovie_Click(object sender, EventArgs e)
        {
            string year      = txtAddMovieYear.Text;
            string movieName = txtTitle.Text;
            string director  = txtDirector.Text;

            informationBox(MovieManagement.CreateMovie(year, movieName, director));
        }
Example #2
0
 private void btnPrintAll_Click(object sender, EventArgs e)
 {
     lsbxPrintAll.Items.Clear();
     if (MovieManagement.print().Item1 == EMPTY)
     {
         MessageBox.Show(MovieManagement.print().Item2[FIRST], "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         foreach (string item in MovieManagement.print().Item2)
         {
             lsbxPrintAll.Items.Add(item);
         }
     }
 }
Example #3
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            string year   = txtSearchYear.Text;
            string result = "";

            if (MovieManagement.trySearchMovie(year, out result).Item1 == FOUND)
            {
                lsbxPrintAll.Items.Clear();
                lsbxPrintAll.Items.Add(MovieManagement.trySearchMovie(year, out result).Item2.Year());
                lsbxPrintAll.Items.Add(MovieManagement.trySearchMovie(year, out result).Item2.MovieName);
                lsbxPrintAll.Items.Add(MovieManagement.trySearchMovie(year, out result).Item2.MovieDirector);
                MessageBox.Show("Movie Found", "Inforamtion", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Movie Not Found", "Inforamtion", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #4
0
        private void btnDeleteMovie_Click(object sender, EventArgs e)
        {
            string year = txtDeleteMovieYear.Text;

            if (MovieManagement.checkDeleteMovie(year).Item1 == FOUND)
            {
                DialogResult result = MessageBox.Show(MovieManagement.checkDeleteMovie(year).Item2, "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (result == DialogResult.OK)
                {
                    MovieManagement.deleteMovie(year);
                    MessageBox.Show("Success", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show(MovieManagement.checkDeleteMovie(year).Item2, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #5
0
 public FormMovieDatabase()
 {
     InitializeComponent();
     MovieManagement.addInitMovie();
 }