Esempio n. 1
0
 public void SaveEvent(Event e)
 {
     events.AddEvent(e);
     UpdateForm();
     populatePerformer();
     EventDB.SaveEvents(events);
 }
Esempio n. 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new EventListForm());

            Application.Run(new EventListForm(EventDB.GetAllEvents()));
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
 private void EventListForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     EventDB.SaveEvents(events);
 }
Esempio n. 5
0
 public void DeleteEventInfo(Event selectedEvent)
 {
     EventDB.SaveEvents(events);
 }