/// <summary>
    /// Button event for "Save and add another runner" button
    /// Adds a Dictionary of runner info to the List<Dictionary> of runners
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    /// Jason Vance - 11/23/2012
    protected void btnAddAnotherRunner_Click(object sender, EventArgs e)
    {
        Dictionary<String, String> runnerInfo;
        List<Dictionary<String, String>> runners;
        BusinessTier bt = new BusinessTier();

        try
        {
            // Get the runners on the session
            runners = (List<Dictionary<String, String>>)Session["runners"];
            // If there were no runners on the session, assign a new List to the variable
            if (runners == null)
            {
                runners = new List<Dictionary<String, String>>();
            }

            // Get the runner off the form
            runnerInfo = extractRunnerInfo();

            // Validate the entered information
            DataSet ds = bt.validateRunReg(runnerInfo);
            // If there were problems let the user know
            if (ds.Tables[0].Rows.Count > 0)
            {
                showErrorMessages(ds);
                return; // Get out so the user can fix what's wrong
            }
            else { lblError.Text = ""; }

            // If we're editing an existing runner
            if (hdnEditingRunner.Value == "yes")
            {
                if (!runnerIsDuplicate(runnerInfo))
                {
                    // Replace the old runner with the new runner
                    int index = Convert.ToInt32(hdnNameId.Value);
                    runners[index] = runnerInfo;

                    // reset the hidden fields
                    hdnNameId.Value = "-1";
                    hdnEditingRunner.Value = "no";

                    // Tell the user that editing worked
                    lblFormSuccess.Text = txtFirstName.Text + " was edited";
                }
                else
                {
                    lblError.Text = "This runner is already registered";
                    return;
                }
            }
            else
            {
                if (!runnerIsDuplicate(runnerInfo))
                {
                    // Add the runner to the list of runners
                    runners.Add(runnerInfo);
                    // Tell the user that adding worked
                    lblFormSuccess.Text = txtFirstName.Text + " was added";
                }
                else
                {
                    lblError.Text = "This runner is already registered";
                    return;
                }
            }

            // Put the list of runners back on the session
            Session.Add("runners", runners);

            // Populate our on-going list of runners
            populateRunnersSoFar();

            // empty out appropriate fields for a new runner
            txtFirstName.Text = "";
            txtLastName.Text = "";
            txtNameSuffix.Text = "";
            txtPhoneAreaCode.Text = "";
            txtPhonePrefix.Text = "";
            txtPhoneSuffix.Text = "";
            txtEmail.Text = "";
            txtConfirmEmail.Text = "";
        }
        catch (Exception ex)
        {
            ErrorLog.logError(ex);
            Response.Redirect("Oops.aspx");
        }
    }
    /// <summary>
    /// Button event for "Proceed to checkout" button
    /// Adds the current runner to the list of runners in the session, then registers them
    /// If all goes well, redirects to checkout. Otherwise, informs the user
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    /// Jason Vance - 11/23/2012
    protected void btnProceedToCheckout_Click(object sender, EventArgs e)
    {
        Dictionary<String, String> runnerInfo;
        List<Dictionary<String, String>> runners;
        BusinessTier bt = new BusinessTier();
        DataSet result;

        try
        {
            // Get the runners on the session
            runners = (List<Dictionary<String, String>>)Session["runners"];
            // If there were no runners on the session, assign a new List to the variable
            if (runners == null)
            {
                runners = new List<Dictionary<String, String>>();
            }

            // Get the runner info from the form
            runnerInfo = extractRunnerInfo();

            Session["eventID"] = hdnEventId.Value;

            // Validate the entered information
            DataSet ds = bt.validateRunReg(runnerInfo);
            // If there were problems let the user know
            if (ds.Tables[0].Rows.Count > 0)
            {
                showErrorMessages(ds);
                PresentationHelpers.FocusControlOnPageLoad(lblError.ClientID, this.Page);
                return; // Get out so the user can fix what's wrong
            }
            else { lblError.Text = ""; }

            // If we're editing an existing runner
            if (hdnEditingRunner.Value == "yes")
            {
                if (!runnerIsDuplicate(runnerInfo))
                {
                    // Replace the old runner with the new runner
                    int index = Convert.ToInt32(hdnNameId.Value);
                    runners[index] = runnerInfo;

                    // reset the hidden fields
                    hdnNameId.Value = "-1";
                    hdnEditingRunner.Value = "no";

                    // Tell the user that editing worked
                    lblFormSuccess.Text = txtFirstName.Text + " was edited";
                }
                else
                {
                    lblError.Text = "This runner is already registered";
                    PresentationHelpers.FocusControlOnPageLoad(lblError.ClientID, this.Page);
                    return;
                }
            }
            else
            {
                if (!runnerIsDuplicate(runnerInfo))
                {
                    // Add the runner to the list of runners
                    runners.Add(runnerInfo);
                    // Tell the user that adding worked
                    lblFormSuccess.Text = txtFirstName.Text + " was added";
                }
                else
                {
                    lblError.Text = "This runner is already registered";
                    PresentationHelpers.FocusControlOnPageLoad(lblError.ClientID, this.Page);
                    return;
                }
            }

            // Register the runners
            result = bt.registerRunGroup(runners);

            // If there were problems let the user know
            if (result.Tables[0].Rows.Count > 0)
            {
                showErrorMessages(result);

                // Empty out all fields to avoid registering a runner twice
                emptyFormFields();
                // Let the user know that the runner was added to the list
                populateRunnersSoFar();
            }
            else
            {
                lblError.Text = "";
                // There weren't any problems registering, so send the user to checkout
                Session.Add("regInfo", runners);
                Response.Redirect("Checkout.aspx",false);
            }
        }
        catch (Exception ex)
        {
            ErrorLog.logError(ex);
            Response.Redirect("Oops.aspx");
        }
    }