public Registration CreateRegistration(User curRegisteringUser)
    {
        string connection = ConfigurationManager.ConnectionStrings["EVENTSConnectionString"].ToString();
        SqlConnection dbConnection = new SqlConnection(connection);
        try
        {
            dbConnection.Open();

            List<Conference> registeringConferences = new List<Conference>();
            List<RegistrationLine> lineItemCourses = new List<RegistrationLine>();
            HttpCookie testc = Request.Cookies["CoursesToRegisterFor"];
            foreach (string course in Request.Cookies["CoursesToRegisterFor"].Values)
            {
                Course newCourse = new Course(course);
                if (registeringConferences.ToString().Contains(((Request.Cookies["CoursesToRegisterFor"][course]))))
                {
                    lineItemCourses.Add(new RegistrationLine(newCourse));
                }
                else
                {
                    lineItemCourses.Add(new RegistrationLine(newCourse));
                    registeringConferences.Add(new Conference(Request.Cookies["CoursesToRegisterFor"][course]));
                    newCourse.getCourseInfo();
                }
            }
            if (lineItemCourses.Count > 0)
            {
                Registration thisRegistration = new Registration(curRegisteringUser, lineItemCourses);
                thisRegistration.CalculateCost();

                SqlParameter RegisteringUserParam = new SqlParameter("@REGISTERING_USER", System.Data.SqlDbType.NVarChar, 50);
                RegisteringUserParam.Value = thisRegistration.RegisteringUser.Email;

                SqlParameter CostParam = new SqlParameter("@REGISTRATION_COST", System.Data.SqlDbType.Int);
                CostParam.Value = thisRegistration.Cost;

                SqlParameter registrationID = new SqlParameter("REGISTRATION_ID", System.Data.SqlDbType.Int);
                //parameter value can be set server side and will be returned to client
                registrationID.Direction = System.Data.ParameterDirection.Output;

                SqlCommand createRegistration = new SqlCommand("CREATE_REGISTRATION", dbConnection);

                List<SqlParameter> CreateRegistrationParameters =
                        new List<SqlParameter> { RegisteringUserParam, CostParam, registrationID };

                createRegistration.CommandType = System.Data.CommandType.StoredProcedure;
                createRegistration.Parameters.AddRange(CreateRegistrationParameters.ToArray());

                createRegistration.ExecuteNonQuery();
                thisRegistration.RegistrationID = createRegistration.Parameters["REGISTRATION_ID"].Value.ToString();
                thisRegistration.AddRegistrationLine();
                dbConnection.Close();
                return thisRegistration;
            }
            else
                return new Registration("");
        }
        catch (SqlException exception)
        {
            Response.Write("<p> Error Code " + exception.Number + ": " + exception.Message + "</p>");
            return new Registration("");
        }
    }