Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (codeTB.Text.Length < 4)
            {
                if (newEvent)
                {
                    schedule.Add(new Show());
                    cnt = schedule.Count() - 1;
                }
                schedule.ElementAt(cnt).Info = schedDTP.Value;
                schedule.ElementAt(cnt).Name = descriptionTB.Text;
                schedule.ElementAt(cnt).code = codeTB.Text;
                switch (THEATRE)
                {
                case 1: ScheduleEditor.WriteXML <Show>("..\\..\\schedule.xml", schedule); break;

                case 2: ScheduleEditor.WriteXML <Show>("..\\..\\schedule2.xml", schedule); break;

                case 3: ScheduleEditor.WriteXML <Show>("..\\..\\schedule3.xml", schedule); break;
                }
                this.Close();
            }
            else
            {
                MessageBox.Show("Please enter a 3 digit code");
            }
        }
        private void addBN_Click(object sender, EventArgs e)
        {
            switch (TicketsTab.SelectedTab.Name)
            {
            case "Tab1":
                ScheduleEditor scheduleEditor = new ScheduleEditor(schedMC.SelectionStart, sched, 1);
                scheduleEditor.ShowDialog(); break;

            case "Tab2":
                ScheduleEditor scheduleEditor2 = new ScheduleEditor(schedMC2.SelectionStart, sched, 2);
                scheduleEditor2.ShowDialog(); break;

            case "Tab3":
                ScheduleEditor scheduleEditor3 = new ScheduleEditor(schedMC3.SelectionStart, sched, 3);
                scheduleEditor3.ShowDialog(); break;
            }
        }
        private void editBN_click(object sender, EventArgs e)
        {
            switch (TicketsTab.SelectedTab.Name)
            {
            case "Tab1":
                if (schedLB.SelectedItem == null)
                {
                    MessageBox.Show("Select an event from this date.");
                }
                else
                {
                    ScheduleEditor edit = new ScheduleEditor(sched, schedLB.SelectedItem as Show, 1);
                    edit.ShowDialog();
                } break;

            case "Tab2":
                if (schedLB2.SelectedItem == null)
                {
                    MessageBox.Show("Select an event from this date.");
                }
                else
                {
                    ScheduleEditor edit2 = new ScheduleEditor(sched, schedLB2.SelectedItem as Show, 2);
                    edit2.ShowDialog();
                } break;

            case "Tab3":
                if (schedLB3.SelectedItem == null)
                {
                    MessageBox.Show("Select an event from this date.");
                }
                else
                {
                    ScheduleEditor edit3 = new ScheduleEditor(sched, schedLB3.SelectedItem as Show, 3);
                    edit3.ShowDialog();
                } break;
            }
        }