/// <summary>
        /// Loads the responses for recipient.
        /// </summary>
        /// <param name="recipientPersonAliasId">The recipient person alias identifier.</param>
        /// <returns></returns>
        private string LoadResponsesForRecipient(int recipientPersonAliasId)
        {
            int?smsPhoneDefinedValueId = hfSmsNumber.ValueAsInt();

            if (smsPhoneDefinedValueId == default(int))
            {
                return(string.Empty);
            }

            var communicationResponseService = new CommunicationResponseService(new RockContext());
            List <CommunicationRecipientResponse> responses = communicationResponseService.GetCommunicationConversation(recipientPersonAliasId, smsPhoneDefinedValueId.Value);

            BindConversationRepeater(responses);

            if (responses.Any())
            {
                var responseListItem = responses.Last();

                if (responseListItem.SMSMessage.IsNullOrWhiteSpace() && responseListItem.BinaryFileGuids != null && responseListItem.BinaryFileGuids.Any())
                {
                    return("Rock-Image-File");
                }

                return(responses.Last().SMSMessage);
            }

            return(string.Empty);
        }
예제 #2
0
        /// <summary>
        /// Loads the responses for recipient.
        /// </summary>
        /// <param name="recipientPersonAliasId">The recipient person alias identifier.</param>
        /// <returns></returns>
        private string LoadResponsesForRecipient(int recipientPersonAliasId)
        {
            int?smsPhoneDefinedValueId = hfSmsNumber.ValueAsInt();

            if (smsPhoneDefinedValueId == default(int))
            {
                return(string.Empty);
            }

            var communicationResponseService = new CommunicationResponseService(new RockContext());
            List <CommunicationRecipientResponse> responses = communicationResponseService.GetCommunicationConversation(recipientPersonAliasId, smsPhoneDefinedValueId.Value);

            BindConversationRepeater(responses);

            if (responses.Any())
            {
                return(responses.Last().SMSMessage);
            }

            return(string.Empty);
        }