public static string GetEfilingRejectionLetter(string taxRefNo, int year, decimal submissionId) { var templatesPath = HttpContext.Current.Request.PhysicalApplicationPath; if (templatesPath == null) { return(null); } var rejectionTemplate = Path.Combine(templatesPath, "letters", Configurations.RejectionLetterTemplate); if (!File.Exists(rejectionTemplate)) { return(null); } var content = File.ReadAllText(rejectionTemplate); var files = DBReadManager.GetDeclinedFilesForSsubmission(submissionId); if (!files.HasRows) { return(null); } var builder = new StringBuilder(); //builder.Append("<ul>"); foreach (DataRow dataRow in files.Tables[0].Rows) { builder.AppendFormat("<br />-<span style=\"xfa - spacerun:yes;\"> {0} / {1}</span>", dataRow["Category"], dataRow["Classification"]); } //builder.Append("</ul>"); return(string.Format(content, year, builder)); }