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:
parent
d83e360d32
commit
6a325705d7
@ -898,33 +898,43 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
}
|
||||
private Dictionary<string, rochild> _dicROAPID = null;
|
||||
public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault)
|
||||
public rochild? GetROChildByAccPageID(string accPageID, string spDefault, string igDefault)
|
||||
{
|
||||
rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault);
|
||||
if (child == null) return null;
|
||||
if (child == null)
|
||||
{
|
||||
if(Regex.IsMatch(accPageID, @".*\.[A-Z]"))
|
||||
{
|
||||
string accpage = accPageID.Substring(0, accPageID.Length - 3);
|
||||
int index = accPageID.Substring(accPageID.Length - 2, 1)[0] - 'A';
|
||||
child = GetRoChildByAccPagID(accpage, spDefault, igDefault);
|
||||
if (child == null) return null;
|
||||
if (((rochild)child).children != null && ((rochild)child).children.Length > 0 && ((rochild)child).children.Length > index)
|
||||
return ((rochild)child).children[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (((rochild)child).children != null && ((rochild)child).children.Length > 0)
|
||||
return ((rochild)child).children[0].value;
|
||||
string val = ((rochild)child).value;
|
||||
if (val != null) return val;
|
||||
return ((rochild)child).children[0];
|
||||
return null;
|
||||
}
|
||||
public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault)
|
||||
{
|
||||
rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault);
|
||||
if (child == null) return null;
|
||||
return ((rochild)child).value;
|
||||
}
|
||||
public int? GetROTypeByAccPagID(string accPageID, string spDefault, string igDefault)
|
||||
{
|
||||
rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault);
|
||||
rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault);
|
||||
if (child == null) return null;
|
||||
if (((rochild)child).children != null && ((rochild)child).children.Length > 0)
|
||||
return ((rochild)child).children[0].type;
|
||||
return ((rochild)child).type;
|
||||
return null;
|
||||
}
|
||||
public string GetROIDByAccPagID(string accPageID, string spDefault, string igDefault)
|
||||
{
|
||||
rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault);
|
||||
rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault);
|
||||
if (child == null) return null;
|
||||
if (((rochild)child).children != null && ((rochild)child).children.Length > 0)
|
||||
return ((rochild)child).children[0].roid;
|
||||
return ((rochild)child).roid;
|
||||
return null;
|
||||
}
|
||||
public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -538,7 +538,8 @@ namespace Volian.Controls.Library
|
||||
string accPrefix = db.dbiAP.Replace(_Mydvi.DocVersionConfig.RODefaults_graphicsprefix,"IG");
|
||||
accPrefix = accPrefix.Replace(_Mydvi.DocVersionConfig.RODefaults_setpointprefix, "SP");
|
||||
// string accPrefix = (roch.type == 8) ? _Mydvi.DocVersionConfig.RODefaults_graphicsprefix : _Mydvi.DocVersionConfig.RODefaults_setpointprefix;
|
||||
string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid);// makes <SP1-A.1> for example
|
||||
string suffix = roch.roid.Substring(12, 4) == "0041" ? "" : "." + ((char)Convert.ToInt32(roch.roid.Substring(12, 4), 16)).ToString();
|
||||
string AccPageID = string.Format("<{0}-{1}{2}>", accPrefix, roch.appid, suffix);// makes <SP1-A.1.B> for example
|
||||
Console.WriteLine(AccPageID);
|
||||
//string AccPageID = string.Format("{0} <{1}-{2}>", ConvertSymbolsAndStuff(selectedChld.value), accPrefix, roch.appid); // value and accesory ID
|
||||
//string AccPageID = string.Format("{0} {1}", ConvertSymbolsAndStuff(selectedChld.value), string.Format(@"#Link:ReferencedObject:<NewID> {0} {1}", roch.roid, _MyROFST.MyRODb.RODbID)); // value and link reference
|
||||
|
Loading…
x
Reference in New Issue
Block a user