Ejemplo n.º 1
0
        private void OnEditRowButtonClick(Object sender
                                          , EventArgs e)
        {
            if (CastListView.SelectedIndex != -1)
            {
                OLVListItem row = (OLVListItem)(CastListView.Items[CastListView.SelectedIndex]);

                CastMember castMember = row.RowObject as CastMember;

                if (castMember != null)
                {
                    using (EditCastForm form = new EditCastForm(castMember))
                    {
                        form.ShowDialog();

                        if (form.DialogResult == DialogResult.OK)
                        {
                            CastListView.RebuildAll(true);
                        }
                    }
                }
                else
                {
                    Episode episode = row.RowObject as Episode;

                    if (episode != null)
                    {
                        using (EditEpisodeForm form = new EditEpisodeForm(episode))
                        {
                            form.ShowDialog();

                            if (form.DialogResult == DialogResult.OK)
                            {
                                CastListView.RebuildAll(true);
                            }
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Please select a row.");
            }
        }
Ejemplo n.º 2
0
        private void OnAddCastButtonClick(Object sender
                                          , EventArgs e)
        {
            CastMember castMember = new CastMember();

            castMember.Upc            = Upc;
            castMember.DatabaseCastId = -1;

            using (EditCastForm editCastForm = new EditCastForm(castMember))
            {
                editCastForm.ShowDialog();

                if (editCastForm.DialogResult == DialogResult.OK)
                {
                    if (CastEntryAdded != null)
                    {
                        AddedEventArgs eventArgs = new AddedEventArgs(castMember);

                        CastEntryAdded(this, eventArgs);
                    }
                }
            }
        }