C2024-003-Print-Sub-Section

This commit is contained in:
2024-02-22 16:54:56 -05:00
parent 77d31a4a99
commit dcfdf5f852
7 changed files with 978 additions and 879 deletions

View File

@@ -116,7 +116,7 @@ namespace VEPROMS
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave;
DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi);
//added by jcb 20130718 to support create pdf button when multi-unit and user selects a unit
@@ -356,12 +356,12 @@ namespace VEPROMS
cmbFont.SelectedIndex = -1;
string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray());
string db = Volian.Base.Library.VlnSettings.GetDB();
if (db != null)
Database.SelectedDatabase = db;
//B2018-129 Most Recently Used list was being cleared. Needed to remove a (string) type case in the IF statement
if (!string.IsNullOrEmpty((string)Properties.Settings.Default["DefaultDB"]))
if (!string.IsNullOrEmpty((string)Properties.Settings.Default["DefaultDB"]))
Database.LastDatabase = Properties.Settings.Default.DefaultDB;
// Setup the Context menu for DisplaySearch including the symbols
@@ -400,7 +400,7 @@ namespace VEPROMS
// B2019-107 Error Log message for inconsistent PromsFixes
_MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>{5}"
, Application.ProductVersion, Database.RevDate, Environment.UserDomainName, Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt"), FormatInfo.Failed ?? "");
// C2022-030 Notify the user if the stored procedure in the database are not update to date
// with those in the PROMSFixes.sql delivered with the PROMS executable
string pfVersion = ExeInfo.GetAssocicatedPROMSFixesVersion();
@@ -418,8 +418,8 @@ namespace VEPROMS
sbMsg.Append("\n\nPlease have your DBA update the database with the PROMSFixes.sql script file that was\ndelivered with this PROMS executable.");
sbMsg.Append("\n\nThe PROMSFixes.sql file is included with the PROMS installation download.");
sbMsg.Append("\n\nIt can also be found in your PROMS executable folder:");
sbMsg.AppendFormat("\n\t{0}",ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(),"SQL Stored Procedures Version Difference");
sbMsg.AppendFormat("\n\t{0}", ExeInfo.PROMSExecutableFolderPath());
FlexibleMessageBox.Show(sbMsg.ToString(), "SQL Stored Procedures Version Difference");
}
foreach (string parameter in parameters)
@@ -527,7 +527,7 @@ namespace VEPROMS
tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF);
displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged);
tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets);
tv.PrintTransitionReport += new vlnTreeViewEvent(tv_PrintTransitionReport);
tv.ProcessingComplete += tv_ProcessingComplete;
@@ -690,7 +690,7 @@ namespace VEPROMS
else
{
int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, CheckOutType.Session);
dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this, (E_UCFImportOptions)Properties.Settings.Default.UCFImportOpt);//Added frmVEPROMS Parameter
dlg.ShowDialog(this);
@@ -1139,7 +1139,7 @@ namespace VEPROMS
dvi.DocVersionConfig.SelectedSlave = 0;
}
void tv_PrintProcedure(object sender, vlnTreeEventArgs args)
{
ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo;
@@ -1178,8 +1178,8 @@ namespace VEPROMS
pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
}
catch(Exception ex)
{
catch (Exception ex)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("Could not create PDF Print");
@@ -1197,7 +1197,21 @@ namespace VEPROMS
{
//args.Node.Parent.
SectionInfo si2 = (args.Node as VETreeNode).VEObject as SectionInfo;
int _prtSectID = si2.ItemID;
int[] _prtSectID = new int[3];
if (si2.IsSubsection == true)
{
// If section is a subsection.
_prtSectID[0] = si2.MyParent.ItemID; // section
_prtSectID[1] = si2.ItemID; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
else
{
// If section is a regular section
_prtSectID[0] = si2.ItemID; // section
_prtSectID[1] = -1; // sub section
_prtSectID[2] = Convert.ToInt32(si2.IsSubsection); // IsSubSection flag
}
if (si2 == null) return;
@@ -1641,11 +1655,11 @@ namespace VEPROMS
if (!_WeAreExitingPROMS && !ClosingWithError && tc.SelectedDisplayTabItem != null && tc._MyDisplayTabItems.Count > 0)
{
// B2019-071 dialog to ask user if we are to close one tab or exit
DlgCloseTabsOrExit dctoe = new DlgCloseTabsOrExit(MyParent == null, PROMSWindowForms.Count > 0);
DlgCloseTabsOrExit dctoe = new DlgCloseTabsOrExit(MyParent == null, PROMSWindowForms.Count > 0);
dctoe.ShowDialog();
// B2019-101 flag that we are exiting from PROMS main window (separate windows)
_WeAreExitingPROMS = (MyParent == null && dctoe.ExitPROMS);
_WeAreExitingPROMS = (MyParent == null && dctoe.ExitPROMS);
if (dctoe.Cancel) // B2019-071 user decided to not close any tab and not exit PROMS - so do nothing and continue working
{
@@ -1667,7 +1681,7 @@ namespace VEPROMS
tc.CloseTabItem(tc.SelectedDisplayTabItem);
// B2019-071 close just the current tab and continue working
if (!dctoe.ExitPROMS)
if (!dctoe.ExitPROMS)
{
n = 0;
e.Cancel = true;
@@ -1700,7 +1714,7 @@ namespace VEPROMS
}
// This keeps PROMS from Hanging under certain circumstances
tc.ShuttingDown = true;
tc.ShuttingDown = true;
// B2019-161 When shutting down output the timing information (to the error log)
if (VolianTimer.TimingsOn)
@@ -1882,12 +1896,12 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsExport;
private DevComponents.DotNetBar.ButtonItem btnUserControlOfFormatsImport;
private TabItemsToClose _MyCloseTabList = new TabItemsToClose();
public TabItemsToClose MyCloseTabList
{
get { return _MyCloseTabList; }
}
private bool _DisablePing = false;
public bool DisablePing
{
@@ -1997,7 +2011,7 @@ namespace VEPROMS
if (ContentInfo.IsInCache(id))
{
ContentInfo ci = ContentInfo.Get(id);
if (MySessionInfo.LastContentChange >= ci.LastChangedInt64)
{
using (Content c = Content.Get(id))
@@ -2021,7 +2035,7 @@ namespace VEPROMS
}
}
catch { }
//MySemaphore.Release();
//_MyLog.DebugFormat("{0},{1:X},{2:X},{3:X}", DateTime.Now.ToLongTimeString(), lastChanged, MySessionInfo.LastContentChange, MySessionInfo.LastChangedInt64);
}
@@ -2092,7 +2106,7 @@ namespace VEPROMS
btnResetSecurity = new ButtonItem("btnResetSecurity", "Reset Security");
btnSecurity.SubItems.Add(btnResetSecurity);
btnResetSecurity.Click += new EventHandler(btnResetSecurity_Click);
//batch refresh transitions
btnAdministrativeTools = new ButtonItem("btnAdministrativeTools", "Administrative Tools");
btnAdministrativeTools.Click += new EventHandler(btnAdministrativeTools_Click);
@@ -2106,7 +2120,7 @@ namespace VEPROMS
this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats", null, null, null, null, eTooltipColor.Gray));
try
{
MyUserInfo = UserInfo.GetByUserID(VlnSettings.UserID);
@@ -2153,7 +2167,7 @@ namespace VEPROMS
btnFormats.Visible = isVisible;
btnSecurity.Visible = isVisible;
btnAdmin.Enabled = (isVisible || HasSetAdministrator(MyUserInfo));
tmrCloseTabItems = new Timer();
tmrCloseTabItems.Interval = 100;
tmrCloseTabItems.Tick += new EventHandler(tmrCloseTabItems_Tick);
@@ -2161,7 +2175,7 @@ namespace VEPROMS
CloseSessionsNoLongerActive();
MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id);
if (MySessionInfo == null)
{
MessageBox.Show("This database is locked by the Administrator. Please try again later", "PROMS is Locked");
@@ -2205,7 +2219,7 @@ namespace VEPROMS
if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size;
//if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState;
//if (Settings.Default.SaveTreeviewExpanded) epProcedures.Expanded = Settings.Default.TreeviewExpanded;
// if the Procedures panel was left open from the last session, then open it
epProcedures.Expanded = Settings.Default.TreeviewExpanded;
if (Settings.Default["QATItems"] != null) ribbonControl1.QatLayout = Settings.Default.QATItems;
@@ -2377,7 +2391,7 @@ namespace VEPROMS
TurnChangeManagerOn.Execute();
}
}
// C2015-022 Separate Windows. This is a dictionary of child PROMS windows forms (frmVEPROMS)
//
Dictionary<int, frmVEPROMS> _PROMSWindowForms = null;
@@ -2425,7 +2439,7 @@ namespace VEPROMS
while (!(_tn.VEObject is FolderInfo))
{
// back up to the first folder tree node
_tn = (VETreeNode)_tn.Parent;
_tn = (VETreeNode)_tn.Parent;
}
_tn.Nodes.Clear(); // remove the child nodes from main window - child window now has this part of the procedure tree
@@ -2522,7 +2536,7 @@ namespace VEPROMS
}
DialogResult dr = System.Windows.Forms.DialogResult.Yes;
// RHM20150507 Table Scrunch
Rtf2Pdf.AllowTableScrunching = cbScrunch.Checked ? _DefaultScrunchingRules : TableScrunching.None;
@@ -2754,7 +2768,7 @@ namespace VEPROMS
tmrCloseTabItems.Enabled = false;
_TimeActivity1.Open();
while (MyCloseTabList.CountDTI > 0)
{
DisplayTabItem dti = MyCloseTabList.PopDTI();
@@ -3866,7 +3880,7 @@ namespace VEPROMS
{
infoPanel.Expanded = true;
infoTabs.SelectedTab = infotabRO;
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = (SelectedStepTabPanel == null) ? null :
@@ -4025,7 +4039,7 @@ namespace VEPROMS
// need this to update RO Tree after UpdateRofst (B2015-226)
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.MyROFST = SelectedROFst;
displayRO.MyROFST = SelectedROFst;
displayRO.LoadTree();
// resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226)
@@ -4068,7 +4082,7 @@ namespace VEPROMS
SetCaption(tv.SelectedNode as VETreeNode);
displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0)
{
displayRO.MyROFST = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst;
@@ -4283,7 +4297,7 @@ namespace VEPROMS
// B2022-026 RO Memory reduction coding (Jakes Merge)
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = args.MyEditItem.MyStepRTB;
displayRO.LoadTree();
displayRO.LoadTree();
displayBookMarks.MyEditItem = args.MyEditItem;
displayHistory.MyEditItem = args.MyEditItem;
@@ -4302,7 +4316,7 @@ namespace VEPROMS
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ?
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
@@ -4420,7 +4434,7 @@ namespace VEPROMS
displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ?
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
displayRO.ProgressBar = bottomProgBar;
displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB;
displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo;
@@ -4446,7 +4460,7 @@ namespace VEPROMS
if (!tv.Focused && tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null)
tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo);
VETreeNode vtn = tv.SelectedNode as VETreeNode;
VETreeNode vtn = tv.SelectedNode as VETreeNode;
if (vtn == null) return;
StepInfo stpinf = vtn.VEObject as StepInfo;
if (stpinf == null || !stpinf.IsRNOPart) //B2017-037 is this a RNO step type element - don't allow insert before/after
@@ -4884,7 +4898,7 @@ namespace VEPROMS
private void btnUpdateFormat_Click(object sender, EventArgs e)
{
UpdateFormats(null);
UpdateFormats(null);
}
private void UpdateFormats(string mypath)
@@ -4955,7 +4969,7 @@ namespace VEPROMS
try
{
frmSendErrorLog frm = new frmSendErrorLog(Properties.Settings.Default.OutlookEmail, Properties.Settings.Default["SMTPServer"].ToString(), Properties.Settings.Default["SMTPUser"].ToString(), ErrorLogFileName);
if (frm.ShowDialog(this) == DialogResult.OK)
{
Properties.Settings.Default.OutlookEmail = frm.OutlookEmail;