Make the change list the default selected tab

If WalkProcedure or Update History is called with a null, reset the contents and return
Fix the section title
This commit is contained in:
Rich
2011-08-02 19:40:35 +00:00
parent 7ec5ca5555
commit d8f76dcbd3
2 changed files with 27 additions and 8 deletions

View File

@@ -205,7 +205,7 @@ namespace Volian.Print.Library
foreach (ContentAuditInfo cai in AuditList)
{
//raw path
string[] NewPath = Regex.Replace(cai.Path + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
string[] NewPath = SplitPath(cai.Path);
if (NewPath[0] != section)
{
section = NewPath[0];
@@ -530,18 +530,26 @@ namespace Volian.Print.Library
}
doc.Add(t);
}
private static string[] SplitPath(string path)
{
// Remove Procedure Number and Title
string sectionAndStep = Regex.Replace(path + "\x7\x7\x7", "^.+?\\u0007", "");
sectionAndStep = sectionAndStep.Replace("\x11", sectionAndStep[0] == '\x11' ? "" : " - ");
// Split Section frrom Steps
return sectionAndStep.Split("\x7".ToCharArray());
}
private string[] GetNewPath(ContentAuditInfoList AuditList, int contentID)
{
foreach (ContentAuditInfo cai in AuditList)
{
if(cai.ContentID == contentID)
return Regex.Replace(cai.Path + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
return SplitPath(cai.Path);
}
ItemInfoList iil = ItemInfoList.GetByContentID(contentID);
if (iil.Count > 0)
{
return Regex.Replace(iil[0].SearchPath + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
return SplitPath(iil[0].SearchPath);
}
return "Section\x7Step".Split("\x7".ToCharArray());
}
@@ -555,7 +563,7 @@ namespace Volian.Print.Library
List<ContentAuditInfo> auditList = new List<ContentAuditInfo>();
foreach (ContentAuditInfo cai in AuditList)
{
string[] NewPath = Regex.Replace(cai.Path + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
string[] NewPath = SplitPath(cai.Path);
if (NewPath[1] != stepnum)
{
stepnum = NewPath[1];
@@ -680,7 +688,7 @@ namespace Volian.Print.Library
foreach (ContentAuditInfo cai in auditList)
{
//raw path
string[] NewPath = Regex.Replace(cai.Path + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
string[] NewPath = SplitPath(cai.Path);
if (NewPath[0] != section)
{
section = NewPath[0];
@@ -787,7 +795,7 @@ namespace Volian.Print.Library
{
if (cai.ContentID == aai.IContentID)
{
string[] NewPath = Regex.Replace(cai.Path + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
string[] NewPath = SplitPath(cai.Path);
if (NewPath[1] != stepnum)
{
stepnum = NewPath[1];
@@ -1017,7 +1025,7 @@ namespace Volian.Print.Library
foreach (ContentAuditInfo cai in auditList)
{
//raw path
string[] NewPath = Regex.Replace(cai.Path + "\x7\x7\x7", "^..+?\\u0007.", "").Split("\x7".ToCharArray());
string[] NewPath = SplitPath(cai.Path);
if (NewPath[0] != section)
{
section = NewPath[0];