static readonly string m_smptySpace      = "          ";//This is basically for keep seperate PSS-URL from basic information of SMS
        /// <summary>
        /// This method will return complete 'SMS' Text according to the template and given Booking XML/Planned contact  XML
        /// </summary>
        /// <param name="bookingXml">Planned Contact XML</param>
        /// <param name="smsTextTemplate">Template Text selected for SMS</param>
        /// <param name="smsTemplateTagList">List of Tags for SMS template</param>
        /// <param name="pssLink">Link to download PSS </param>
        /// <param name="isPssAtached">bool is need to attached PSS link</param>
        /// <returns></returns>
        public static string GetCompleteSmsText(XmlDocument bookingXml, string smsTextTemplate, List <TagItem> smsTemplateTagList, string pssLink, bool isPssAtached)
        {
            var tagDictonary       = LoadTextTemplateIncludedTagList(smsTextTemplate);
            var tagResultDictonary = LoadTagWithValue(tagDictonary, smsTemplateTagList, bookingXml);
            var templateTextStr    = smsTextTemplate;

            foreach (var tagItem in tagDictonary)
            {
                var value  = tagResultDictonary.FirstOrDefault(t => t.Key == tagItem.Name);
                var result = value.Value;
                var fulTag = m_tagStartdString + tagItem.Name + m_tagEndString;
                if (tagItem.value.Length > 0)
                {
                    //result = ApplyFunction(result, tagItem.Value);
                    result = TagFormater.GetFormatString(tagItem.value, result);
                    fulTag = m_tagStartdString + tagItem.Name + ":" + tagItem.value + m_tagEndString;
                }
                templateTextStr = templateTextStr.Replace(fulTag, result);
            }
            if (isPssAtached)
            {
                templateTextStr = templateTextStr + m_smptySpace + GetPSSLinkAttachedwithHospitalID(pssLink, smsTemplateTagList, bookingXml);
            }
            return(templateTextStr);
        }
예제 #2
0
 public string ApplyFunction(string value, string functionCode)
 {
     return(TagFormater.GetFormatString(functionCode, value));
 }