public ActionResult AddGuest(Guest guest)
        {
            //bool shouldKeepGenerating = true;
            //string newID = rsvpIdGenerator.GetNewRsvpId();
            //while (shouldKeepGenerating)
            //{
            //    if (DAL.CountStatement(SqlStatements.CheckIfRsvpIdExistsSQL(), SqlStatements.CheckIfRsvpIdExistsParameters(newID)) == 0)
            //    {
            //        shouldKeepGenerating = false;
            //    }
            //    else
            //    {
            //        newID = rsvpIdGenerator.GetNewRsvpId();
            //    }
            //}
            //guest.RsvpId = newID;
            //if(DAL.InsertOrUpdate(SqlStatements.InsertNewGuestSQL(), SqlStatements.InsertOrUpdateGuestParameters(guest)) == 1)
            //{
            //    ViewBag.SuccessMessage = "Guest successfully added: " + guest.Name;
            //    return View();
            //}
            //else
            //{
            //    ViewBag.FailureMessage = "Failed to add guest! Contact Zach!";
                return View(guest);
            //}

            
        }
        public ActionResult EditGuest(Guest guest)
        {
            if (DAL.InsertOrUpdate(SqlStatements.UpdateGuestSQL(), SqlStatements.InsertOrUpdateGuestParameters(guest)) == 1)
            {
                ViewBag.SuccessMessage = "Guest Successfully Updated!";
            }
            else
            {
                ViewBag.FailureMessage = "Update Failed! Contact Zach.";
            }

            return View(guest);
        }
        public static DataTable InsertOrUpdateGuestParameters(Guest guest)
        {
            DataTable dtParameters = new DataTable();
            //dtParameters.Columns.Add("Parameter");
            //dtParameters.Columns.Add("Value");
            //dtParameters.Rows.Add("@Name", guest.Name);
            //dtParameters.Rows.Add("@Email", guest.Email);
            //dtParameters.Rows.Add("@emailComment", guest.CommentForEmailSent);
            //dtParameters.Rows.Add("@rsvpComment", guest.CommentFromRSVP);
            //dtParameters.Rows.Add("@rsvpId", guest.RsvpId);
            //dtParameters.Rows.Add("@numPeopleAllowed", guest.NumPeopleAllowed);
            //dtParameters.Rows.Add("@numPeopleAttending", guest.NumPeopleAttending);
            //dtParameters.Rows.Add("@hasRSVPed", guest.HasRSVPed ? 1 : 0);
            //dtParameters.Rows.Add("@isAttending", guest.IsAttending ? 1 : 0);

            return dtParameters;
        }
        public ActionResult GuestRSVP(Guest guest)
        {
            //Guest newGuest;   
            //// check if guest has already rsvped, if not, allow post and redirect to success page
            //using (DataTable dtGuest = DAL.SelectStatement(SqlStatements.CheckIfRsvpIdHasAlreadyRespondedSQL(), SqlStatements.CheckIfRsvpIdHasAlreadyRespondedParameters(guest.RsvpId)))
            //{
            //    if(dtGuest.Rows.Count > 0)
            //    {
            //        newGuest = new Guest(dtGuest.Rows[0]);

            //        if(newGuest.HasRSVPed == true)
            //        {
            //            // guest has already rsvped, tell them so
            //            ViewBag.FailureMessage = "This Code Has Already RSVPed. If you need to change your RSVP, contact us.";
            //        }
            //        else
            //        {
            //            // update guest record in database
            //            newGuest.HasRSVPed = true;
            //            newGuest.IsAttending = guest.IsAttending;
            //            newGuest.CommentFromRSVP = guest.CommentFromRSVP;
            //            DAL.InsertOrUpdate(SqlStatements.UpdateGuestSQL(), SqlStatements.InsertOrUpdateGuestParameters(newGuest));
            //            ViewBag.SuccessMessage = "Thank you for RSVPing! Your choice has been saved and you will not be able to change it without contacting us.";
            //        }
            //    }
            //    else
            //    {
            //        // rsvp id does not exist in the database, alert the user
            //        ViewBag.FailureMessage = "RSVP Code Not Found.";
            //    }
            //}
            // if already rsvped, throw an error saying so

            // return RedirectToAction("RSVP", "RSVP");
            return View();
        }
        public ActionResult GuestRSVP()
        {
            Guest guest = new Guest();

            return View(guest);
        }