Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string PCardRTFtoPDF(
- string sId,
- SqlConnection dbConnection1,
- string sAppType,
- string sFilenameId)
- {
- string str1 = "E:\\VS\\";
- using (dbConnection1)
- {
- dbConnection1.Open();
- using (SqlCommand sqlCommand = new SqlCommand("InputData_SelectByInputMainId", dbConnection1))
- {
- sqlCommand.CommandType = CommandType.StoredProcedure;
- sqlCommand.Parameters.Add(new SqlParameter("InputMainId", (object) sId));
- SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
- StreamReader streamReader = new StreamReader(str1 + "PCARD_Template" + sAppType + "_V6.rtf");
- string str2 = streamReader.ReadToEnd();
- streamReader.Close();
- while (sqlDataReader.Read())
- {
- string str3 = sqlDataReader["ControlId"].ToString();
- string newValue = sqlDataReader["ControlValue"].ToString();
- if (str3 == "rblApplicationType")
- {
- if (!(sAppType == "0"))
- {
- if (!(sAppType == "1"))
- {
- if (!(sAppType == "2"))
- {
- if (!(sAppType == "4"))
- {
- if (!(sAppType == "5"))
- {
- if (sAppType == "6")
- newValue = "Renewal - Liaison";
- }
- else
- newValue = "Renewal - Departmental";
- }
- else
- newValue = "Renewal - Individual";
- }
- else
- newValue = "Liaison";
- }
- else
- newValue = "Departmental";
- }
- else
- newValue = "Individual";
- }
- else if (str3 == "tbMMNP" && newValue.Length > 0)
- newValue = "*****";
- else if (str3 == "tbDOB" && newValue.Length > 0)
- newValue = "*****";
- else if (str3 == "tbCardholdersList")
- newValue = newValue.Replace('\r', ';').Replace('\n', ' ');
- str2 = str2.Replace("[" + str3 + "]", newValue);
- }
- sqlDataReader.Close();
- string str4 = str2.Replace("[TodayDate]", DateTime.Now.ToShortDateString());
- string str5 = "PCardAppOutput" + sId + sFilenameId + ".rtf";
- StreamWriter streamWriter = new StreamWriter(str1 + str5);
- streamWriter.Write(str4);
- streamWriter.Close();
- return str5.Replace(".rtf", ".pdf");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement