Added logic to find Multi-Return values when info is retrieved for Multi-Return Value ROs.

Refresh DocumentDRoUsages before saving
Delete "Old" DRoUsages when saving
Replace hardspace in value
Replace xB3 with unicode of superscript 3.
Added ability to DisplayRO to add Multi-Return Values in an MS Word Section
This commit is contained in:
Rich
2013-01-15 19:35:29 +00:00
parent d83e360d32
commit 6a325705d7
3 changed files with 38 additions and 16 deletions

View File

@@ -29,16 +29,20 @@ namespace VEPROMS.CSLA.Library
}
public void UpdateDRoUsages(List<string> roids)
{
if (DocumentDROUsageCount > 0)
_DocumentDROUsageCount = -1;
if (DocumentDROUsages.Count > 0)
{
List<DocumentDROUsage> delList = new List<DocumentDROUsage>();
foreach (DocumentDROUsage myUsage in DocumentDROUsages)
{
string roidkey = string.Format("{0}:{1}", myUsage.RODbID, myUsage.ROID);
if (roids.Contains(roidkey))
roids.Remove(roidkey);// If in both, nothing to do
else
myUsage.MyDROUsage.Delete(); // If only in old, remove it
delList.Add(myUsage);
}
foreach (DocumentDROUsage myUsage in delList)
DocumentDROUsages.Remove(myUsage); // If only in old, remove it
}
foreach (string roidkey in roids)
{
@@ -936,6 +940,9 @@ namespace VEPROMS.CSLA.Library
// Only in Word sections, convert the # to superscripts and ~ to subscrtipts
tmp = Regex.Replace(tmp, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript
tmp = Regex.Replace(tmp, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript
tmp = tmp.Replace(@"\u160?", "\xA0");
tmp = tmp.Replace(@"\U160?", "\xA0");
tmp = tmp.Replace(@"[xB3]", "\xB3");
// Look for superscript or subscript and insert the appropriate commands
Match roMatch = Regex.Match(tmp, @"(.*?)\\(up2|dn2) (.*?)\\(up0|dn0) ");
if (roMatch.Groups.Count == 5)// Superscript or subscript found
@@ -956,6 +963,10 @@ namespace VEPROMS.CSLA.Library
}
else // if no superscripts or subscripts just output the text
{
roValue = roValue.Replace(@"\u160?", "\xA0");
roValue = roValue.Replace(@"\U160?", "\xA0");
roValue = roValue.Replace(@"[xB3]", "\xB3");
roValue = roValue.Replace(@"[XB3]", "\xB3");
sel.Text = roValue;
sel.Font.Color = LBWdColor.wdColorRed;
}