B2019-140/B2022-099 After doing an Approval (final stage) of a procedure, the change bars do not reset on the screen.
Also, when change the “Showing Change bars” option, the screen does not refresh.
This commit is contained in:
@@ -13,6 +13,8 @@ using System.Text.RegularExpressions;
|
||||
using System.Globalization;
|
||||
using DevComponents.DotNetBar;
|
||||
using JR.Utils.GUI.Forms;
|
||||
using Volian.Controls.Library;
|
||||
using System.Linq;
|
||||
|
||||
namespace VEPROMS
|
||||
{
|
||||
@@ -1321,6 +1323,26 @@ namespace VEPROMS
|
||||
|
||||
// Clear the change bar override for this procedure:
|
||||
pi.ClearChangeBarOverrides();
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
|
||||
|
||||
//// Refresh the StepPanel for the current Procedure
|
||||
//// so change bars update
|
||||
//// on any open StepPanel
|
||||
DisplayTabItem dti = MyFrmVEPROMS.GetTabContainingProcedure(pi.ItemID);
|
||||
if (dti != null)
|
||||
{
|
||||
if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus)
|
||||
dti.MyStepTabPanel.MyStepPanel.Focus();
|
||||
|
||||
foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType<EditItem>())
|
||||
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
|
||||
}
|
||||
|
||||
//since in a separate form, need to update the tree view
|
||||
//so "Showing Change Bars" Content Menu Item is correct
|
||||
MyFrmVEPROMS.RefreshProcedureNode(newproc);
|
||||
}
|
||||
else
|
||||
UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave);
|
||||
|
||||
@@ -589,6 +589,25 @@ namespace VEPROMS
|
||||
}
|
||||
}
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Get the displaytab containing the procedure
|
||||
// if none exists, return null
|
||||
public DisplayTabItem GetTabContainingProcedure(int procid) => tc?.MyBar?.Items?.OfType<DisplayTabItem>().FirstOrDefault(x => x.MyItemInfo?.ItemID == procid);
|
||||
// Refresh Node in Tree
|
||||
// Used for when Change Bar Updates as part of approval.
|
||||
public void RefreshProcedureNode(ProcedureInfo itm)
|
||||
{
|
||||
VETreeNode tn = tv.FindNode(itm, tv.Nodes);
|
||||
var tmp = (ProcedureInfo)tn?.VEObject;
|
||||
if (tmp != null)
|
||||
{
|
||||
tmp.ChangeBarDate = itm.ChangeBarDate;
|
||||
tmp.MyConfig = itm.MyConfig;
|
||||
}
|
||||
|
||||
tn?.RefreshNode();
|
||||
}
|
||||
|
||||
void tv_SelectDateToStartChangeBars(object sender, vlnTreeEventArgs args)
|
||||
{
|
||||
ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo;
|
||||
@@ -606,6 +625,23 @@ namespace VEPROMS
|
||||
itm.MyContent.Config = pc.ToString();
|
||||
itm.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||
itm.Save();
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Reset a Procedure and sub items in the cache
|
||||
ProcedureInfo newproc = ItemInfo.ResetProcedure(pi.ItemID);
|
||||
|
||||
//// Refresh the StepPanel for the current Procedure
|
||||
//// so change bars update
|
||||
//// on any open StepPanel
|
||||
DisplayTabItem dti = GetTabContainingProcedure(pi.ItemID);
|
||||
if (dti != null)
|
||||
{
|
||||
if (!dti.MyStepTabPanel.MyStepPanel.ContainsFocus)
|
||||
dti.MyStepTabPanel.MyStepPanel.Focus();
|
||||
|
||||
foreach (EditItem eitm in dti.MyStepTabPanel.MyStepPanel.Controls.OfType<EditItem>())
|
||||
eitm.ChangeBar = eitm.MyItemInfo.HasChangeBar;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user