This commit is contained in:
2011-03-01 13:20:03 +00:00
parent 7704e926df
commit 5802cfdd10
2 changed files with 49 additions and 10 deletions

View File

@@ -41,8 +41,9 @@ namespace VEPROMS.CSLA.Library
}
}
}
public void FixContentText(RoUsageInfo rousg, string newvalue)
public void FixContentText(RoUsageInfo rousg, ROFSTLookup.rochild roch, ROFstInfo origROFstInfo) // string newvalue)
{
string newvalue = roch.value;
string lookFor = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID);
Match m = Regex.Match(Text, lookFor,RegexOptions.Singleline);
if (m != null && m.Groups.Count > 1)
@@ -54,13 +55,24 @@ namespace VEPROMS.CSLA.Library
// see if there is a grid to update too.
if (rousg.MyContent.MyGrid != null)
{
string lookForXml = string.Format(@"&lt;START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END&gt;", rousg.ROUsageID);
Match mg = Regex.Match(MyGrid.Data, lookForXml);
if (mg != null && mg.Groups.Count > 1)
if (roch.type == (int)E_ROValueType.Table) // if change in rotable data...
{
System.Text.RegularExpressions.Group g = mg.Groups[3];
if (g.ToString() != newvalue)
MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + newvalue + MyGrid.Data.Substring(g.Index + g.Length);
List<string> retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data));
if (Text != retlist[0])Text = retlist[0];
if (MyGrid.Data != retlist[1]) MyGrid.Data = retlist[1];
}
else
{
// if it's an ro within a table, need to process into an flex grid to save the grid data:
string lookForXml = string.Format(@"&lt;START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END&gt;", rousg.ROUsageID);
Match mg = Regex.Match(MyGrid.Data, lookForXml);
if (mg != null && mg.Groups.Count > 1)
{
System.Text.RegularExpressions.Group g = mg.Groups[3];
if (g.ToString() != newvalue)
MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + newvalue + MyGrid.Data.Substring(g.Index + g.Length);
}
}
}
}