private void buttonOdustani_Click(object sender, EventArgs e)
        {
            FormDeleteMovie close = new FormDeleteMovie(_movie);

            this.Close();

            Form1 Update = new Form1();

            Update.Show();
        }
        private void buttonCloseDetails_Click(object sender, EventArgs e)
        {
            FormDeleteMovie close = new FormDeleteMovie(oMovie);

            this.Close();

            Form1 Update = new Form1();

            Update.Show();
        }
        private void buttonObrisi_Click(object sender, EventArgs e)
        {
            _omdbRepository.DeleteMovie(_movie.Id);

            FormDeleteMovie close = new FormDeleteMovie(_movie);

            this.Close();

            Form1 Update = new Form1();

            Update.Show();
        }
示例#4
0
        private void dataGridViewFilmovi_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridViewFilmovi.CurrentCell.ColumnIndex.Equals(5) && e.RowIndex != -1)
            {
                var id       = Convert.ToInt32(dataGridViewFilmovi.Rows[e.RowIndex].Cells[0].Value.ToString());
                var title    = dataGridViewFilmovi.Rows[e.RowIndex].Cells[1].Value.ToString();
                var year     = Convert.ToInt32(dataGridViewFilmovi.Rows[e.RowIndex].Cells[2].Value.ToString());
                var genre    = dataGridViewFilmovi.Rows[e.RowIndex].Cells[3].Value.ToString();
                var director = dataGridViewFilmovi.Rows[e.RowIndex].Cells[4].Value.ToString();

                var sTitle = title + " (" + year + ")";
                FormDetailedMovie formDetailedMovie = new FormDetailedMovie(id, sTitle);
                formDetailedMovie.Show();

                this.Hide();
            }

            if (dataGridViewFilmovi.CurrentCell.ColumnIndex.Equals(6) && e.RowIndex != -1)
            {
                var id       = Convert.ToInt32(dataGridViewFilmovi.Rows[e.RowIndex].Cells[0].Value.ToString());
                var title    = dataGridViewFilmovi.Rows[e.RowIndex].Cells[1].Value.ToString();
                var year     = Convert.ToInt32(dataGridViewFilmovi.Rows[e.RowIndex].Cells[2].Value.ToString());
                var genre    = dataGridViewFilmovi.Rows[e.RowIndex].Cells[3].Value.ToString();
                var director = dataGridViewFilmovi.Rows[e.RowIndex].Cells[4].Value.ToString();

                var movie = new Movie
                {
                    Id       = id,
                    Title    = title,
                    Year     = year,
                    Genre    = genre,
                    Director = director
                };

                FormDeleteMovie formDeleteMovie = new FormDeleteMovie(movie);
                formDeleteMovie.Show();

                this.Hide();
            }
        }