public List <Survey_Result> GetAllSurveys()
        {
            List <Survey_Result> output = new List <Survey_Result>();

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();
                SqlCommand    cmd    = new SqlCommand(SQL_GetAllSurveys, conn);
                SqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    Survey_Result sr = new Survey_Result();

                    sr.Id            = Convert.ToInt32(reader["surveyId"]);
                    sr.ParkCode      = Convert.ToString(reader["parkCode"]);
                    sr.Email         = Convert.ToString(reader["emailAddress"]);
                    sr.State         = Convert.ToString(reader["state"]);
                    sr.ActivityLevel = Convert.ToString(reader["activityLevel"]);

                    output.Add(sr);
                }
            }

            return(output);
        }
        public bool AddResult(Survey_Result result)
        {
            bool output;

            try
            {
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    SqlCommand cmd = new SqlCommand(SQL_AddResult, conn);
                    cmd.Parameters.AddWithValue("@parkCode", result.ParkCode);
                    cmd.Parameters.AddWithValue("@email", result.Email);
                    cmd.Parameters.AddWithValue("@state", result.State);
                    cmd.Parameters.AddWithValue("@activityLevel", result.ActivityLevel);

                    cmd.ExecuteNonQuery();
                }
                output = true;
            }
            catch
            {
                output = false;
            }

            return(output);
        }
        public IActionResult Survey(Survey_Result surveyResult)
        {
            surveyResult.State = surveyResult.State.ToUpper();
            survey_ResultDAL.AddResult(surveyResult);

            return(RedirectToAction("SurveyResults"));
        }