public EventPlannerNotification GetInvitationAcceptedNotification(int eventId, int acceptingId)
        {
            var notification = new EventPlannerNotification();

            var theEvent = _eventRepository.GetAll().IncludeAll("Coordinator").FirstOrDefault(x => x.EventId == eventId);
            var thePerson = _personRepository.GetAll().FirstOrDefault(x => x.PersonId == acceptingId);
            var personName = GetPersonName(thePerson);

            var foodItemsText = "";
            var gamesText = "";

            notification.SendToFacebook = theEvent.Coordinator.NotifyWithFacebook;
            notification.SendToEmail = theEvent.Coordinator.NotifyWithEmail;
            notification.PersonId = theEvent.Coordinator.PersonId;
            notification.Email = theEvent.Coordinator.Email;
            notification.FacebookId = theEvent.Coordinator.FacebookId;

            //Set up the text stuff
            notification.Title = Constants.MESSAGE_ACCEPT_TITLE;
            notification.Message = string.Format(Constants.MESSAGE_ACCEPT_TEMPLATE, personName,
                                                 theEvent.Title, theEvent.StartDate.ToShortDateString(),
                                                 theEvent.StartDate.ToShortTimeString(),
                                                 foodItemsText, gamesText);

            return notification;
        }
        public EventPlannerNotification GetInvitationDeclinedNotification(int eventId, int decliningId)
        {
            var notification = new EventPlannerNotification();

            var theEvent = _eventRepository.GetAll().IncludeAll("Coordinator").FirstOrDefault(x => x.EventId == eventId);
            var thePerson = _personRepository.GetAll().FirstOrDefault(x => x.PersonId == decliningId);

            //How does the coordinator want to be notified?
            notification.SendToFacebook = theEvent.Coordinator.NotifyWithFacebook;
            notification.SendToEmail = theEvent.Coordinator.NotifyWithEmail;
            notification.PersonId = theEvent.Coordinator.PersonId;
            notification.Email = theEvent.Coordinator.Email;
            notification.FacebookId = theEvent.Coordinator.FacebookId;

            //Set up the text stuff...
            var personName = GetPersonName(thePerson);

            notification.Title = Constants.MESSAGE_DECLINE_TITLE;
            notification.Message = string.Format(Constants.MESSAGE_DECLINE_TEMPLATE, personName,
                                                 theEvent.Title, theEvent.StartDate.ToShortDateString(),
                                                 theEvent.StartDate.ToShortTimeString());

            return notification;
        }
        public EventPlannerNotification GetNewInvitationNotification(int eventId, int registeredId, int nonRegisteredId, string invitationUrl)
        {
            var notification = new EventPlannerNotification();

            var theEvent = _eventRepository.GetAll().FirstOrDefault(x => x.EventId == eventId);
            var registeredPerson = _personRepository.GetAll().FirstOrDefault(x => x.PersonId == registeredId);
            var nonRegisteredPerson = _invitationRepository.GetAll().FirstOrDefault(x => x.PendingInvitationId == nonRegisteredId);
            var coordinatorName = GetPersonName(theEvent.Coordinator);

            notification.SendToFacebook = (registeredPerson != null) ? registeredPerson.NotifyWithFacebook : (nonRegisteredPerson.FacebookId != null);
            notification.SendToEmail = (registeredPerson != null) ? registeredPerson.NotifyWithEmail : (nonRegisteredPerson.Email != null);
            notification.Email = (registeredPerson != null) ? registeredPerson.Email : nonRegisteredPerson.Email;
            notification.FacebookId = (registeredPerson != null) ? registeredPerson.FacebookId : nonRegisteredPerson.FacebookId;
            notification.Title = Constants.MESSAGE_NEW_TITLE;
            notification.Message = string.Format(Constants.MESSAGE_NEW_TEMPLATE, coordinatorName,
                                                 theEvent.Title, theEvent.StartDate.ToShortDateString(),
                                                 theEvent.StartDate.ToShortTimeString(),
                                                 invitationUrl);

            return notification;
        }
        public EventPlannerNotification GetNotificationForEventUpdate(int eventId, int registeredId, int nonRegisteredId)
        {
            var theEvent = _eventRepository.GetAll().IncludeAll("Coordinator").FirstOrDefault(x => x.EventId == eventId);
            var registeredPerson = _personRepository.GetAll().FirstOrDefault(x => x.PersonId == registeredId);
            var nonRegisteredPerson =
                _invitationRepository.GetAll().FirstOrDefault(x => x.PendingInvitationId == nonRegisteredId);

            var coordinatorName = GetPersonName(theEvent.Coordinator);
            var notification = new EventPlannerNotification
                {
                    SendToFacebook = (registeredPerson != null) ? registeredPerson.NotifyWithFacebook : (nonRegisteredPerson.FacebookId != null),
                    SendToEmail = (registeredPerson != null) ? registeredPerson.NotifyWithEmail : (nonRegisteredPerson.Email != null),
                    Email = (registeredPerson != null) ? registeredPerson.Email : nonRegisteredPerson.Email,
                    FacebookId = (registeredPerson != null) ? registeredPerson.FacebookId : nonRegisteredPerson.FacebookId,
                    Message = string.Format(Constants.MESSAGE_UPDATE_TEMPLATE,
                                            theEvent.Title, coordinatorName,
                                            theEvent.StartDate.ToShortDateString(),
                                            theEvent.StartDate.ToShortTimeString()),
                    Title = Constants.MESSAGE_UPDATE_TITLE
                };

            return notification;
        }