예제 #1
0
        private void newEvent(object obj)
        {
            NewEvent ne = new NewEvent();



            if (ne.ShowDialog( ) == true)
            {
                if (ne.Event == null)
                {
                    MessageBox.Show("An error occurred, the event was not made");
                }

                Championship.addEvent(ne.Event);
                //SaveToDB ( );

                EditEvent ee = new EditEvent();
                ee.DataContext = new EventVM(ne.Event);
                ee.ShowDialog( );
                SaveToDB( );

                RaisePropertyChanged("Events");

                if (obj is EventsPage)
                {
                    ((EventsPage)obj).ReloadPage( );
                }
            }
            else
            {
                return;
            }
        }
예제 #2
0
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            var row  = dataGridView1.SelectedRows[0].DataBoundItem as ServiceReference1.Event;
            var form = new EditEvent(repository, row);

            form.ShowDialog();
            Reload();
        }
        public void Edit(object selectedItem, double height = 0.0, double width = 0.0)
        {
            EventViewModel @event     = Mapping.Mapper.Map <EventViewModel>(selectedItem as DataRowView);
            Window         editWindow = new EditEvent(@event);

            WindowHelper.SetModal(editWindow, height, width);
            editWindow.ShowDialog();
        }
        private void editEvent()
        {
            EditEvent ee = new EditEvent();

            ee.DataContext = this;

            ee.ShowDialog( );

            SaveToDB( );
        }
        private void pb_edit_Click(object sender, EventArgs e)
        {
            UserEvent userEvent = this.Tag as UserEvent;
            EditEvent editEvent = new EditEvent(userEvent.EventId);

            editEvent.ShowDialog();

            Panel panel = this.Parent as Panel;

            panel.Controls.Clear();
            panel.Refresh();
        }