B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.

This commit is contained in:
Jake 2022-09-23 14:29:31 +00:00
parent 7c9a722eba
commit b3193e0f5a
2 changed files with 16 additions and 18 deletions

View File

@ -412,7 +412,6 @@ namespace VEPROMS
tc.SeparateWindows = Properties.Settings.Default.SeparateWindows; tc.SeparateWindows = Properties.Settings.Default.SeparateWindows;
tv.PauseRefresh += tv_PauseRefresh; tv.PauseRefresh += tv_PauseRefresh;
tv.UnPauseRefresh += tv_UnPauseRefresh; tv.UnPauseRefresh += tv_UnPauseRefresh;
} }
void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args) void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args)
@ -3913,7 +3912,8 @@ namespace VEPROMS
} }
// B2022-026 RO Memory reduction coding (Jakes Merge) // B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.LoadTree(); // B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures. (Added True for the forceLoad parameter)
displayRO.LoadTree(true);
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole; lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;

View File

@ -50,9 +50,7 @@ namespace Volian.Controls.Library
//private ROFstInfo _curROFST = null; //private ROFstInfo _curROFST = null;
private int? _currRofstID = null; private int? _currRofstID = null;
private int? _currDocVersionID = null; private int? _currDocVersionID = null;
private bool _isInitializedRofstID = false;
private bool _isInitializedDocVersionID = false;
private RoUsageInfo _curROLink; private RoUsageInfo _curROLink;
private E_ROValueType _curROTypeFilter = E_ROValueType.All; private E_ROValueType _curROTypeFilter = E_ROValueType.All;
@ -108,10 +106,8 @@ namespace Volian.Controls.Library
} }
} }
if (!_isInitializedRofstID && IsRofstValid) // B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
{ _currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
_currRofstID = (IsRofstValid) ? (int?)_myROFST.ROFstID : null;
}
} }
} }
} }
@ -126,10 +122,10 @@ namespace Volian.Controls.Library
{ {
_docVersionInfo = value; _docVersionInfo = value;
if (!_isInitializedDocVersionID && _docVersionInfo != null) if (_docVersionInfo != null)
{
_currDocVersionID = (int?) _docVersionInfo.VersionID; // B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
} _currDocVersionID = (_docVersionInfo != null) ? (int?)_docVersionInfo.VersionID : null;
} }
} }
} }
@ -251,9 +247,6 @@ namespace Volian.Controls.Library
_currRofstID = null; _currRofstID = null;
_currDocVersionID = null; _currDocVersionID = null;
_isInitializedRofstID = false;
_isInitializedDocVersionID = false;
if (_searchTimer == null) if (_searchTimer == null)
{ {
_searchTimer = new Timer(); _searchTimer = new Timer();
@ -563,7 +556,7 @@ namespace Volian.Controls.Library
#region Public Methods #region Public Methods
public void LoadTree() public void LoadTree(bool forceReload = false)
{ {
if (MyROFST == null) if (MyROFST == null)
{ {
@ -572,10 +565,15 @@ namespace Volian.Controls.Library
return; return;
} }
if(RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0) if (forceReload || RoTreeNeedsReloaded || tvROFST.Nodes == null || tvROFST.Nodes.Count <= 0)
{ {
ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true); ROFSTLookup.rodbi[] dbs = MyROFSTLookup.GetRODatabaseList(true);
// B2022-123: RO Tab Treeview not showing correct RO values when switching between procedures.
// Added optional parameter "forceReload" and cleared out any existing nodes before reloading the tree
// the clear nodes code below has to be after the GetRODatabaseList database call because of races conditions in the code
tvROFST.Nodes.Clear();
for (int i = 0; i < dbs.Length; i++) for (int i = 0; i < dbs.Length; i++)
{ {
ROFSTLookup.rodbi db = dbs[i]; ROFSTLookup.rodbi db = dbs[i];