replace back quote and other special character in RO values during data conversion

This commit is contained in:
2009-09-01 13:03:25 +00:00
parent 47d6925187
commit efe1ddf609
3 changed files with 176 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ namespace DataLoader
{
public partial class Loader
{
private string MigrateRos(OleDbConnection cn, string textm, string seqcvt, Content content, DocVersion docver)
private string MigrateRos(OleDbConnection cn, string textm, string seqcvt, Content content, DocVersion docver, bool conv_caret)
{
StringBuilder rotxt = new StringBuilder();
int instance = 0;
@@ -65,10 +65,19 @@ namespace DataLoader
try
{
string rov = rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper());
//jsj string rov = TextConvert.ConvertText(rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()));
//string results = string.Format(@"{0}{1}\v #Link:ReferencedObject:{2} {3} {4}\v0",
// '\x15', rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()), ro.ROUsageID, ROID, rodb.RODbID);
string results = string.Format(@"\v <START]\v0 {0}\v #Link:ReferencedObject:{1} {2} {3}\v0 \v [END>\v0 ",
rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()), ro.ROUsageID, ROID, rodb.RODbID);
// TODO: NEED TO PASS IN ConvertCaret FORMAT FLAG
string roval = TextConvert.ReplaceUnicode(rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()), conv_caret);
//if (roval.Contains("\r") || roval.Contains("\n"))
// Console.WriteLine("RO has new Lines");
//string results = string.Format(@"\v <START]\v0 {0}\v #Link:ReferencedObject:{1} {2} {3}\v0 \v [END>\v0 ",
// rofstinfo.ROFSTLookup.GetRoValue(ROID.Substring(0, 12).ToUpper()), ro.ROUsageID, ROID, rodb.RODbID);
string results = string.Format(@"\v <START]\v0\cf1 {0}\cf0\v #Link:ReferencedObject:{1} {2} {3}\v0 \v [END>\v0 ",
roval.Replace("\r\n","\\par\r\n"), ro.ROUsageID, ROID, rodb.RODbID);
rotxt.Append(results);
}
catch (Exception ex)