Esempio n. 1
0
        private void addProgramButton_Click(object sender, EventArgs e)
        {
            AddProgramPage addPage = new AddProgramPage(Convert.ToDateTime(programDateLabel.Text).Date);

            addPage.ShowDialog();

            if (addPage.isConfirm == true)
            {
                string   programName = addPage.name;
                DateTime startTime   = addPage.startTime;
                DateTime endTime     = addPage.endTime;
                string   description = addPage.description;

                int programId = eventOrganizerManager.AddProgram(programName, startTime, endTime, description, this.eventId);

                // add list view
                ListViewItem newEvent = new ListViewItem(new[] { programName, description, startTime.Hour.ToString("D2") + ":00", startTime.Date != endTime.Date ? "24:00" : endTime.Hour.ToString("D2") + ":00", programId.ToString() });
                programListView.Items.Add(newEvent);
                toolStripStatusLabel1.Text = "Camp Program <" + programName + "> has been added.";
            }
            addPage.Close();
            programButtonDisable();
        }
Esempio n. 2
0
        private void addProgramButton_Click(object sender, EventArgs e)
        {
            AddProgramPage addPage = new AddProgramPage(Convert.ToDateTime(programDateLabel.Text).Date);
            addPage.ShowDialog();

            if (addPage.isConfirm == true) {
                string programName = addPage.name;
                DateTime startTime = addPage.startTime;
                DateTime endTime = addPage.endTime;
                string description = addPage.description;

                int programId = eventOrganizerManager.AddProgram(programName, startTime, endTime, description, this.eventId);

                // add list view
                ListViewItem newEvent = new ListViewItem(new[] { programName, description, startTime.Hour.ToString("D2") + ":00", startTime.Date != endTime.Date ? "24:00" : endTime.Hour.ToString("D2") + ":00", programId.ToString() });
                programListView.Items.Add(newEvent);
                toolStripStatusLabel1.Text = "Camp Program <" + programName + "> has been added.";
            }
            addPage.Close();
            programButtonDisable();
        }