Exemplo n.º 1
0
 public void SaveEvent(Event e)
 {
     events.AddEvent(e);
     UpdateForm();
     populatePerformer();
     EventDB.SaveEvents(events);
 }
Exemplo n.º 2
0
        public void UpdateForm()
        {
            try
            {
                if (selectedEvent != null)
                {
                    txtTitle.Text          = selectedEvent.Title;
                    lblPerformer.Text      = selectedEvent.Performer.ToString();
                    lblTickets.Text        = selectedEvent.NumAvailableTickets.ToString();
                    dtpDate.Value          = selectedEvent.EventTime;
                    dtpTime.Value          = selectedEvent.EventTime;
                    grpEventDetail.Visible = true;
                }
                if (rbtDate.Checked)
                {
                    events.SortByDate();
                }
                else if (rbtTitle.Checked)
                {
                    events.SortByTitle();
                }
                if (chkOpenShows.Checked)
                {
                    displayedEvents = events.OpenShows();
                }
                string performerName = null;
                if (cmbPerformers.SelectedIndex >= 0)
                {
                    performerName = cmbPerformers.SelectedItem.ToString();

                    displayedEvents = events.SearchByPerformer(performerName);
                }
                else
                {
                    displayedEvents = events.events;
                }
                displayEvents();
            }
            catch (FormatException)
            {
                MessageBox.Show("Please use numbers only.");
            }
            finally
            {
                EventDB.SaveEvents(events);
            }
        }
Exemplo n.º 3
0
 private void EventListForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     EventDB.SaveEvents(events);
 }
Exemplo n.º 4
0
 public void DeleteEventInfo(Event selectedEvent)
 {
     EventDB.SaveEvents(events);
 }