コード例 #1
0
        private static string doFieldReplacement(string htmlBodyNoHeader, Data_AppUserFile user)
        {
            string strActivationDate = (new DateTime(user.CreationDate)).ToString("dd MMMM yyyy");

            htmlBodyNoHeader = htmlBodyNoHeader
                               .Replace("{SentCount}", user.SentCount().ToString())
                               .Replace("{User}", System.Web.HttpUtility.HtmlEncode(user.UserName))
                               .Replace("{RegistrationDate}", System.Web.HttpUtility.HtmlEncode(strActivationDate))
                               .Replace("{Name}", System.Web.HttpUtility.HtmlEncode(user.UserName))
                               .Replace("{Email}", System.Web.HttpUtility.HtmlEncode(user.Email))
                               .Replace("{Password}", System.Web.HttpUtility.HtmlEncode(user.Password))
                               .Replace("{APIId}", System.Web.HttpUtility.HtmlEncode(user.ApiGuId))
                               .Replace("{Mobile1}", System.Web.HttpUtility.HtmlEncode(user.MobileNumberX(0)))
                               .Replace("{Mobile2}", System.Web.HttpUtility.HtmlEncode(user.MobileNumberX(1)))
                               .Replace("{Mobile3}", System.Web.HttpUtility.HtmlEncode(user.MobileNumberX(2)))
                               .Replace("{Mobile4}", System.Web.HttpUtility.HtmlEncode(user.MobileNumberX(3)))
                               .Replace("{Mobile5}", System.Web.HttpUtility.HtmlEncode(user.MobileNumberX(4)))
                               .Replace("{NiceAPI_Number}", System.Web.HttpUtility.HtmlEncode(System.Configuration.ConfigurationManager.AppSettings["NiceAPI_Number"]));
            return(htmlBodyNoHeader);
        }