Пример #1
0
        private void müşteriDüzenlemeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            EditMovieForm editCustomerForm = new EditMovieForm();

            editCustomerForm.MdiParent   = this;
            editCustomerForm.WindowState = FormWindowState.Maximized;
            editCustomerForm.Show();
        }
Пример #2
0
        private void editMovieButton_Click(object sender, EventArgs e)
        {
            if (movieGridView.RowCount == 0)
            {
                MessageBox.Show("There is no movies in the database", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            int           chosenMovieId   = (int)movieGridView.SelectedRows[0].Cells["id"].Value; // Get the Id of the movie chosen for modifying
            Movie         chosendMovie    = _movieList.FindAll(x => x.Id == chosenMovieId)[0];    // Get the Movie object by chosen Id
            EditMovieForm editMovieWindow = new EditMovieForm(chosendMovie);

            editMovieWindow.ShowDialog();
            if (editMovieWindow.DialogResult == DialogResult.OK)
            {
                _movieRepository.ModifyMovie(chosendMovie);
                MessageBox.Show("Movie was successfuly modified!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                RefreshTables();
            }
        }
Пример #3
0
        private void editButton_Click(object sender, EventArgs e)
        {
            if (entryList.SelectedItems.Count == 0)
            {
                return;
            }

            var entity = (entryList.SelectedItems[0] as EntryListViewItem).Entry;

            if (entity != null)
            {
                Form form = null;
                if (entity.Type == EntryType.Movie)
                {
                    form = new EditMovieForm(m_context, entity);
                }
                else if (entity.Type == EntryType.Book)
                {
                    form = new EditBookForm(m_context, entity);
                }
                if (form != null)
                {
                    form.Location      = Location;
                    form.StartPosition = FormStartPosition.Manual;
                    form.Show();
                    AddFormManager.AddForm(form,
                                           delegate
                    {
                        RefreshListItems();
                        Show();
                    }
                                           );
                    Hide();
                }
            }
        }