Ejemplo n.º 1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            // new style of view for events if submit is clicked
            btnShowEvents.Show();
            textBoxId.Focus();
            btnShowEvents.Text = "Show All Events";
            lblMessage.Show();
            int id;

            if (int.TryParse(textBoxId.Text, out id))
            {
                string events = currentCoord.getEventInfoById(id);
                if (currentCoord.eventExists(id))
                {
                    // will show new headers for event to display in depth details
                    labelEventTitle.Text   = "ID: " + id;
                    labelFirstColumn.Text  = "Event Name";
                    labelSecondColumn.Text = "Venue Name";
                    labelThirdColumn.Text  = "Date and Time";
                    string[] eventFields = events.Split(';');
                    labelRegistered.Show();
                    labelAvailable.Show();
                    textBoxId.Hide();
                    btnSubmit.Hide();
                    btnAttendingCus.Show();
                    lblMessage.Hide();
                    labelFirstColumnInfo.Text  = eventFields[1];
                    labelSecondColumnInfo.Text = eventFields[2];
                    labelThirdColumnInfo.Text  = eventFields[3];
                    labelRegisteredInfo.Text   = eventFields[4];
                    labelAvailablesInfo.Text   = eventFields[5];
                }
                else
                {
                    clearEvents();
                    lblMessage.Text = events;
                }
            }
            else
            {
                clearEvents();
                lblMessage.Text = "Invalid input for ID search";
            }
        }
Ejemplo n.º 2
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            btnShowEvents.Show();
            lblMessage.Show();
            clearEvents();
            int id;

            if (int.TryParse(textBoxId.Text, out id))
            {
                if (currentCoord.eventExists(id))
                {
                    // change to event view for deletion confirmation
                    string events = currentCoord.getEventInfoById(id);
                    labelBookings.Text = "Bookings";
                    labelDateTime.Text = "Date/Time";
                    string[] eventFields = events.Split(';');
                    labelNumberInfo.Text   = eventFields[0];
                    labelEventInfo.Text    = eventFields[1];
                    labelVenueInfo.Text    = eventFields[2];
                    labelDateTimeInfo.Text = eventFields[3];
                    labelBookingsInfo.Text = eventFields[4];
                    lblMessage.Text        = "Are you sure you want to delete the event with ID " + id + "?";
                    btnConfirm.Show();
                    btnDeny.Show();
                    textBoxId.Hide();
                    labelEventId.Hide();
                    btnSubmit.Hide();
                }
                else
                {
                    lblMessage.Text = "Event with ID " + id + " was not found..";
                }
            }
            else
            {
                lblMessage.Text = "Invalid input for ID search";
            }
        }