Added new feature to keep Background Document and Deviation Documents in Sync as the user moves through the procedure.

Added the ability for the Set Admin to use Admin Tools
This commit is contained in:
Rich 2015-09-12 15:42:05 +00:00
parent 14e0d8c756
commit ba94c537cc
2 changed files with 40 additions and 6 deletions

View File

@ -66,7 +66,7 @@
<appSettings>
<add key="OperatingMode" value="Debug" />
<!--"Debug" "Production" "Demo"/-->
<add key ="OriginalPageBreak" value="False"/>
<add key="OriginalPageBreak" value="False"/>
<add key="CslaAuthentication" value="Windows" />
<!--
<add key="CslaDataPortalProxy"
@ -157,6 +157,15 @@
<setting name="UpdateSettings" serializeAs="String">
<value>True</value>
</setting>
<setting name="PasteNoReturns" serializeAs="String">
<value>False</value>
</setting>
<setting name="PastePlainText" serializeAs="String">
<value>False</value>
</setting>
<setting name="SyncEnhancedDocuments" serializeAs="String">
<value>True</value>
</setting>
</VEPROMS.Properties.Settings>
<UISampleNetBar1.Properties.Settings>
<setting name="ShowDefaultFolderProp" serializeAs="String">

View File

@ -50,6 +50,7 @@ namespace VEPROMS
SetUpAdminTools();
lblWarning.Visible = false;
}
private List<string> myTreeNodePath;
private void ResetTV()
{
ResetTV(false);
@ -57,6 +58,7 @@ namespace VEPROMS
private void ResetTV(bool noProcs)
{
this.Cursor = Cursors.WaitCursor;
myTreeNodePath = new List<string>();
myTV.Nodes.Clear();
if (!selectedAdminTool.NoTreeView)
{
@ -86,15 +88,38 @@ namespace VEPROMS
{
foreach (DocVersionInfo dvi in fic.FolderDocVersions)
{
tnc.Tag = dvi;
myDocVersions.Add(tnc, dvi);
if (!noProcs)
UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID);
if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi))
{
if (dvi.Procedures.Count > 0)
LoadProcedures(dvi, tnc);
tnc.Tag = dvi;
myDocVersions.Add(tnc, dvi);
if (!noProcs)
{
if (dvi.Procedures.Count > 0)
LoadProcedures(dvi, tnc);
}
myTreeNodePath.Add(tnc.FullPath);
}
else
{
while (tnc != null && tnc.Text != "VEPROMS" && !IsUsedPath(tnc.FullPath))
{
TreeNode tmp = tnc.Parent;
tnc.Remove();
tnc = tmp;
}
}
}
}
private bool IsUsedPath(string path)
{
foreach (string s in myTreeNodePath)
{
if (s.StartsWith(path))
return true;
}
return false;
}
private void LoadProcedures(DocVersionInfo dvi, TreeNode tnc)
{
foreach (ProcedureInfo pi in dvi.Procedures)