Compare commits
3 Commits
C2022-003-
...
B2019-140_
| Author | SHA1 | Date | |
|---|---|---|---|
| 2783d2cc77 | |||
| a7a5df1991 | |||
| 62a296f909 |
Binary file not shown.
Binary file not shown.
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3819,6 +3819,51 @@ namespace VEPROMS.CSLA.Library
|
||||
_Tables = null;
|
||||
_SupInfos = null;
|
||||
}
|
||||
|
||||
//B2019-140 Change bars do not get refreshed when approval is run.
|
||||
// Reset a Procedure and sub items in the cache
|
||||
public static ProcedureInfo ResetProcedure(int procID)
|
||||
{
|
||||
// The following lines reload the procedure info cache
|
||||
ProcedureInfo newproc = ProcedureInfo.Get(procID, true);
|
||||
newproc.RefreshConfig();
|
||||
|
||||
//the following is needed to force the ProcedureConfig to reload
|
||||
#pragma warning disable S1656 // Variables should not be self-assigned
|
||||
newproc.MyConfig = newproc.MyConfig;
|
||||
#pragma warning restore S1656 // Variables should not be self-assigned
|
||||
|
||||
//reload the Content Cache for the procedure
|
||||
ContentInfo.Refresh(Content.Get(newproc.MyContent.ContentID, true));
|
||||
|
||||
// The following line actually reloads the item info cache
|
||||
ItemInfo newprocitem = Get(procID, true);
|
||||
newprocitem.RefreshConfig();
|
||||
|
||||
//Reload all the child/sub items
|
||||
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
|
||||
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
|
||||
List<int> itemIDs = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.ActiveParent != null && (t.ActiveParent is ItemInfo) && t.MyProcedure.ItemID == procID).Select(x => (x.ActiveParent as ItemInfo).ItemID).Distinct().ToList();
|
||||
#pragma warning restore S2971 // LINQ expressions should be simplified
|
||||
for (int index = 0; index < itemIDs.Count; index++)
|
||||
{
|
||||
ResetParts(itemIDs[index]);
|
||||
}
|
||||
|
||||
//reset the procedure config for all items attached to current procedure
|
||||
#pragma warning disable S2971 // LINQ expressions should be simplified - need initial ToList to force enumeration
|
||||
//otherwise will get a "Collection was modified; enumeration operation may not execute" error
|
||||
List<ItemInfo> pconfigrefresh_items = _CacheByPrimaryKey.Values.ToList().SelectMany(y => y).Where(t => t?.MyProcedure?.ItemID == procID).Distinct().ToList();
|
||||
#pragma warning restore S2971 // LINQ expressions should be simplified
|
||||
for (int index = 0; index < pconfigrefresh_items.Count; index++)
|
||||
{
|
||||
pconfigrefresh_items[index].MyProcedure = newproc;
|
||||
}
|
||||
|
||||
//return the changed procedure info
|
||||
return newproc;
|
||||
}
|
||||
|
||||
private ItemInfoList _Procedures;
|
||||
public ItemInfoList Procedures
|
||||
{ get { return Lookup(E_FromType.Procedure, ref _Procedures); } }
|
||||
|
||||
@@ -4341,6 +4341,16 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { }
|
||||
return LazyLoad(ref _IncludeSectionNumAndTitle, "@IncludeSectionNumAndTitle");
|
||||
}
|
||||
}
|
||||
|
||||
//F2025-038 default (in base format) is True. The lable "SECTION" will precede the section number an title
|
||||
private LazyLoad<bool> _IncludeSectionLabel;
|
||||
public bool IncludeSectionLabel
|
||||
{
|
||||
get
|
||||
{
|
||||
return LazyLoad(ref _IncludeSectionLabel, "@IncludeSectionLabel");
|
||||
}
|
||||
}
|
||||
// the font and font styles to use for the continuous action summary
|
||||
private VE_Font _Font;
|
||||
public VE_Font Font
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Volian.Print.Library
|
||||
{
|
||||
if (myContAct.MyChildren.Count > 0)
|
||||
if (myContAct.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.ContinuousActionSummaryData.IncludeSectionNumAndTitle) // only print the section title if it has Continuous Action Steps
|
||||
AddSectionHeader(myContAct.MyParagraph.MyItemInfo.DisplayNumber, myContAct.MyParagraph.MyItemInfo.FormattedDisplayText);
|
||||
AddSectionHeader(myContAct.MyParagraph.MyItemInfo.DisplayNumber, myContAct.MyParagraph.MyItemInfo.FormattedDisplayText, myContAct.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.ContinuousActionSummaryData.IncludeSectionLabel);
|
||||
foreach (pkParagraph pgh in myContAct.MyChildren) // within each section...
|
||||
{
|
||||
ItemInfo hlsii = GetHLSii(pgh.MyParagraph.MyItemInfo);
|
||||
@@ -175,7 +175,7 @@ namespace Volian.Print.Library
|
||||
WriteCell("DONE", true, true);
|
||||
WriteCell("PAGE", true, false);
|
||||
}
|
||||
private void AddSectionHeader(string number, string title)
|
||||
private void AddSectionHeader(string number, string title, bool IncludeSectionLabel)
|
||||
{
|
||||
if (!_FirstSection)
|
||||
{
|
||||
@@ -187,7 +187,10 @@ namespace Volian.Print.Library
|
||||
_FirstSection = false;
|
||||
Advance(2);
|
||||
SetIndent(0, 0);
|
||||
WriteCell("SECTION " + number, true, false);
|
||||
if (IncludeSectionLabel)
|
||||
WriteCell("SECTION " + number, true, false);
|
||||
else
|
||||
WriteCell(number, true, false); // F2025-038 don't include the word SECTION before number and title
|
||||
WriteCell(" " + title, false, true);
|
||||
Advance();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user