public IHttpActionResult PutTripActivity(int id, TripActivity tripActivity)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != tripActivity.Id)
            {
                return BadRequest();
            }

            db.Entry(tripActivity).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TripActivityExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
        public IHttpActionResult PostTripActivity(TripActivity tripActivity)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            //TripComment comment = new TripComment();
            //comment.Date = DateTime.UtcNow;
            //comment.TripUserId = tripActivity.TripUserId;
            //comment.Comment = "suggested an activity - " + tripActivity.Activity;

            //db.TripComments.Add(comment);

            db.TripActivities.Add(tripActivity);
            db.SaveChanges();

            var tripUsers = db.TripUsers.Where(r => r.Id == tripActivity.TripUserId).Select(r => r.Id).ToList();

            var notifyIds = db.PushRegistrations.Where(r => tripUsers.Contains(r.TripUserId)).Select(r => r.RegistrationId);

            var tripUser = db.TripUsers.Include("Trip").FirstOrDefault(r => r.Id == tripActivity.TripUserId);

            foreach (string notifyId in notifyIds)
            {
                var unused = Common.SendGms(notifyId, tripUser.Id.ToString(), tripUser.TripId.ToString(), tripUser.DisplayName + " suggested an Activity!", tripActivity.Activity,
                    "activities", tripUser.Trip.Code, tripUser.TripCode, tripUser.DisplayName, tripUser.Trip.Destination);
            }

            foreach (var tu in db.TripUsers.Where(r => r.TripId == tripActivity.TripId))
            {

                var message = tripUser.DisplayName + " suggested a new Activity for your trip to " + tripUser.Trip.Destination + "!";
                message += "\ntripsieappweb.azurewebsites.net/Trip/ActivityDetails/" + tripActivity.Id + "/" + "?code=" + tu.TripCode;

                if (tu.Phone != null)
                {
                    Common.SendSms(tu.Phone, message);
                }

            }

            return CreatedAtRoute("DefaultApi", new { id = tripActivity.Id }, tripActivity);
        }