B2019-076: support for folder/working draft level proc set specific info (moved code from VlnSvgPageHelper to here)

B2019-076: support for folder/working draft level proc set specific info & C2019-023: default values on outside transitions SI
B2019-076: make folder/working draft level proc set specific info consistent
B2019-076: Move GetInheritedSIValue from here to DocVersionExt.cs so it is accessible from TransitionExt.cs
This commit is contained in:
2019-05-21 12:34:47 +00:00
parent aaf2c74371
commit 311d442b57
4 changed files with 72 additions and 36 deletions

View File

@@ -859,6 +859,30 @@ namespace VEPROMS.CSLA.Library
return _UnitNames;
}
}
#region Proc Set Specific info support
public static string GetInheritedSIValue(ProcedureInfo pi, string fieldName)
{
string val = null;
DocVersionConfig dvConfig = new DocVersionConfig(pi.MyDocVersion.Config);
if (dvConfig != null)
{
val = dvConfig.GetValue("SI", fieldName);
if (val != null && val != "") return val; // the value exists within the docversion level
}
FolderInfo fi = pi.MyDocVersion.MyFolder;
while (fi != null)
{
FolderConfig folderConfig = new FolderConfig(fi.Config);
if (folderConfig != null)
{
val = folderConfig.GetValue("SI", fieldName);
if (val != null && val != "") return val; // the value exists within this folder
}
fi = fi.ActiveParent as FolderInfo;
}
return val;
}
#endregion
}
#region VersionPastingPartCriteria
[Serializable()]

View File

@@ -966,13 +966,23 @@ namespace VEPROMS.CSLA.Library
int indxcn = str.IndexOf(":");
string pt1 = str.Substring(1, indxcn - 1);
string pt2 = str.Substring(indxcn+1, str.Length - 2 - indxcn);
string defval = null;
if (pt2.IndexOf('|')>-1) // C2019-023: allow default value on outside transition proc set specific info data
{
if (pt2.Length>pt2.IndexOf('|')+1) defval = pt2.Substring(pt2.IndexOf('|')+1);
pt2 = pt2.Substring(0, pt2.IndexOf('|'));
}
string add = null;
if (pt1.StartsWith("SI")) // SI fields go to the folder specific information
add = fc.GetValue(pt1, pt2);
if (pt1.StartsWith("SI")) // B2019-076: SI fields go to the procedure set specific information (folder or working draft level, SI)
add = DocVersionInfo.GetInheritedSIValue(tb._ToItem.MyProcedure, pt2);
else
add = pc.GetValue(pt1, pt2);
if (add == null || add == "") foundnull = true; // don't do prefix if any of the fields are null.
else repStr.Add(str, add);
if (add == null || add == "")
{
if (defval != null) add = defval;
else foundnull = true; // don't do prefix if any of the fields are null and don't have a default value
}
if (!foundnull) repStr.Add(str, add);
}
if (!foundnull)
{