Compare commits

...

71 Commits

Author SHA1 Message Date
Kevin Laskey
c05e493579 C2021-059 Attempting to resolve conflicts try 1 2024-08-01 14:52:38 -04:00
Kevin Laskey
2714973c16 2021-059 - Matchicng Paul's Changes 2024-08-01 14:49:14 -04:00
Kevin Laskey
5f86d8c629 C2021-059 - Update designer to avoid conflict 2024-08-01 14:41:34 -04:00
Kevin Laskey
977ea6f5fc C2021-059 - Update proms sql fixes with correct numbers 2024-08-01 11:01:28 -04:00
Kevin Laskey
a8bbda1281 C2024-005 - Completed some updates for nested folder selection (parent unselect) 2024-08-01 09:23:30 -04:00
Kevin Laskey
da1b061eb1 C2024-005 - Added orphan record clearing progress bar, confirmation message 2024-07-30 08:54:13 -04:00
Kevin Laskey
4644699df0 C20240-005 - Deleting Folder additions 2024-07-29 15:57:54 -04:00
Kevin Laskey
6e6abbd759 C2024-005 - Kevin working on folder retrieval 2024-07-22 09:28:48 -04:00
Kathy Ruffing
501798a8cb Merge pull request 'C2024-005-Annotations-Cleanup-2' (#355) from C2024-005-Annototions-Cleanup-2 into Development
Reviewed-on: #355
Reviewed-by: Kathy Ruffing <kruffing@volian.com>
Code reviewed successfully
2024-07-18 11:39:12 -04:00
a240bc2c19 C2024-005-Annotations-Cleanup-2 2024-07-18 11:31:49 -04:00
a804a3866a C2024-005-Annotations-Cleanup-2 2024-07-18 11:12:30 -04:00
069ffb80e9 C2024-005-Annotations-Cleanup-2 2024-07-17 14:28:24 -04:00
Kevin Laskey
5255080291 Merge pull request 'B2022-118: search of multi value ROs fails' (#354) from B2022-118 into Development
Reviewed-on: #354
2024-07-17 10:56:40 -04:00
Kathy Ruffing
ae35d9f0d7 B2022-118: search of multi value ROs fails 2024-07-17 10:11:43 -04:00
afbd653611 Merge pull request 'B2024-041 - Update PromsFixes SQL file to acocunt for replacing vs pasting procs' (#352) from B2024-041_v2 into Development
good for testing phase
2024-07-16 16:27:35 -04:00
Kevin Laskey
9a55111e1e B2024-041 - Update PromsFixes SQL file to acocunt for replacing vs pasting procs 2024-07-16 16:20:21 -04:00
422a3053b7 Merge pull request 'B2024-039 Customer reported that transitions to standard text get converted to text when the Refresh Transitions is done from the Admin Tools' (#350) from B2024-039_BNPP_StdtxtTrans into Development
format only changes
2024-07-12 14:16:22 -04:00
feb74ee09f B2024-039 Customer reported that transitions to standard text get converted to text when the Refresh Transitions is done from the Admin Tools 2024-07-12 14:14:23 -04:00
7cebb2b7f1 Merge pull request 'B2024-037: Bug fix for copy/replace functionality on procedures and steps.' (#349) from B2024-037 into Development
changes look good. OK for testing phase.
2024-07-11 10:54:10 -04:00
Kevin Laskey
8097c6283c B2024-037 - Update versioning on proms fixes 2024-07-11 10:30:31 -04:00
Kevin Laskey
8f08ef5ee4 B2024-037 - Slight clean up on parentedititme 2024-07-11 08:45:18 -04:00
Kevin Laskey
fd26f16776 B2024-037 Include proms sql fixes for copy replace functionality 2024-07-10 14:53:20 -04:00
Kevin Laskey
21a83df99d B2024-037 - Fixes made for replacing procs and steps via paste/replace functionality. 2024-07-10 12:15:14 -04:00
616acf0e37 Merge pull request 'F2024-065 - Turned off the CapRoIfLastLower flag in all of the Beaver Valley formats F2024-066 - Turned off the Replace Words feature in EOP, “without Issue Number”, and the SAMG Background formats' (#347) from F2024-065-066-BeaverValley into Development
Format only changes
2024-07-03 10:08:45 -04:00
3cff87cf97 F2024-065 - Turned off the CapRoIfLastLower flag in all of the Beaver Valley formats F2024-066 - Turned off the Replace Words feature in EOP, “without Issue Number”, and the SAMG Background formats 2024-07-03 10:01:03 -04:00
Kathy Ruffing
9202d903a5 Merge pull request 'F2024-064: underline and spacing of section titles' (#345) from F2024-064 into Development
Reviewed-on: #345
2024-07-01 09:27:34 -04:00
Kathy Ruffing
a9a9a56c09 F2024-064: underline and spacing of section titles 2024-07-01 09:15:42 -04:00
aee7819a9c Merge pull request 'C2024-013: On print dialog, disable Merge button if creating hyperlinks' (#343) from C2024-013 into Development
code changed reviewed and can proceed to testing phase
2024-06-25 13:42:33 -04:00
Kathy Ruffing
d3bc1c4725 C2024-013: On print dialog, disable Merge button if creating hyperlinks 2024-06-25 12:14:26 -04:00
d0474b22f9 Merge pull request 'C2022-029 - Export Single Procedure (Overwrite/Rename/Cancel)' (#341) from C2022-029 into Development
passed code review. ready for testing phase
2024-06-20 10:02:52 -04:00
5bd1f94be0 Merge pull request 'C2024-004' (#339) from C2024-004 into Development
code changes look good. ready for testing phase.
2024-06-19 14:12:03 -04:00
Kevin Laskey
629fe1b615 Updated to include passing teh selected tree node parent for cases where the only procedure in a folder is being replaced. otherwise i pass null for that as its not really used. 2024-06-19 13:50:52 -04:00
Kevin Laskey
c92b888ec2 Update to close the procedure when opened during the paste/replace option. 2024-06-18 10:48:28 -04:00
5df42daa71 Merge pull request 'C2019-047' (#337) from C2019-047 into Development
changes approved.  Ready for testing phase
2024-06-14 13:24:51 -04:00
Kevin Laskey
9349396d9a Updates to display tags page for inital load of RO images and other images, updates to set some pre values for resizing and ratios. 2024-06-14 11:46:08 -04:00
Kevin Laskey
38425a05f9 Updates to pass through image details to the tag setting. 2024-06-13 15:14:35 -04:00
Kevin Laskey
9d1b99b08e Update 2024-06-13 09:00:49 -04:00
Kevin Laskey
4f7a762bf1 Updated to use modified date, shortened code a bit. 2024-06-13 08:35:13 -04:00
Kevin Laskey
11cb2e0efd Updated message 2024-06-07 15:14:33 -04:00
78f58bea19 Merge pull request 'C2019-047 - Show figure size under tags when adding a new figure.' (#336) from C2019-047 into Development
changes are good. ready for testing phase.
2024-06-07 15:04:14 -04:00
Kevin Laskey
a2e830d0c3 Update for "cancel" button action 2024-06-07 14:42:26 -04:00
Kevin Laskey
2ffab17caf Updates for adding custom buttons 2024-06-07 14:17:43 -04:00
Kevin Laskey
49aba5c67b update 2024-06-07 10:34:46 -04:00
1b24177b68 Merge pull request 'B2024-036 - Removed Print button from V Menu' (#334) from B2024-036 into Development
Code changes look good.  OK to generate test exe.
2024-06-06 08:59:41 -04:00
bf7a967633 Merge pull request 'F2024-063 Beaver Valley requested that the section number be underlined at the top of the pages of the Two Column Attachment section and an extra space was added between the top continue message and first line of step text on that page.' (#333) from F2024-063_BeaverValley into Development
format only change. OK to move to testing phase.
2024-06-05 16:26:57 -04:00
f5669e50a8 F2024-063 Beaver Valley requested that the section number be underlined at the top of the pages of the Two Column Attachment section and an extra space was added between the top continue message and first line of step text on that page. 2024-06-05 16:27:08 -04:00
Kevin Laskey
2ae0d0d454 Update to ensure some size is presetned for the figure when adding a new. 2024-06-05 10:48:51 -04:00
Kevin Laskey
241785846e Update for displaying when a figure is selected or added (as opposed to a step or some other type of option) 2024-06-04 11:55:17 -04:00
Kevin Laskey
0d6fd6950c C2019-047 - Show the figure size adjustment panel before a figure is selected or inserted, so that they dont have to open/close the area to see it. 2024-06-04 09:18:58 -04:00
Kevin Laskey
bb99d6444c B2024-036 - Removed Print button from V Menu 2024-06-04 09:05:22 -04:00
Kevin Laskey
db4f114caf C2022-029 - Export Import changes, Set path automatically for single proc export, provide overwrite message on single prompt export. 2024-06-04 08:51:57 -04:00
80d83da9c9 Merge pull request 'B2024-035-Overwrite-settings.' (#331) from B2024-035 into Development
OK to generate test exe.
2024-05-29 16:56:39 -04:00
54e02e6263 B2024-035-Overwrite-settings. 2024-05-29 15:30:25 -04:00
c4af911f15 Merge pull request 'F2024-062 Removed the Unit number that was mistakenly added to the procedure steps section header.' (#330) from F2024-062_BNPP into Development
format only change.
2024-05-23 14:20:46 -04:00
f9690ee772 F2024-062 Removed the Unit number that was mistakenly added to the procedure steps section header. 2024-05-23 14:19:14 -04:00
623c6a7941 Merge pull request 'B2024-034 Fix "Overwrite PDF File" functionality in Print Dialog Box' (#329) from B2024-034 into Development
passed code review and ready for testing
2024-05-22 16:09:56 -04:00
7a5129208c B2024-034 Fix Overwrite PDF File. 2024-05-22 16:08:12 -04:00
e15c56f1e2 Merge pull request 'B2024-023: UI fixes for insert section with associated enhanced section' (#328) from B2024-023 into Development
ready to be tested
2024-05-22 09:04:55 -04:00
Kathy Ruffing
5d808e436a B2024-023: UI fixes for insert section with associated enhanced section 2024-05-22 08:51:22 -04:00
20e40a5c49 Merge pull request 'F2024-061 Added an AOP Deviation format for Beaver Valley.' (#326) from F2024-061 into Development
format only change
2024-05-20 10:57:51 -04:00
885dae812d F2024-061 Added an AOP Deviation format for Beaver Valley. 2024-05-20 10:56:13 -04:00
35bd91f7e8 Merge pull request 'F2024-060 For the Byron and Braidwood formats, adjusted the text widths on the edit screen to be closer to that of which is printed.' (#324) from F2024-060_ByBwd_Bckgnd into Development
format only change
2024-05-16 14:58:23 -04:00
305f2768bb F2024-060 For the Byron and Braidwood formats, adjusted the text widths on the edit screen to be closer to that of which is printed. 2024-05-16 14:58:09 -04:00
5f733161c6 Merge pull request 'C2024-001-Update-Baseline-Auto-Testing' (#322) from C2024-011 into Development
passed code review
2024-05-16 11:44:32 -04:00
4fc13acd1a Merge pull request 'B2024-030 On the Working Draft properties page, added a check to see if we need to create the folder(s) for the path typed into the PDF Location text box.' (#320) from B2024-030_SetOuptputPath into Development
Reviewed-on: #320
2024-05-14 15:41:41 -04:00
365f6a23c8 B2024-030 On the Working Draft properties page, added a check to see if we need to create the folder(s) for the path typed into the PDF Location text box. 2024-05-14 14:24:01 -04:00
331d5751c3 C2024-001-Update-Baseline-Auto-Testing 2024-05-14 11:41:45 -04:00
dfb965edbc Merge pull request 'B2024-028 consistent paste menuing in enhanced set' (#319) from B2024-028 into Development
good to test
2024-05-14 10:20:00 -04:00
Kathy Ruffing
c7cc69fd73 B2024-028 consistent paste menuing in enhanced set 2024-05-14 10:09:20 -04:00
d187aa885d Merge pull request 'B2024-032 Fix Click Quick Print' (#318) from B2024-032 into Development
code OK to be tested
2024-05-13 08:46:14 -04:00
b1b4535d9b B2024-032 Fix Click Quick Print 2024-05-12 16:42:24 -04:00
54 changed files with 3996 additions and 951 deletions

View File

@@ -241,6 +241,21 @@ namespace JR.Utils.GUI.Forms
return FlexibleMessageBoxForm.Show(owner, text, caption, buttons, icon, defaultButton);
}
/// <summary>
/// Shows the specified message box.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="text">The text.</param>
/// <param name="caption">The caption.</param>
/// <param name="buttons">The buttons.</param>
/// <param name="icon">The icon.</param>
/// <param name="defaultButton">The default button.</param>
/// <returns>The dialog result.</returns>
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
{
return FlexibleMessageBoxForm.ShowCustom(null, text, caption, buttons, icon);
}
#endregion
#region Internal form class
@@ -420,15 +435,15 @@ namespace JR.Utils.GUI.Forms
private static readonly String STANDARD_MESSAGEBOX_SEPARATOR_SPACES = " ";
//These are the possible buttons (in a standard MessageBox)
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE };
private enum ButtonID { OK = 0, CANCEL, YES, NO, ABORT, RETRY, IGNORE, OVERWRITE, RENAME };
//These are the buttons texts for different languages.
//If you want to add a new language, add it here and in the GetButtonText-Function
private enum TwoLetterISOLanguageID { en, de, es, it };
private static readonly String[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore" }; //Note: This is also the fallback language
private static readonly String[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren" };
private static readonly String[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar" };
private static readonly String[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora" };
private static readonly String[] BUTTON_TEXTS_ENGLISH_EN = { "OK", "Cancel", "&Yes", "&No", "&Abort", "&Retry", "&Ignore", "&Overwrite", "&Rename" }; //Note: This is also the fallback language
private static readonly String[] BUTTON_TEXTS_GERMAN_DE = { "OK", "Abbrechen", "&Ja", "&Nein", "&Abbrechen", "&Wiederholen", "&Ignorieren", "&Overwrite", "&Rename" };
private static readonly String[] BUTTON_TEXTS_SPANISH_ES = { "Aceptar", "Cancelar", "&Sí", "&No", "&Abortar", "&Reintentar", "&Ignorar", "&Overwrite", "&Rename" };
private static readonly String[] BUTTON_TEXTS_ITALIAN_IT = { "OK", "Annulla", "&Sì", "&No", "&Interrompi", "&Riprova", "&Ignora", "&Overwrite", "&Rename" };
#endregion
@@ -694,6 +709,7 @@ namespace JR.Utils.GUI.Forms
flexibleMessageBoxForm.CancelButton = flexibleMessageBoxForm.button3;
break;
case MessageBoxButtons.OK:
default:
flexibleMessageBoxForm.visibleButtonsCount = 1;
@@ -709,16 +725,38 @@ namespace JR.Utils.GUI.Forms
flexibleMessageBoxForm.defaultButton = defaultButton;
}
#endregion
private static void SetDialogButtonsCustom(FlexibleMessageBoxForm flexibleMessageBoxForm)
{
flexibleMessageBoxForm.visibleButtonsCount = 3;
#region Private event handlers
flexibleMessageBoxForm.button1.Visible = true;
flexibleMessageBoxForm.button1.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.CANCEL);
flexibleMessageBoxForm.button1.DialogResult = DialogResult.Abort;
/// <summary>
/// Handles the Shown event of the FlexibleMessageBoxForm control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
flexibleMessageBoxForm.button2.Visible = true;
flexibleMessageBoxForm.button2.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.OVERWRITE);
flexibleMessageBoxForm.button2.DialogResult = DialogResult.Retry;
flexibleMessageBoxForm.button3.Visible = true;
flexibleMessageBoxForm.button3.Text = flexibleMessageBoxForm.GetButtonText(ButtonID.RENAME);
flexibleMessageBoxForm.button3.DialogResult = DialogResult.Ignore;
flexibleMessageBoxForm.ControlBox = false;
}
#endregion
#region Private event handlers
/// <summary>
/// Handles the Shown event of the FlexibleMessageBoxForm control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
private void FlexibleMessageBoxForm_Shown(object sender, EventArgs e)
{
int buttonIndexToFocus = 1;
Button buttonToFocus;
@@ -866,6 +904,46 @@ namespace JR.Utils.GUI.Forms
return flexibleMessageBoxForm.ShowDialog(owner);
}
/// <summary>
/// Shows the specified message box.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="text">The text.</param>
/// <param name="caption">The caption.</param>
/// <param name="buttons">The buttons.</param>
/// <param name="icon">The icon.</param>
/// <param name="defaultButton">The default button.</param>
/// <returns>The dialog result.</returns>
public static DialogResult ShowCustom(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
{
//Create a new instance of the FlexibleMessageBox form
var flexibleMessageBoxForm = new FlexibleMessageBoxForm();
flexibleMessageBoxForm.ShowInTaskbar = false;
//Bind the caption and the message text
flexibleMessageBoxForm.CaptionText = caption;
flexibleMessageBoxForm.MessageText = text;
flexibleMessageBoxForm.FlexibleMessageBoxFormBindingSource.DataSource = flexibleMessageBoxForm;
//Set the buttons visibilities and texts. Also set a default button.
SetDialogButtonsCustom(flexibleMessageBoxForm);
//Set the dialogs icon. When no icon is used: Correct placement and width of rich text box.
SetDialogIcon(flexibleMessageBoxForm, icon);
//Set the font for all controls
flexibleMessageBoxForm.Font = FONT;
flexibleMessageBoxForm.richTextBoxMessage.Font = FONT;
//Calculate the dialogs start size (Try to auto-size width to show longest text row). Also set the maximum dialog size.
SetDialogSizes(flexibleMessageBoxForm, text, caption);
//Set the dialogs start position when given. Otherwise center the dialog on the current screen.
SetDialogStartPosition(flexibleMessageBoxForm, owner);
//Show the dialog
return flexibleMessageBoxForm.ShowDialog(owner);
}
#endregion
} //class FlexibleMessageBoxForm

View File

@@ -126,6 +126,7 @@
<Content Include="fmtall\BVPSAOPall.xml" />
<Content Include="fmtall\BVPSAtchall.xml" />
<Content Include="fmtall\BVPSBCKall.xml" />
<Content Include="fmtall\BVPSAOPDEVall.xml" />
<Content Include="fmtall\BVPSFlexDEVall.xml" />
<Content Include="fmtall\BVPSDEVall.xml" />
<Content Include="fmtall\BVPSNIBCKall.xml" />
@@ -406,6 +407,7 @@
<Content Include="genmacall\BVPSAOP.svg" />
<Content Include="genmacall\BVPSAtch.svg" />
<Content Include="genmacall\BVPSbck.svg" />
<Content Include="genmacall\BVPSAOPdev.svg" />
<Content Include="genmacall\BVPSFlexdev.svg" />
<Content Include="genmacall\BVPSdev.svg" />
<Content Include="genmacall\BVPSNIBCK.svg" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1320,6 +1320,10 @@ namespace VEPROMS
if (swtbtnPDFLinks.Value)
swtbtnPDFdtPrefixSuffix.Value = false;
BuildPDFFileName();
// C2024-013: When Create RO & Transition Hyperlinks in pdf is ON, disable the MergePdf
// button. The Create RO & Transition Hyperlinks option looks for individual file names
// for procedures.
btnMergePDFs.Enabled = !swtbtnPDFLinks.Value;
}
// C2019-004: Allow user to define duplex blank page text. The text box for blank page text is always enabled for procedures with

File diff suppressed because it is too large Load Diff

View File

@@ -99,7 +99,10 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="C1.Win.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=944ae1ea0e47ca04" />
<Reference Include="C1.Win.C1Command.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=e808566f358766d8" />
<Reference Include="C1.Win.C1FlexGrid.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=79882d576c6336da, processorArchitecture=MSIL" />
<Reference Include="C1.Win.C1Input.2, Version=2.0.20213.532, Culture=neutral, PublicKeyToken=7e7ff60f0c214f9a, processorArchitecture=MSIL" />
<Reference Include="Csla">
<HintPath>..\..\..\..\3rdPartyLibraries\CSLA\Csla.dll</HintPath>
</Reference>
@@ -220,6 +223,12 @@
<Compile Include="dlgUCFDetail.Designer.cs">
<DependentUpon>dlgUCFDetail.cs</DependentUpon>
</Compile>
<Compile Include="frmAnnotationsCleanup.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmAnnotationsCleanup.Designer.cs">
<DependentUpon>frmAnnotationsCleanup.cs</DependentUpon>
</Compile>
<Compile Include="frmBatchRefresh.cs">
<SubType>Form</SubType>
</Compile>
@@ -331,6 +340,9 @@
<EmbeddedResource Include="dlgUCFDetail.resx">
<DependentUpon>dlgUCFDetail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmAnnotationsCleanup.resx">
<DependentUpon>frmAnnotationsCleanup.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmPDFStatusForm.resx">
<DependentUpon>frmPDFStatusForm.cs</DependentUpon>
<SubType>Designer</SubType>

View File

@@ -99,6 +99,10 @@ namespace VEPROMS
MyProcedure = procedureInfo;
InitializeComponent();
this.Text = mode + " Dialog for " + procedureInfo.DisplayNumber;
//Preset path for single procedures.
PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database;
txtExport.Text = string.Format(@"{0}\{1}.pxml", PEIPath, MyProcedure.DisplayNumber.Replace("/", "_").Replace("\\", "_"));
}
private void dlgExportImport_Load(object sender, EventArgs e)
{
@@ -172,6 +176,7 @@ namespace VEPROMS
}
else if (MyProcedure != null)
{
txtExport.Enabled = true;
txtExport.Text = string.Format(@"{0}\{1}.pxml", PEIPath, MyProcedure.DisplayNumber.Replace("/", "_").Replace("\\", "_"));
}
}
@@ -190,6 +195,8 @@ namespace VEPROMS
private bool successfullExport = true;
private void btnDoExport_Click(object sender, EventArgs e)
{
btnExport.Enabled = false;
string msg = "Finished Exporting:\n\n";
if (_MyMode.ToUpper().Contains("FORMAT"))
@@ -220,6 +227,42 @@ namespace VEPROMS
}
else if (MyProcedure != null)
{
var fileLocation = txtExport.Text;
if (File.Exists(fileLocation))
{ // C2022-029 if an existing export of the same name is found, provide option to overwrite it
DialogResult ovewriteEx = FlexibleMessageBox.ShowCustom(null, "There is already another export file with the same name. You can choose to either overwrite the existing file or have the existing file renamed with the original creation date appended.\r\n\r\nSelecting 'Cancel' will cancel the export.", "What would you like to do?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);// == DialogResult.Yes;
// Extract directory, filename, and extension
string directory = Path.GetDirectoryName(fileLocation);
string filename = Path.GetFileNameWithoutExtension(fileLocation);
string extension = Path.GetExtension(fileLocation);
fileLocation = $"{directory}\\{filename}{extension}";
if (ovewriteEx == DialogResult.Abort)
{
MessageBox.Show("Export has been cancelled", "You have chosen to cancel the export.", MessageBoxButtons.OK, MessageBoxIcon.Information); // C2020-042 changed mesage box title
btnCloseExport.Enabled = true;
return;
}
else if (ovewriteEx == DialogResult.Retry)
{
//Overwrite will occur, set msg.
msg = "The export file has been overwritten. ";
}
else if (ovewriteEx == DialogResult.Ignore)
{
// Get the modified date of the existing file, create a datestamp for use in name, set newlocation to move to
DateTime modifiedDate = File.GetLastWriteTime(fileLocation);
string datestamp = modifiedDate.ToString("yyyyMMddHHmmss");
string newFileLocation = $"{directory}\\{filename}_{datestamp}{extension}";
//Move and set msg.
File.Move(fileLocation, newFileLocation);
msg = "The previous export has been renamed, the export file has been created. ";
}
}
this.Cursor = Cursors.WaitCursor;
MyStart = DateTime.Now;
btnDoExport.Enabled = false;
@@ -230,7 +273,7 @@ namespace VEPROMS
XmlElement xe = xd.CreateElement("formats");
xd.DocumentElement.AppendChild(xe);
ExportFormats(FormatInfoList.GetFormatInfoListUsed(), xe, "formats", false);
xd.Save(txtExport.Text);
xd.Save(fileLocation);
TimeSpan elapsed = DateTime.Now.Subtract(MyStart);
lblExportStatus.Text = "Export Completed in " + elapsed.ToString();
this.Cursor = Cursors.Default;
@@ -706,7 +749,7 @@ namespace VEPROMS
}
catch (Exception ex)
{
FlexibleMessageBox.Show("The import failed, check the error log for more information.", "Import Failed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
FlexibleMessageBox.Show(null, "The import failed, check the error log for more information.", "Import Failed", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
_MyLog.Warn("Failure During Import", ex);
}
return false;

View File

@@ -400,6 +400,7 @@ namespace VEPROMS
this.pnlImport.PerformLayout();
this.ResumeLayout(false);
}
#endregion

View File

@@ -0,0 +1,132 @@

using VEPROMS.CSLA.Library;
using Volian.Base.Library;
namespace VEPROMS
{
partial class frmAnnotationsCleanup
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.lbAnnotationTypes = new System.Windows.Forms.ListBox();
this.itemAnnotationsBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.lblAnnotationsList = new System.Windows.Forms.Label();
this.btnClean = new System.Windows.Forms.Button();
this.lblCountNumber = new System.Windows.Forms.Label();
this.lblCount = new System.Windows.Forms.Label();
this.btnClose = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.itemAnnotationsBindingSource)).BeginInit();
this.SuspendLayout();
//
// lbAnnotationTypes
//
this.lbAnnotationTypes.DataSource = this.itemAnnotationsBindingSource;
this.lbAnnotationTypes.FormattingEnabled = true;
this.lbAnnotationTypes.Location = new System.Drawing.Point(25, 48);
this.lbAnnotationTypes.Name = "lbAnnotationTypes";
this.lbAnnotationTypes.Size = new System.Drawing.Size(295, 433);
this.lbAnnotationTypes.TabIndex = 0;
//
// lblAnnotationsList
//
this.lblAnnotationsList.AutoSize = true;
this.lblAnnotationsList.Location = new System.Drawing.Point(26, 21);
this.lblAnnotationsList.Name = "lblAnnotationsList";
this.lblAnnotationsList.Size = new System.Drawing.Size(175, 13);
this.lblAnnotationsList.TabIndex = 1;
this.lblAnnotationsList.Text = "Select an Annotation Type to Clean";
//
// btnClean
//
this.btnClean.Location = new System.Drawing.Point(365, 164);
this.btnClean.Name = "btnClean";
this.btnClean.Size = new System.Drawing.Size(131, 36);
this.btnClean.TabIndex = 2;
this.btnClean.Text = "Proceed?";
this.btnClean.UseVisualStyleBackColor = true;
this.btnClean.Click += new System.EventHandler(this.button1_Click);
//
// lblCountNumber
//
this.lblCountNumber.AutoSize = true;
this.lblCountNumber.Location = new System.Drawing.Point(395, 100);
this.lblCountNumber.Name = "lblCountNumber";
this.lblCountNumber.Size = new System.Drawing.Size(69, 13);
this.lblCountNumber.TabIndex = 3;
this.lblCountNumber.Text = "Delete Count";
this.lblCountNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblCount
//
this.lblCount.AutoSize = true;
this.lblCount.Location = new System.Drawing.Point(331, 70);
this.lblCount.Name = "lblCount";
this.lblCount.Size = new System.Drawing.Size(206, 13);
this.lblCount.TabIndex = 4;
this.lblCount.Text = "Number of Annotations that will be deleted";
//
// btnClose
//
this.btnClose.Location = new System.Drawing.Point(397, 457);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(75, 23);
this.btnClose.TabIndex = 5;
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// frmAnnotationsCleanup
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(549, 535);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.lblCount);
this.Controls.Add(this.lblCountNumber);
this.Controls.Add(this.btnClean);
this.Controls.Add(this.lblAnnotationsList);
this.Controls.Add(this.lbAnnotationTypes);
this.Name = "frmAnnotationsCleanup";
this.Text = "Clean Annotations";
((System.ComponentModel.ISupportInitialize)(this.itemAnnotationsBindingSource)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ListBox lbAnnotationTypes;
private System.Windows.Forms.Label lblAnnotationsList;
private System.Windows.Forms.BindingSource itemAnnotationsBindingSource;
private System.Windows.Forms.Button btnClean;
private System.Windows.Forms.Label lblCountNumber;
private System.Windows.Forms.Label lblCount;
private System.Windows.Forms.Button btnClose;
}
}

View File

@@ -0,0 +1,158 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using VEPROMS.CSLA.Library;
using Volian.Base.Library;
//using Volian.Pipe.Library;
using System.Xml;
using System.Diagnostics;
using JR.Utils.GUI.Forms;
namespace VEPROMS
{
public partial class frmAnnotationsCleanup : Form
{
Label mylab = new Label();
string procList = "";
string docvList = "";
int AnnotationTyp;
List<ProcedureInfo> pil2 = new List<ProcedureInfo>();
List<DocVersionInfo> dvil2 = new List<DocVersionInfo>();
private frmBatchRefresh mainForm = null;
// frmAnnotationsCleanup constructor passes users procedure and docversion selections from frmBatchRefresh
public frmAnnotationsCleanup(Form callingForm, List<ProcedureInfo> pil, List<DocVersionInfo> dvil)
{ // Set up link back to parent form.
mainForm = callingForm as frmBatchRefresh;
InitializeComponent();
pil2 = pil;
dvil2 = dvil;
// Get list of annotation types for plant.
myAnnotationTypeInfoList = AnnotationTypeInfoList.Get();
lbAnnotationTypes.DataSource = myLocalAnnotationTypeInfoList = new LocalAnnotationTypeInfoList(myAnnotationTypeInfoList);
Dictionary<string, string> AnnotationsList = new Dictionary<string, string>();
// Add name and type ID to form.
foreach (LocalAnnotationTypeInfo lati in myLocalAnnotationTypeInfoList)
{
AnnotationsList.Add(lati.TypeID.ToString(), lati.Name);
//cbAnnotationTypes.Items.Add(new { Name = lati.Name, Value = lati.TypeID });
}
lbAnnotationTypes.DataSource = new BindingSource(AnnotationsList, null);
lbAnnotationTypes.DisplayMember = "Value";
lbAnnotationTypes.ValueMember = "Key";
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
}
// create comma delimited string of procedures selected by user.
private string getAnnotationProcItems(List<ProcedureInfo> pil2)
{
procList = "";
foreach (var p in pil2)
{
if (p.IsProcedure)
{
if (procList == "")
{
procList = procList + p.ItemID.ToString();
}
else
{
procList = procList + "," + p.ItemID.ToString();
}
}
}
return procList;
}
// create comma delimited string of doc versions selected by user.
private string getAnnotationDocvItems(List<DocVersionInfo> dvil2)
{
docvList = "";
foreach (var d in dvil2)
{
if (d.IsDocVersion)
{
if (docvList == "")
{
docvList = docvList + d.VersionID.ToString();
}
else
{
docvList = docvList + "," + d.VersionID.ToString();
}
}
}
return docvList;
}
private AnnotationTypeInfoList myAnnotationTypeInfoList = null;
private LocalAnnotationTypeInfoList myLocalAnnotationTypeInfoList = null;
// Process used to cleanup annotations "(Proceed?" button)
private void button1_Click(object sender, EventArgs e)
{
foreach (var p in pil2)
{
if (p.IsProcedure)
{
TextBox frm2 = mainForm.GettxtProcess();
frm2.AppendText(p.DisplayNumber + ' ' + p.DisplayText);
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
lblCountNumber.Text = "0";
}
}
foreach (var d in dvil2)
{
if (d.IsDocVersion)
{
TextBox frm2 = mainForm.GettxtProcess();
frm2.AppendText(d.ActiveParent.ToString());
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
lblCountNumber.Text = "0";
}
}
}
// Retrieve number of annotations that will be deleted.
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
{
btnClean.Enabled = false;
lblCountNumber.Text = "";
int deletecountProc = 0;
int deletecountDocv = 0;
if (pil2.Count > 0)
{
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(pil2));
}
if (dvil2.Count > 0)
{
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2));
}
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
btnClean.Enabled = true;
}
// Close form.
private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="itemAnnotationsBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -22,12 +22,29 @@ namespace VEPROMS
set { _MySessionInfo = value; }
}
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
// C2017-030 - new Admin Tools user interface
// pass in session info to constructor
public frmBatchRefresh(SessionInfo sessionInfo)
// C2017-030 - new Admin Tools user interface
// pass in session info to constructor
private frmVEPROMS _veProms;
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
{
InitializeComponent();
_MySessionInfo = sessionInfo;
_veProms = veProms;
if (sideNavItmDelete.Checked)
{
AdminToolType = (E_AdminToolType)4;
if (swDeleteFolder.Value)
{
ResetDelTV(true);
setupProgessSteps1();
}
else
ResetDelTV(false);
}
setupProgessSteps1(); // C2017-030 - new Admin Tools user interface
UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID);
IsAdministratorUser = ui.IsAdministrator();
@@ -43,18 +60,25 @@ namespace VEPROMS
swStandardHypenChars.Enabled = false;
}
}
// Make txtProcess text box available to frmAnnotationsClean form.
internal TextBox GettxtProcess()
{
return txtProcess;
}
// NOTE: removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed)
// the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both
// also annotations will be placed on step elements that have RO changes
// make all of the hyphen character consistant so they can all be found with the Search function
private void FixHyphens()
{
this.Cursor = Cursors.WaitCursor;
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Standardizing Hyphens");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int affectedRows = ESP_FixHyphens.Execute("vesp_FixHyphens") / 2;// Two results for each change
@@ -65,7 +89,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -74,6 +98,7 @@ namespace VEPROMS
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
private Dictionary<TreeNode, FolderInfo> myFolders = new Dictionary<TreeNode, FolderInfo>();
private void frmBatchRefresh_Load(object sender, EventArgs e)
{
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
@@ -116,6 +141,8 @@ namespace VEPROMS
//myTreeNodePath = new List<string>();
myTV.Nodes.Clear();
myDocVersions.Clear();
myFolders.Clear();
FolderInfo fi = FolderInfo.GetTop();
TreeNode tn = myTV.Nodes.Add(fi.Name);
tn.Tag = fi;
@@ -125,30 +152,87 @@ namespace VEPROMS
myTV.SelectedNode.Expand();
this.Cursor = Cursors.Default;
}
private void ResetDelTV()
{
ResetDelTV(false);
}
private void ResetDelTV(bool noProcs)
{
btnFixLinks.Enabled = false;
this.Cursor = Cursors.WaitCursor;
myTVdel.Nodes.Clear();
myDocVersions.Clear();
FolderInfo fi = FolderInfo.GetTop();
if (fi.ChildFolderCount > 0)
{
TreeNode tn = new TreeNode(fi.Name);
tn.Tag = fi;
tn.StateImageIndex = -1; // Hide the checkbox for the root node
LoadChildFolders(fi, tn, noProcs);
myTVdel.Nodes.Add(tn);
}
if (myTVdel.SelectedNode != null)
myTVdel.SelectedNode.Expand();
//Expand if folders
if (noProcs)
myTVdel.ExpandAll();
this.Cursor = Cursors.Default;
}
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
private bool LoadChildFolders(FolderInfo fi, TreeNode tn, bool noProcs)
{
bool loadedWorkingDraft = false;
bool loadedChildWorkingDraft = false; // B2021-060 flag when child folder working draft is loaded
bool loadedChildWorkingDraft = false;
foreach (FolderInfo fic in fi.SortedChildFolders)
{
TreeNode tnc = tn.Nodes.Add(fic.Name);
tnc.Tag = fic;
if (fic.ChildFolderCount > 0)
if(LoadChildFolders(fic, tnc, noProcs))
loadedChildWorkingDraft=true;
// B2020-114 and C2020-035 only show folders the Set Admin can access
{
if (LoadChildFolders(fic, tnc, noProcs))
{
loadedChildWorkingDraft = true;
}
}
if (fic.FolderDocVersionCount > 0)
{
if (!LoadDocVersions(fic, tnc, noProcs))
{
tnc.Remove();
}
else
{
loadedWorkingDraft = true;
}
}
else
{
// Add the folder to the dictionary
if (!myFolders.ContainsKey(tnc))
{
myFolders.Add(tnc, fic);
}
}
}
if (loadedChildWorkingDraft) loadedWorkingDraft = true; // B2021-060 if child folder working draft loaded set loadedWorkingDraft
if (loadedChildWorkingDraft)
{
loadedWorkingDraft = true;
}
if (tn.Parent != null && !loadedWorkingDraft)
{
tn.Remove();
}
return loadedWorkingDraft;
}
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
@@ -201,7 +285,7 @@ namespace VEPROMS
private void UpdateROValues()
{
this.Cursor = Cursors.WaitCursor;
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
List<ProcedureInfo> pil = new List<ProcedureInfo>(); // C2023-002: list of checked out procedures, used in frmBatchRefreshCheckedOut dialog
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
foreach (TreeNode tn in myDocVersions.Keys)
if (tn.Checked)
@@ -273,7 +357,7 @@ namespace VEPROMS
sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?");
frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(1);
frmCO.MySessionInfo = MySessionInfo;
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
frmCO.CheckedOutProcedures = pil; // C2023-002: set list of checked out procedures
frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height);
// C2023-002: Allow close of dialog that has list of procedures that are checked out
if (frmCO.ShowDialog(this) != DialogResult.Cancel)
@@ -412,7 +496,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Refresh Transitions");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtResults.AppendText("Refresh Transitions");
txtResults.AppendText(Environment.NewLine);
@@ -449,19 +533,19 @@ namespace VEPROMS
Application.DoEvents();
}
}
if (numTransFixed == 0 && numTransConverted ==0)
if (numTransFixed == 0 && numTransConverted == 0)
{
txtResults.AppendText("No Transitions Needed Updated.");
txtResults.AppendText(Environment.NewLine);
}
ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange);
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Transitions Checked: {0}",numTransProcessed));
txtProcess.AppendText(string.Format("Transitions Checked: {0}", numTransProcessed));
txtProcess.AppendText(Environment.NewLine);
// B2018-002 - Invalid Transitions - Display Transition Refresh Statistics
txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}",numTransProcessed - (numTransConverted + numTransFixed)));
txtProcess.AppendText(string.Format("Transitions Correct As Is: {0}", numTransProcessed - (numTransConverted + numTransFixed)));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Transitions Modified: {0}", numTransFixed));
txtProcess.AppendText(Environment.NewLine);
@@ -490,10 +574,10 @@ namespace VEPROMS
}
this.Cursor = Cursors.Default;
// B2018-002 - Invalid Transitions - Display Transition Refresh Statisitic
if (numTransFixed == 0 && numTransConverted ==0)
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.",numTransProcessed), "Refresh Transitions Completed");
if (numTransFixed == 0 && numTransConverted == 0)
MessageBox.Show(string.Format("{0} Transitions Checked.\n\nNo Transitions Modified.", numTransProcessed), "Refresh Transitions Completed");
else
MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted),numTransFixed, numTransConverted), "Refresh Transitions Completed");
MessageBox.Show(string.Format("{0} Transitions Checked.\n\n {1} Correct as is.\n\n {2} Transitions modified.\n\n {3} Transitions converted to text.", numTransProcessed, numTransProcessed - (numTransFixed + numTransConverted), numTransFixed, numTransConverted), "Refresh Transitions Completed");
}
// C2017-030 - new Admin Tools user interface
@@ -506,7 +590,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Refreshing Word Attachments");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int affectedRows = ESP_DeletePDFs.Execute("vesp_DeletePDFs");
@@ -516,7 +600,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
txtResults.AppendText(Environment.NewLine);
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -561,7 +645,7 @@ namespace VEPROMS
private int RefreshForSearch()
{
int cntfix = 0;
List<int> gids = GridInfoList.GetIds(); // get all grids in database
List<int> gids = GridInfoList.GetIds(); // get all grids in database
pbProcess.Minimum = 0;
pbProcess.Maximum = gids.Count;
pbProcess.Step = 1;
@@ -570,7 +654,7 @@ namespace VEPROMS
using (Content cc = Content.Get(cid))
{
StepConfig sc = new StepConfig(cc.Config);
if (!sc.Step_FixedTblForSrch) // if not processed through this code already, get searchable text & save
if (!sc.Step_FixedTblForSrch) // if not processed through this code already, get searchable text & save
{
try
{
@@ -615,7 +699,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Identifing Orphan Items");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
@@ -636,7 +720,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -652,7 +736,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Purging Orphan Items");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount");
@@ -689,7 +773,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -704,7 +788,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Identifing Unused RoFsts and Figures");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
@@ -727,9 +811,9 @@ namespace VEPROMS
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
this.Cursor = Cursors.Default;
@@ -742,7 +826,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Purging Unused RoFSTs and Figures Items");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount");
@@ -783,7 +867,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -798,7 +882,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Identifing Unused RO Associations");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
@@ -817,7 +901,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -832,7 +916,7 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Purging Unused Referenced Object Associations");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount");
@@ -866,7 +950,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -881,11 +965,11 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Identifing Hidden Item Locations");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
List<ItemInfo> myItems = ESP_IdentifyNonEditableItems.Execute("vesp_GetNonEditableItems");
txtProcess.AppendText(string.Format("Hidden Items Count: {0}",myItems.Count));
txtProcess.AppendText(string.Format("Hidden Items Count: {0}", myItems.Count));
txtProcess.AppendText(Environment.NewLine);
if (myItems.Count > 0)
{
@@ -906,7 +990,7 @@ namespace VEPROMS
txtResults.AppendText(Environment.NewLine);
}
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
@@ -921,16 +1005,16 @@ namespace VEPROMS
DateTime pStart = DateTime.Now;
txtProcess.AppendText("Show Users in PROMS");
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(string.Format("Started: {0}",pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Started: {0}", pStart.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(Environment.NewLine);
Application.DoEvents();
txtResults.Clear();
txtResults.AppendText(ESP_GetDatabaseSessions.Execute("vesp_GetDatabaseSessions"));
DateTime pEnd = DateTime.Now;
txtProcess.AppendText(string.Format("Completed: {0}",pEnd.ToString("MM/dd/yyyy @ HH:mm")));
txtProcess.AppendText(string.Format("Completed: {0}", pEnd.ToString("MM/dd/yyyy @ HH:mm")));
Application.DoEvents();
this.Cursor = Cursors.Default;
MessageBox.Show( "Show Users Completed", "Show Users");
MessageBox.Show("Show Users Completed", "Show Users");
}
private void ProcessUpdateROValues(DocVersionInfo dq)
@@ -1085,7 +1169,7 @@ namespace VEPROMS
}
else // B2018-002 - Invalid Transitions - Display Transition Cconversion Statistics
{
myFixes.AppendLine(string.Format("Converted Transition to text for {0}({1})", (sender as ItemInfo).ShortPath, (sender as ItemInfo).ItemID));
myFixes.AppendLine(string.Format("Converted Transition to text for {0}({1})", (sender as ItemInfo).ShortPath, (sender as ItemInfo).ItemID));
}
}
@@ -1121,10 +1205,35 @@ namespace VEPROMS
CheckChildNodes(e.Node, e.Node.Checked);
}
}
if (swDeleteAnnotations.Value)
{
if (e.Node.Checked)
{
DiselectParentNodes(e.Node.Parent);
DiselectChildNodes(e.Node.Nodes);
}
}
btnFixLinks.Enabled = AtLeastOneNodeChecked(); // C2017-030 support for Refresh Transitions/Update RO Values
}
private void DiselectParentNodes(TreeNode parent)
{
while (parent != null)
{
if (parent.Checked)
parent.Checked = false;
parent = parent.Parent;
}
}
private void DiselectChildNodes(TreeNodeCollection childes)
{
foreach (TreeNode oneChild in childes)
{
if (oneChild.Checked)
oneChild.Checked = false;
DiselectChildNodes(oneChild.Nodes);
}
}
private void CheckChildNodes(TreeNode treeNode, bool ischecked)
{
foreach (TreeNode tn in treeNode.Nodes)
@@ -1138,6 +1247,80 @@ namespace VEPROMS
}
}
//After check model to select and deselect nodes on the delete and annotation tree.
private void myTV_AfterCheck_DelAnn(object sender, TreeViewEventArgs e)
{
if (e.Action != TreeViewAction.Unknown)
{
if (e.Node.Nodes.Count > 0)
{
CheckChildNodes_DelAnn(e.Node, e.Node.Checked);
}
}
if (e.Node.Checked)
{
// Ensure child nodes follow the parent node's state
CheckChildNodes_DelAnn(e.Node, e.Node.Checked);
}
else
{
// Automatically deselect parent nodes if current node is unchecked
if (swDeleteFolder.Value)
DiselectParentNodes_DelAnn(e.Node);
}
btnFixLinks.Enabled = AtLeastOneNodeChecked_DelAnn(); // Ensure button is enabled based on custom logic
}
private void DiselectParentNodes_DelAnn(TreeNode node)
{
TreeNode parent = node.Parent;
while (parent != null)
{
parent.Checked = false;
parent = parent.Parent;
}
}
private void DiselectChildNodes_DelAnn(TreeNodeCollection children)
{
foreach (TreeNode child in children)
{
child.Checked = false;
DiselectChildNodes_DelAnn(child.Nodes);
}
}
private void CheckChildNodes_DelAnn(TreeNode treeNode, bool isChecked)
{
foreach (TreeNode tn in treeNode.Nodes)
{
tn.Checked = isChecked;
if (tn.Nodes.Count > 0)
CheckChildNodes_DelAnn(tn, isChecked);
}
}
private bool AtLeastOneNodeChecked_DelAnn()
{
foreach (TreeNode node in myTV.Nodes)
{
if (node.Checked || AnyChildNodeChecked_DelAnn(node))
return true;
}
return false;
}
private bool AnyChildNodeChecked_DelAnn(TreeNode node)
{
foreach (TreeNode childNode in node.Nodes)
{
if (childNode.Checked || AnyChildNodeChecked_DelAnn(childNode))
return true;
}
return false;
}
private ProgressBarItem _ProgressBar = null;
public ProgressBarItem ProgressBar
@@ -1246,6 +1429,24 @@ namespace VEPROMS
this.Close();
}
// new Admin Tools user interface for deletes
private void sideNavItmDelete_Click(object sender, EventArgs e)
{
AdminToolType = E_AdminToolType.Delete;
setupProgessSteps1();
if (swDeleteFolder.Value)
ResetDelTV(true);
else
ResetDelTV(false);
}
// new Admin Tools user interface for deletes
//private void sideNavItmDelete_Click_1(object sender, EventArgs e)
//{
//}
#region On/Off Swiches
// C2017-030 new Admin Tools user interface
@@ -1254,7 +1455,8 @@ namespace VEPROMS
Check = 0,
Repair = 1,
Links = 2,
Users = 3
Users = 3,
Delete = 4
};
private E_AdminToolType AdminToolType = 0;
@@ -1305,6 +1507,23 @@ namespace VEPROMS
splitContainer3.Panel2Collapsed = true;
progressSteps1.Visible = false;
break;
case E_AdminToolType.Delete:
if (swDeleteFolder.Value)
{
splitContainer3.Panel2Collapsed = false;
progressSteps1.Items.Add(siOrphDatRecs);
lblAdmToolProgressType.Text = "Repairing: ";
progressSteps1.Visible = true;
progressSteps1.Refresh();
}
else
{
lblAdmToolProgressType.Text = "";
splitContainer3.Panel2Collapsed = true;
progressSteps1.Visible = false;
}
break;
}
}
@@ -1500,5 +1719,171 @@ namespace VEPROMS
}
}
//C2024-005 Delete Annotations, Delete Folders
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
{
setupProgessSteps1();
swDeleteFolder.Value = !swDeleteAnnotations.Value;
if (swDeleteFolder.Value)
ResetDelTV(true);
else
ResetDelTV(false);
}
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
{
setupProgessSteps1();
swDeleteAnnotations.Value = !swDeleteFolder.Value;
if (swDeleteFolder.Value)
ResetDelTV(true);
else
ResetDelTV(false);
}
private void btnDeleteItems_Click(object sender, EventArgs e)
{
//clear
txtResults.Clear();
txtProcess.Clear();
if (swDeleteFolder.Value)
{
if (FlexibleMessageBox.Show(this, "You sure you want to remove the selected folders and their contents?", "Confirm Folder Deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
txtProcess.AppendText("Deleting Folders...");
//Load Selected Folders with docversions
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
foreach (TreeNode tn in myDocVersions.Keys)
if (tn.Checked)
dvil.Add(myDocVersions[tn]);
//Load Selected Folders with docversions
List<FolderInfo> ef = new List<FolderInfo>();
foreach (TreeNode tn in myFolders.Keys)
if (tn.Checked)
ef.Add(myFolders[tn]);
ProcessDelete(dvil, ef);
}
}
else
{
// Write progress status
txtProcess.AppendText("Deleting Annotations...");
// Create a list of procedures the user selected
List<ProcedureInfo> pil = new List<ProcedureInfo>();
foreach (TreeNode tn in myProcedures.Keys)
if (tn.Checked)
pil.Add(myProcedures[tn]);
// Create a list of doc versions the user selected
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
foreach (TreeNode tn in myDocVersions.Keys)
if (tn.Checked)
dvil.Add(myDocVersions[tn]);
frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil);
frmAnnoDel.ShowDialog();
}
}
private void ProcessDelete(List<DocVersionInfo> foldersToDelete, List<FolderInfo> emptyFoldersToDelete)
{
DateTime pStart = DateTime.Now;
txtProcess.AppendText(Environment.NewLine);
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
txtProcess.AppendText(Environment.NewLine);
foreach (var kvp in foldersToDelete)
{
//Gather folder information
FolderInfo fi = (FolderInfo)kvp.ActiveParent;
int itemID = (int)fi.FolderID;
string folderName = fi.Name;
// Perform the deletion operation
bool deletionSuccessful = DeleteFolderByID(itemID);
// Update txtProcess with the progress
if (deletionSuccessful)
{
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
}
else
{
txtProcess.AppendText($"Failed to delete folder: {folderName} (ID: {itemID})");
}
txtProcess.AppendText(Environment.NewLine);
}
//Delete non working info folders.
foreach (var kvp in emptyFoldersToDelete)
{
//Gather folder information
FolderInfo fi = (FolderInfo)kvp;
int itemID = (int)fi.FolderID;
string folderName = fi.Name;
// Perform the deletion operation
bool deletionSuccessful = DeleteFolderByID(itemID);
// Update txtProcess with the progress
if (deletionSuccessful)
{
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
}
else
{
txtProcess.AppendText($"Failed to delete folder: {folderName} (ID: {itemID})");
}
txtProcess.AppendText(Environment.NewLine);
}
//Run Repair
int prgStpIdx = -1;
StepProgress(++prgStpIdx, 50);
PurgeDisconnectedItems(); // Orphan Items
StepProgress(prgStpIdx, 100);
//rebuild
ResetDelTV(true);
MessageBox.Show("Folder Deletion Completed", "Delete Folders");
ClearStepProgress();
}
private bool DeleteFolderByID(int folderID)
{
try
{
//Delete
Folder.DeleteFolderAdmin(folderID);
//update treeview UI via veProms
_veProms.tv_FolderDelete(folderID);
return true;
}
catch
{
return false;
}
}
public List<ProcedureInfo> RetrieveChkAnnotations()
{
List<ProcedureInfo> pil = new List<ProcedureInfo>();
foreach (TreeNode tn in myProcedures.Keys)
if (tn.Checked)
pil.Add(myProcedures[tn]);
return pil;
}
}
}

View File

@@ -117,27 +117,147 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<metadata name="superTooltip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="labelX13.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="swDeleteAnnotations.SuperTooltip" xml:space="preserve">
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
Be sure a current backup of the database exists prior to running this function.
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="labelX14.SuperTooltip" xml:space="preserve">
<value>This will allow for the deletion of groups of annotations and allow for deleting entire folders within PROMS. Use the tree nodes to select which items to delete.
Click on the on/off switches to turn on/off each tool.
Note that only one of these tools can be run at a time.</value>
</data>
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="labelX12.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="warningBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="swUpdateROVals.SuperTooltip" xml:space="preserve">
<value>This allows the user to update referenced objects values for multiple working drafts in a batch mode.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="swRefreshTrans.SuperTooltip" xml:space="preserve">
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
Be sure a current backup of the database exists prior to running this function.
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="labelX11.SuperTooltip" xml:space="preserve">
<value>This allows the user to update referenced objects values for multiple working drafts in a batch mode.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="labelX6.SuperTooltip" xml:space="preserve">
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
Be sure a current backup of the database exists prior to running this function.
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="warningBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="warningBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="swCkObsoleteROData.SuperTooltip" xml:space="preserve">
<value>Referenced Objects databases are associated with a procedure set (such as Working Draft).
@@ -184,91 +304,6 @@ This tool may take an extended period of time to execute.
Should an item become orphaned (disconnected) from the rest of the data, it will no longer be accessible. This tool detects any orphaned items in the database.
This tool may take an extended period of time to execute.
</value>
</data>
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="labelX12.SuperTooltip" xml:space="preserve">
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
Bad referenced bject links will be identified with an Bad RO Link annotation. Use the PROMS Search tool to list all of the steps that have this annotation.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="warningBox5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="swUpdateROVals.SuperTooltip" xml:space="preserve">
<value>This allows the user to update referenced objects values for multiple working drafts in a batch mode.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="swRefreshTrans.SuperTooltip" xml:space="preserve">
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
Be sure a current backup of the database exists prior to running this function.
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="labelX11.SuperTooltip" xml:space="preserve">
<value>This allows the user to update referenced objects values for multiple working drafts in a batch mode.
Be sure a current backup of the database exists prior performing this function.
It is recommended that this be done during off hours.
</value>
</data>
<data name="labelX6.SuperTooltip" xml:space="preserve">
<value>This function will refresh transitions in all procedures selected below, whether they were selected individually or as a group via a procedure set.
Be sure a current backup of the database exists prior to running this function.
If more than one procedure is selected, it is recommended that this be performed during off hours.</value>
</data>
<data name="warningBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="swRefreshTblsForSrch.SuperTooltip" xml:space="preserve">
@@ -285,37 +320,37 @@ This function will remove all of the saved attachment PDFS stored in the databas
</data>
<data name="warningBox4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="warningBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAplJREFUOE+N
k11IU2Ecxv9zouK8CULrzo8SU3QKaSYmOJ2uFL8SK4igEIok6qKUwggySTShC41CRiiGdWNfYBcVWiGl
FqN0lh+UTaekzuWcuu2c9316nSdKLPEHz817/s/zPv9zOPQ/nlVQEGulF3ILPe+8SIHK8eYR5lusLwHy
Oy08RqpXjjfHVCMlsydbGbekg4/r4HmwRbLWUZzyeGNqD5NK1O5lw8L8NQHckgh5SAdXA3UqIxuzZKSj
8ssI8Il9wMQeYDoVfD4HrsdhsNdRgTL2b4yl5Ce1qL+xcQOWxpKxMzwAMVEayIv7IU8XwVnv8+XuEfJV
xtfjMlKZ/CYG3JYJ96wOPj6EoCBfMCkfnJdguSMG89eoVBlfS+tJCpCafa1stgBYzAZbzoFGo0ZIiD84
KwJ350P+UQxHtfr7vUPkp9j+4GqiM1K3FtyVB8h5wlSI4GB/RIQHgjtzwWaywMb1WHwYg7lKOq3YVrlz
jPw8RrWFOUoAJhpwcaNciNDQQMRGB4FNpIMNp4B93A2pXw/7ZbWlufCvFguNdNzzOta7J5S6fP4AdkVq
kKQVAQNJYO8TwHq0kD8kwdkWhZkLdMJrrsonlfu2yszmSsA9Bat1p0XdsTTcvxmJtpowyL1ar/m3PKYM
2MpVgzcySUWTdWRwd+wAXzoo3r5B7CnqDqVg+lW89yuoVARrR/SaANm0F46mUFjOUjYtN9BTaVQYJzPA
RlPB+hNF3XjvP3C9bDuqTm2D9DZuTcCKXN1psJ2ndhGgnpJGciENGyB9zoJk1kMezFonySw0oIf0KVOs
oIO7L3MlYITstVTsrKNHCzXU5aimnvmrZPp5hfrtlWS2X6LBuQoatJWTWQz3C5mEeoS6hNqt5yj7FysJ
zJwL4b/EAAAAAElFTkSuQmCC
</value>
</data>
<data name="swRmObsoleteROData.SuperTooltip" xml:space="preserve">
<value>Referenced Objects databases are associated with a procedure set (such as Working Draft).
@@ -368,6 +403,6 @@ Should an item become orphaned (disconnected) from the rest of the data, it will
</value>
</data>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>38</value>
<value>46</value>
</metadata>
</root>

View File

@@ -45,7 +45,6 @@ namespace VEPROMS
this.itemContainer3 = new DevComponents.DotNetBar.ItemContainer();
this.btnNew = new DevComponents.DotNetBar.ButtonItem();
this.btnOpen = new DevComponents.DotNetBar.ButtonItem();
this.btnPrint = new DevComponents.DotNetBar.ButtonItem();
this.btnPrepare = new DevComponents.DotNetBar.ButtonItem();
this.btnAdmin = new DevComponents.DotNetBar.ButtonItem();
this.btnUpdateFormats = new DevComponents.DotNetBar.ButtonItem();
@@ -215,7 +214,7 @@ namespace VEPROMS
this.btnSendErrorLog,
this.btnShowErrFld,
this.btnShowPrtFld,
this.btnHelpAbout}); ;
this.btnHelpAbout});
this.btnHelp.Text = "Help";
//
// btnHelpManual
@@ -339,7 +338,6 @@ namespace VEPROMS
this.itemContainer3.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this.btnNew,
this.btnOpen,
this.btnPrint,
this.btnPrepare,
this.btnAdmin});
//
@@ -365,16 +363,7 @@ namespace VEPROMS
this.btnOpen.SubItemsExpandWidth = 24;
this.btnOpen.Text = "&Open...";
this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click);
//
// btnPrint
//
this.btnPrint.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText;
this.btnPrint.Enabled = false;
this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image")));
this.btnPrint.Name = "btnPrint";
this.btnPrint.SubItemsExpandWidth = 24;
this.btnPrint.Text = "Create &PDF";
this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
//
// btnPrepare
//
@@ -1646,7 +1635,6 @@ namespace VEPROMS
private DevComponents.DotNetBar.ButtonItem btnNew;
private DevComponents.DotNetBar.ButtonItem btnOpen;
private DevComponents.DotNetBar.ButtonItem btnPrepare;
private DevComponents.DotNetBar.ButtonItem btnPrint;
private DevComponents.DotNetBar.ItemContainer icRecentDocs;
private DevComponents.DotNetBar.LabelItem labelItem8;
private DevComponents.DotNetBar.ItemContainer itemContainer5;
@@ -1775,3 +1763,4 @@ namespace VEPROMS
}
}

View File

@@ -216,6 +216,8 @@ namespace VEPROMS
set { _MyDocVersion = value; }
}
// C2015-022 setup the child PROMS window
public frmVEPROMS(frmVEPROMS myParent, DocVersionInfo myDocVersion)
{
@@ -254,6 +256,22 @@ namespace VEPROMS
tc.RefreshItem(myItemInfo);
}
public void tv_FolderDelete(int folderId)
{
// Create an instance of the event args if needed
var args = new vlnTreeFolderDeleteEventArgs(folderId);
// Trigger the deletion using the event arguments
tv.RemoveFolder(args.FolderId);
}
private bool Tv_DeleteFolder(object sender, vlnTreeFolderDeleteEventArgs args)
{
tv.RemoveFolder(args.FolderId);
return true;
}
private E_UCFImportOptions _UCFImportOptionsFromSettings;
public frmVEPROMS()
@@ -475,6 +493,7 @@ namespace VEPROMS
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay);
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
tv.DeleteFolder += new vlnTreeViewItemInfoDeleteFolderEvent(Tv_DeleteFolder);
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo);
@@ -1603,6 +1622,11 @@ namespace VEPROMS
return rtval;
}
private bool tv_DeleteFolder(object sender, vlnTreeItemInfoEventArgs args)
{
return true;
}
private bool tv_PasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args)
{
return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type);
@@ -2098,7 +2122,6 @@ namespace VEPROMS
btnAdministrativeTools.Click += new EventHandler(btnAdministrativeTools_Click);
btnAdmin.SubItems.Add(btnAdministrativeTools);
this.superTooltip1.SetSuperTooltip(btnPrint, new SuperTooltipInfo("Create PDF", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnExit, new SuperTooltipInfo("Exit", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnOptions, new SuperTooltipInfo("Options", null, null, null, null, eTooltipColor.Gray));
this.superTooltip1.SetSuperTooltip(btnManageSecurity, new SuperTooltipInfo("Manage Security", null, null, null, null, eTooltipColor.Gray));
@@ -2742,7 +2765,7 @@ namespace VEPROMS
void btnAdministrativeTools_Click(object sender, EventArgs e)
{
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo);
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo, this);
frm.ProgressBar = bottomProgBar;
frm.ShowDialog(this);
}
@@ -3126,22 +3149,44 @@ namespace VEPROMS
if (dvi != null)
{
DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi, true);
if (dvi.MultiUnitCount == 0) prnDlg.SelectedSlave = -1;
if (dvi.MultiUnitCount == 0)
{
prnDlg.SelectedSlave = -1;
}
else if (dvi.MultiUnitCount > 0)
{
string[] arguments = Environment.GetCommandLineArgs();
for (int i = 0; i < arguments.Length; i++)
{
if (arguments[i].Contains("/C="))
{
Console.WriteLine("In arguments loop");
//int num;
string[] childarg = arguments[i].Split('=');
if (int.TryParse(childarg[1], out int num))
{
prnDlg.SelectedSlave = num;
}
}
}
}
prnDlg.AllowDateTimePrefixSuffix = false; //C2018-033 don't append any selected date/time pdf file prefix or suffix (defined in working draft properties)
prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window
//prnDlg.FormClosed += new FormClosedEventHandler(prnDlg_FormClosed);
//while (!_RunNext) Application.DoEvents();
}
}
}
}
ranAuto = true;
}
}
}
if (ranAuto)
{
this.Close();
if (ranAuto)
{
this.Close();
}
}
}
}
@@ -4092,10 +4137,6 @@ namespace VEPROMS
lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole;
if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1)
btnPrint.Visible = false;
else
btnPrint.Visible = true;
// Reset the ribbon buttons B2016-148 (ex. a copystep done in a different procedure tab my require the paste step options to be active
if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment
@@ -4350,7 +4391,6 @@ namespace VEPROMS
ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); // set the CurrentItem (send Message) when the MSWord section is opened.
}
btnPrint.Enabled = (_CurrentItem != null);
}
void _LastStepRTB_EditModeChanged(object sender, EventArgs args)
@@ -4842,12 +4882,7 @@ namespace VEPROMS
StepRTB.MyFontFamily = cmbFont.SelectedValue as FontFamily;
}
private void btnPrint_Click(object sender, EventArgs e)
{
DlgPrintProcedure prnDlg = new DlgPrintProcedure(this._CurrentItem.MyProcedure);
prnDlg.MySessionInfo = MySessionInfo;
prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window
}
private void lblResolution_Click(object sender, EventArgs e)
{

View File

@@ -254,7 +254,7 @@ namespace VEPROMS
//
this.ppBtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ppBtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.ppBtnCancel.Location = new System.Drawing.Point(742, 342);
this.ppBtnCancel.Location = new System.Drawing.Point(742, 338);
this.ppBtnCancel.Margin = new System.Windows.Forms.Padding(2);
this.ppBtnCancel.Name = "ppBtnCancel";
this.ppBtnCancel.Size = new System.Drawing.Size(56, 21);
@@ -266,7 +266,7 @@ namespace VEPROMS
// ppBtnOK
//
this.ppBtnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ppBtnOK.Location = new System.Drawing.Point(669, 342);
this.ppBtnOK.Location = new System.Drawing.Point(669, 338);
this.ppBtnOK.Margin = new System.Windows.Forms.Padding(2);
this.ppBtnOK.Name = "ppBtnOK";
this.ppBtnOK.Size = new System.Drawing.Size(56, 21);

View File

@@ -29,6 +29,7 @@ namespace VEPROMS
private List<MiniConfig> _DeletedApples;
private List<EnhancedMiniConfig> _Enhanced;
private DocVersionConfig _DocVersionConfig;
private string _OrgPDFPath; // B2024-030 used to save last PDF path
// Default values
private string _DefaultFormatName = null;
@@ -97,6 +98,7 @@ namespace VEPROMS
_Initializing = true;
InitializeComponent();
_OrgPDFPath = _DocVersionConfig.Print_PDFLocation; // B2024-030 save last PDF path
btnGeneral.PerformClick(); // always start with General tab or button
_Initializing = false;
@@ -323,8 +325,6 @@ namespace VEPROMS
tiApplicability.Visible = false;
}
ppTxtBxPDFLoc.TextChanged += new EventHandler(ppTxtBxPDFLoc_TextChanged);
//end add new applicability stuff
lblProcSetRev.Visible = ppRTxtProcSetRev.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.MyStepSectionPrintData.UseXtraRevNumber;
@@ -538,11 +538,32 @@ namespace VEPROMS
}
}
// The following code was added to fix Bug B2013-117
private void ppTxtBxPDFLoc_TextChanged(object sender, EventArgs e)
//B2024-030 Check the PDF Location path and prompt to create the folders if needed
private void CheckPDFLocationPath()
{
if (_Initializing == false)
_DocVersionConfig.Print_PDFLocation = ppTxtBxPDFLoc.Text;
string pdfloc = ppTxtBxPDFLoc.Text;
if (pdfloc == string.Empty) return;
if (!Directory.Exists(ppTxtBxPDFLoc.Text))
{
string msg = string.Format(" The Folder: '{0}' does not exist. \n\nCreate it?", ppTxtBxPDFLoc.Text);
DialogResult dr = MessageBox.Show(msg, "PDF Location Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dr == DialogResult.Yes)
{
try
{
Directory.CreateDirectory(ppTxtBxPDFLoc.Text);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error trying to create folder", MessageBoxButtons.OK, MessageBoxIcon.Error);
_DocVersionConfig.Print_PDFLocation = _OrgPDFPath; // reset to the path we started with
}
}
else
{
_DocVersionConfig.Print_PDFLocation = _OrgPDFPath; // reset to the path we started with
}
}
}
private string AddSlaveNode(MiniConfig mc)
@@ -588,6 +609,9 @@ namespace VEPROMS
private void btnVersionsPropOK_Click(object sender, EventArgs e)
{
//B2024-030 Check the PDF Location path and prompt to create the folders if needed
CheckPDFLocationPath();
docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157
// if there is a change to the format, clean up any overridden formats that point to the selected item before saving the format change:
@@ -773,7 +797,6 @@ namespace VEPROMS
// B2019-132 update the association count for this working draft
_DocVersionConfig.MyDocVersion.MyDocVersionInfo.RefreshDocVersionAssociations();
this.Close();
}

View File

@@ -225,6 +225,86 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Error on Annotation.Delete", ex);
}
}
public static void DeleteAnnotationProcByType(int typID, string procList)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
try
{
DataPortal.Delete(new DeleteAnnotationProcByTypeCriteria(typID, procList));
AnnotationInfo.StaticOnInfoChanged();
}
catch (Exception ex)
{
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
if (exSQL != null && exSQL.Message.Contains("###Cannot Delete Item###"))
throw exSQL;
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
throw new DbCslaException("Error on Annotation.Delete", ex);
}
}
public static void DeleteAnnotationDocvByType(int typID, string versionID)
{
if (!CanDeleteObject())
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
try
{
DataPortal.Delete(new DeleteAnnotationDocvByTypeCriteria(typID, versionID));
AnnotationInfo.StaticOnInfoChanged();
}
catch (Exception ex)
{
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
if (exSQL != null && exSQL.Message.Contains("###Cannot Delete Item###"))
throw exSQL;
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
throw new DbCslaException("Error on Annotation.Delete", ex);
}
}
public static int getAnnotationProcCnt(int typID, string procList)
{
if (!CanGetObject())
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
try
{
Annotation ProcCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountProcCriteria(typID, procList));
AnnotationInfo.StaticOnInfoChanged();
return Annotation.ProcCnt;
//return Int32.Parse(ProcCnt);
}
catch (Exception ex)
{
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
if (exSQL != null && exSQL.Message.Contains("###Cannot retrieve Item###"))
throw exSQL;
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
throw new DbCslaException("Error on getAnnotationCountProcCriteria", ex);
}
}
public static int getAnnotationCountDocv(int typID, string procList)
{
if (!CanGetObject())
throw new System.Security.SecurityException("User not authorized to remove a Annotation");
try
{
Annotation DocvCnt = DataPortal.Fetch<Annotation>(new getAnnotationCountDocvCriteria(typID, procList));
AnnotationInfo.StaticOnInfoChanged();
return Annotation.DocvCnt;
}
catch (Exception ex)
{
System.Data.SqlClient.SqlException exSQL = SqlException(ex);
if (exSQL != null && exSQL.Message.Contains("###Cannot retrieve Item###"))
throw exSQL;
Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace);
throw new DbCslaException("Error on getAnnotationCountDocvCriteria", ex);
}
}
private static System.Data.SqlClient.SqlException SqlException(Exception ex)
{
Type sqlExType = typeof(System.Data.SqlClient.SqlException);
@@ -280,12 +360,209 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Item.DataPortal_Delete", ex);
}
}
[Serializable()]
protected class DeleteAnnotationProcByTypeCriteria
{
private int _typeID;
public int TypeID
{ get { return _typeID; } }
private string _procList;
public string ProcList
{ get { return _procList; } }
public DeleteAnnotationProcByTypeCriteria(int typeID, string procList)
{
_typeID = typeID;
_procList = procList;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private void DataPortal_Delete(DeleteAnnotationProcByTypeCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Delete", GetHashCode());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteAnnotationsProcByType";
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
cm.Parameters.AddWithValue("@procList", criteria.ProcList);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("Item.DataPortal_Delete Annotations by group", ex);
}
}
[Serializable()]
protected class DeleteAnnotationDocvByTypeCriteria
{
private int _typeID;
public int TypeID
{ get { return _typeID; } }
private string _versionID;
public string VersionID
{ get { return _versionID; } }
public DeleteAnnotationDocvByTypeCriteria(int typeID, string versionID)
{
_typeID = typeID;
_versionID = versionID;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private void DataPortal_Delete(DeleteAnnotationDocvByTypeCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Delete Annotations by Type Docv", GetHashCode());
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteAnnotationsDocvByType";
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
cm.Parameters.AddWithValue("@docvList", criteria.VersionID);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("Item.DataPortal_Delete Annotations by type Docv", ex);
}
}
private static int _procCnt;
public static int ProcCnt
{
get { return _procCnt; }
set { _procCnt = value; }
}
[Serializable()]
protected class getAnnotationCountProcCriteria
{
private int _procCnt;
public int ProcCnt
{ get { return _procCnt; }
set { _procCnt = value; }
}
private int _typeID;
public int TypeID
{ get { return _typeID; } }
private string _procList;
public string ProcList
{ get { return _procList; } }
public getAnnotationCountProcCriteria(int typeID, string procList, int procCnt = 0)
{
_typeID = typeID;
_procList = procList;
_procCnt = procCnt;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private getAnnotationCountProcCriteria DataPortal_Fetch(getAnnotationCountProcCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Fetch", GetHashCode());
try
{
//int ProcCnt;
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "getAnnotationProcCount";
cm.Parameters.AddWithValue("@procList", criteria.ProcList);
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
Annotation.ProcCnt = (int)cm.ExecuteScalar();
}
}
return criteria; //_procCnt.ToString();
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.GetAnnotationProcCnt", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("Annotation.GetAnnotationProcCnt by group", ex);
}
}
private static int _docvCnt;
public static int DocvCnt
{ get { return _docvCnt; }
set { _docvCnt = value; }
}
[Serializable()]
protected class getAnnotationCountDocvCriteria
{
private int _docvCnt;
public int DocvCnt
{ get { return _docvCnt; }
set { _docvCnt = value; }
}
private int _TypeID;
public int TypeID
{ get { return _TypeID; } }
private string _docvList;
public string DocvList
{ get { return _docvList; } }
public getAnnotationCountDocvCriteria(int typeID, string docvList, int docvCnt = 0)
{
_TypeID = typeID;
_docvList = docvList;
_docvCnt = docvCnt;
}
}
[Transactional(TransactionalTypes.TransactionScope)]
private getAnnotationCountDocvCriteria DataPortal_Fetch(getAnnotationCountDocvCriteria criteria)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Fetch", GetHashCode());
try
{
//int ProcCnt;
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "getAnnotationDocvCount";
cm.Parameters.AddWithValue("@typeid", criteria.TypeID);
cm.Parameters.AddWithValue("@DocvList", criteria.DocvList);
Annotation.DocvCnt = (int)cm.ExecuteScalar();
}
return criteria;
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex);
_ErrorMessage = ex.Message;
throw new DbCslaException("Item.DataPortal_Delete Annotations by group", ex);
}
}
}
//public partial class AnnotationTypeAnnotations
//{
// public static int GetAnnotationID()
// {
// return AnnotationTypeAnnotat
// }
//}
}

View File

@@ -1309,7 +1309,8 @@ namespace VEPROMS.CSLA.Library
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
{
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid);
TreeNode trn = null;
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid, trn);
}
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
@@ -2497,13 +2498,16 @@ namespace VEPROMS.CSLA.Library
}
#endregion
#region PasteReplace
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid)
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace)
{
bool tmp= false;
return PasteReplace(itemInfo, copyStartID, chgid, ref tmp);
bool tmp = false;
return PasteReplace(itemInfo, copyStartID, chgid, treeNodeReplace, ref tmp);
}
// B2017-179 return a bool (firstTrans) if we could not replace the step but the user wants to position to the first transition that needs resolved
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace, ref bool firstTrans)
{
firstTrans = false;
if (!CanDeleteObject())
@@ -2560,7 +2564,14 @@ namespace VEPROMS.CSLA.Library
}
else
{
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
//Create tree node for copied procedure when no other procedures exist in the folder
VETreeNode vtn = treeNodeReplace as VETreeNode;
DocVersionInfo dvi = vtn.VEObject as DocVersionInfo;
ItemInfo newProc = dvi.PasteChild(copyStartID);
VETreeNode tn1 = new VETreeNode(newProc);
treeNodeReplace.Nodes.Add(tn1); // add tree node to end of list.
treeNodeReplace = tn1;
}
return newItemInfo;
}

View File

@@ -1433,6 +1433,31 @@ namespace VEPROMS.CSLA.Library
throw new DbCslaException("Folder.Remove", ex);
}
}
[Transactional(TransactionalTypes.TransactionScope)]
public static void DeleteFolderAdmin(int folderID)
{
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.Remove", 0);
try
{
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandTimeout = Database.SQLTimeout;
cm.CommandText = "deleteFolderAdmin";
cm.Parameters.AddWithValue("@FolderID", folderID);
cm.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.Remove", ex);
throw new DbCslaException("Folder.Remove", ex);
}
}
#endregion
#region Exists
public static bool Exists(int folderID)
@@ -1536,6 +1561,8 @@ namespace VEPROMS.CSLA.Library
// Needs to be overriden to add new validation rules
}
}
#endregion
} // Class
#region Converter

View File

@@ -167,7 +167,9 @@ namespace VEPROMS.CSLA.Library
tn.ResetNode("Dummy GetFolder");
return tn;
}
// public abstract void LoadChildren();
// public abstract void LoadChildren();
//private long _Start;
//private Dictionary<string, long> _Timings=new Dictionary<string,long>();
//private void tReset()

View File

@@ -56,6 +56,9 @@ namespace Volian.Controls.Library
private ROFSTLookup.rochild selectedChld;
private DisplayTags displayTags;
#endregion
#region Properties
@@ -268,6 +271,10 @@ namespace Volian.Controls.Library
_searchTimer.Stop();
}
// Initialize the DisplayTags object
displayTags = new DisplayTags();
_progressBar = null;
}
@@ -968,7 +975,10 @@ namespace Volian.Controls.Library
errormsg = (replacingRO) ? "a graphics RO with a non-graphcis RO." : "a Graphics RO in an non-Figure or a non-Accessory Page type.";
//TODO: Prompt user to insert a new substep type that handles x/y Plots and place this RO into it
goodToGo = false;
}
}
break;
}

View File

@@ -346,10 +346,11 @@ namespace Volian.Controls.Library
ch = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag;
chld = ch.children;
// build a list of ROs to search
return _MyRODbID.ToString() + ":" + GetROsToSearch(chld);
//return _MyRODbID.ToString() + ":" + ch.roid + "0000," + GetROsToSearch(chld);
//if (strRtnStr.EndsWith(","))
// strRtnStr = strRtnStr.Substring(0, strRtnStr.Length - 1);
// B2022-118: remove the ending comma otherwise query will fail
string strRtnStr = _MyRODbID.ToString() + ":" + GetROsToSearch(chld);
if (strRtnStr.EndsWith(","))
strRtnStr = strRtnStr.Substring(0, strRtnStr.Length - 1);
return strRtnStr;
}
}
}
@@ -1939,6 +1940,13 @@ namespace Volian.Controls.Library
private string GetROsToSearch(ROFSTLookup.rochild[] chld)
{
string rtnstr = string.Empty;
// B2022-118: If the ro has child nodes in tree view but they aren't loaded, load them
if ((chld == null || chld.Length <= 0) && (cmboTreeROs.SelectedNode.Nodes != null || cmboTreeROs.SelectedNode.Nodes.Count >= 1))
{
ROFSTLookup.rochild ro = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag;
MyROFSTLookup.LoadChildren(ref ro);
chld = ro.children;
}
// B2022-026 RO Memory Reduction code - check children length
if (chld == null || chld.Length <= 0) // get a single ROID
@@ -1956,7 +1964,17 @@ namespace Volian.Controls.Library
if (roc.children != null && roc.children.Length > 0)
rtnstr += GetROsToSearch(roc.children);
else
rtnstr += ROFSTLookup.FormatRoidKey(roc.roid, false);
{
// B2022-118: If the ro has child nodes in tree view but they aren't loaded, load them
ROFSTLookup.rochild rot = roc;
MyROFSTLookup.LoadChildren(ref rot);
chld = rot.children;
if (rot.children != null && rot.children.Length > 0)
rtnstr += GetROsToSearch(rot.children);
else
rtnstr += string.Format("{0},", ROFSTLookup.FormatRoidKey(roc.roid, false));
}
}
}

View File

@@ -669,7 +669,7 @@ namespace Volian.Controls.Library
ItemInfo proc = myItemInfo.MyProcedure; // Find procedure Item
string key = "Item - " + proc.ItemID.ToString();
if (_MyDisplayTabItems.ContainsKey(key)) // If procedure page open use it
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
{
DisplayTabItem pg = _MyDisplayTabItems[key];
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
@@ -688,8 +688,14 @@ namespace Volian.Controls.Library
edtitm.PasteSiblingAfter(copyStartID);
break;
case ItemInfo.EAddpingPart.Replace:
EditItem ei = edtitm.PasteReplace(copyStartID);
if (ei == null) return false; //B2017-179 PasteReplace will return null if was aborted
if (ei == null)
{
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
return false; //B2017-179 PasteReplace will return null if was aborted
}
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
{
edtitm.Dispose();
@@ -702,6 +708,11 @@ namespace Volian.Controls.Library
return true;
}
}
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
{
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
return false; //B2017-179 PasteReplace will return null if was aborted
}
return false;
}

View File

@@ -640,7 +640,7 @@ namespace Volian.Controls.Library
this.btnFSrestore.Location = new System.Drawing.Point(112, 27);
this.btnFSrestore.Margin = new System.Windows.Forms.Padding(2);
this.btnFSrestore.Name = "btnFSrestore";
this.btnFSrestore.Size = new System.Drawing.Size(54, 26);
this.btnFSrestore.Size = new System.Drawing.Size(54, 20);
this.btnFSrestore.TabIndex = 6;
this.btnFSrestore.Text = "Restore";
this.btnFSrestore.UseVisualStyleBackColor = true;

View File

@@ -96,6 +96,22 @@ namespace Volian.Controls.Library
get { return Visible; }
set { if (Visible != value) Visible = value; }
}
/// <summary>
/// Expose text properties for height and widht to handle selecting RO Image Types.
/// </summary>
public string TbFSwd
{
get {return tbFSWd.Text;}
set { tbFSWd.Text = value; tbFSWd.Refresh(); trBarFS.Value = Convert.ToInt32(value); }
}
public string TbFSht
{
get { return tbFSHt.Text; }
set { tbFSHt.Text = value; tbFSHt.Refresh(); _origFigureSizeRatio = float.Parse(value) / float.Parse(tbFSWd.Text); }
}
#endregion
#region Constructor
public DisplayTags()
@@ -383,6 +399,8 @@ namespace Volian.Controls.Library
cmbCheckoff.Enabled = false;
}
// show the part of panel for resizing a figure (if figure already exists: MyImage is set for non-RO existing images & content.text has a link in it)
if (MyEditItem.MyItemInfo.IsFigure && (MyEditItem.MyItemInfo.MyContent.MyImage != null || MyEditItem.MyItemInfo.MyContent.Text.ToUpper().Contains("#LINK")))
{
@@ -391,20 +409,41 @@ namespace Volian.Controls.Library
int wd = (MyEditItem as ImageItem).MyPictureBox.Width;
_origFigureSizeRatio = (float)ht / (float)wd; // use this to keep width/height ratio while changing size.
float wd1 = (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.LeftMargin;
float ht1 = (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.PageLength - (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.TopMargin - 36; // 36 is to allow for end message
float wd2 = Math.Min(wd1, ht1 / _origFigureSizeRatio); // keep original ratio
trBarFS.Maximum = Math.Max((int)wd2, trBarFS.Maximum);
if (wd > trBarFS.Maximum) trBarFS.Maximum = wd + 1;
trBarFS.Minimum = Math.Min(wd, 72);
trBarFS.Value = (int)wd;
ImageItem ii = MyEditItem as ImageItem;
_origFigureSizeWidth = ii.MyPictureBox.Width;
tbFSWd.Text = ii.MyPictureBox.Width.ToString();
tbFSHt.Text = ii.MyPictureBox.Height.ToString();
float ht1 = (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.PageLength - (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.TopMargin - 36; // 36 is to allow for end message
float wd2 = Math.Min(wd1, ht1 / _origFigureSizeRatio); // keep original ratio
SetFigure(wd1, wd2);
tbFSWd.Text = wd.ToString();
tbFSHt.Text = ht.ToString();
//trBarFS.Maximum = Math.Max((int)wd2, trBarFS.Maximum);
//if (wd > trBarFS.Maximum) trBarFS.Maximum = wd + 1;
//trBarFS.Minimum = Math.Min(wd, 72);
//trBarFS.Value = (int)wd;
//ImageItem ii = MyEditItem as ImageItem;
//_origFigureSizeWidth = ii.MyPictureBox.Width;
//tbFSWd.Text = ii.MyPictureBox.Width.ToString();
//tbFSHt.Text = ii.MyPictureBox.Height.ToString();
}
else
{
groupPanelFigSize.Visible = false;
if (MyEditItem.MyItemInfo.IsFigure)
{
//No Current image, but still show groupPanelFigSize, will adjust when file is selected, but let's give it a default
//size on using the picturebox.
groupPanelFigSize.Visible = true;
int ht = (MyEditItem as ImageItem).MyPictureBox.Height;
int wd = (MyEditItem as ImageItem).MyPictureBox.Width;
_origFigureSizeRatio = (float)ht / (float)wd; // use this to keep width/height ratio while changing size.
float wd1 = (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.LeftMargin;
float ht1 = (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.PageLength - (float)MyEditItem.MyItemInfo.MyDocStyle.Layout.TopMargin - 36; // 36 is to allow for end message
float wd2 = Math.Min(wd1, ht1 / _origFigureSizeRatio); // keep original ratio
SetFigure(wd1, wd2);
}
else
groupPanelFigSize.Visible = false;
}
// change bar setting depends on whether step has changed (dts) as compared to date/time off the
@@ -516,6 +555,22 @@ namespace Volian.Controls.Library
}
_Initalizing = false;
}
public void SetFigure(double wd, double wd2)
{
// Check MyEditItem type and cast if needed
ImageItem ii = MyEditItem as ImageItem;
if (ii == null) return;
// Set the values as needed
trBarFS.Maximum = Math.Max((int)wd2, trBarFS.Maximum);
if (wd > trBarFS.Maximum) trBarFS.Maximum = (int)wd + 1;
trBarFS.Minimum = Math.Min((int)wd, 72);
trBarFS.Value = (int)wd;
_origFigureSizeWidth = ii.MyPictureBox.Width;
//tbFSWd.Text = ii.MyPictureBox.Width.ToString();
//tbFSHt.Text = ii.MyPictureBox.Height.ToString();
}
private int DoListStepTypes(FormatData fmtdata, StepData topType, string curType)
{
int cursel=-1;
@@ -857,7 +912,7 @@ namespace Volian.Controls.Library
}
}
private float _origFigureSizeRatio = 0; // keep original ratio & width in case of 'restore'
private int _origFigureSizeWidth = 0;
public int _origFigureSizeWidth = 0;
// support user changing size using slider. This saves change back to ImageItem and sets
// width/height text boxes to slider values.
private void trBarFS_Scroll(object sender, EventArgs e)
@@ -871,11 +926,14 @@ namespace Volian.Controls.Library
// restore the orignal image size
private void btnFSrestore_Click(object sender, EventArgs e)
{
tbFSWd.Text = _origFigureSizeWidth.ToString();
int ht = (int)(_origFigureSizeRatio * _origFigureSizeWidth);
tbFSHt.Text = ht.ToString();
(MyEditItem as ImageItem).SizeImage(_origFigureSizeWidth, ht);
trBarFS.Value = _origFigureSizeWidth;
if (_origFigureSizeWidth != 0)
{
tbFSWd.Text = _origFigureSizeWidth.ToString();
int ht = (int)(_origFigureSizeRatio * _origFigureSizeWidth);
tbFSHt.Text = ht.ToString();
(MyEditItem as ImageItem).SizeImage(_origFigureSizeWidth, ht);
trBarFS.Value = _origFigureSizeWidth;
}
}
// user entered width in text box, this event gets called on leave of text box.
private void tbFSWd_Leave(object sender, EventArgs e)

View File

@@ -1209,7 +1209,7 @@ namespace Volian.Controls.Library
{
EditItem child = null;
if (MyItemInfo.IsFigure)
child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem, FigInsType);
child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem, FigInsType, _MyStepPropertiesPanel);
else if (MyItemInfo.IsRtfRaw)
child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem);
else if (MyItemInfo.MyContent.MyGrid != null)
@@ -1222,7 +1222,7 @@ namespace Volian.Controls.Library
{
EditItem child = null;
if (MyItemInfo.IsFigure)
child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem, FigInsType);
child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem, FigInsType, _MyStepPropertiesPanel);
else if (MyItemInfo.IsRtfRaw)
child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem);
if (MyItemInfo.MyContent.MyGrid != null)
@@ -1825,7 +1825,16 @@ namespace Volian.Controls.Library
EditItem newFocus = null;
EditItem nextEditItem = MyNextEditItem;
EditItem prevEditItem = MyPreviousEditItem;
EditItem parentEditItem = ActiveParent;
EditItem parentEditItem = null; // ActiveParent;
try
{
parentEditItem = ActiveParent ?? MyStepPanel?.SelectedEditItem?.ActiveParent;
}
catch (NullReferenceException)
{
// KL 7/11/2024 - Handle the case where ActiveParent throws a Null Reference Exception
parentEditItem = MyStepPanel?.SelectedEditItem?.ActiveParent;
}
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
int TopMostYBefore = TopMostEditItem.Top;
@@ -1835,7 +1844,8 @@ namespace Volian.Controls.Library
bool gotoFirstTrans = false;
try
{
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), ref gotoFirstTrans);
TreeNode treeNodeReplace = null;
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), treeNodeReplace, ref gotoFirstTrans);
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
{
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);

View File

@@ -256,6 +256,8 @@ namespace Volian.Controls.Library
private int _origCfgHt = 0; // keep track if original size was stored in cfg
private int _origCfgWd = 0;
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
private DisplayTags _displayTags;
#endregion
#region Constructors
public ImageItem()
@@ -266,6 +268,7 @@ namespace Volian.Controls.Library
public ImageItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand)
{
InitializeComponent();
MyItemInfo = itemInfo;
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, false);
if (MyItemInfo.MyContent.MyImage != null && MyItemInfo.MyContent.MyImage.Data != null) // this is figure/image (not RO)
@@ -307,6 +310,7 @@ namespace Volian.Controls.Library
this.Height = MyPictureBox.Height + 10;
_newSizeWd = wd / (MyStepPanel.DPI / 72);
_newSizeHt = ht / (MyStepPanel.DPI / 72);
if (!MyItemInfo.FormatStepData.StepEditData.TypeMenu.MenuItem.ToUpper().Contains("AER")) ItemLocation = TableLocation(MyStepSectionLayoutData, ItemWidth);
_IsDirty = true;
}
@@ -330,13 +334,23 @@ namespace Volian.Controls.Library
MyPictureBox.SizeMode = PictureBoxSizeMode.Zoom; // as resize matches width/height.
this.Width = MyPictureBox.Width + ImageMargin;
this.Height = MyPictureBox.Height + 10;
if (_displayTags != null)
{
_displayTags._origFigureSizeWidth = wd;
_displayTags.TbFSwd = wd.ToString();
_displayTags.TbFSht = ht.ToString();
}
}
// the following gets called for 'NEW' images
private E_ImageSource InsType = E_ImageSource.None;
public ImageItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, ImageItem.E_ImageSource insType)
public ImageItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, ImageItem.E_ImageSource insType, DisplayTags displayTags)
{
InitializeComponent();
MyItemInfo = itemInfo;
_displayTags = displayTags;
if (MyItemInfo.MyContent.MyImage != null && MyItemInfo.MyContent.MyImage.Data != null) // this is figure/image (not RO)
{
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
@@ -368,8 +382,8 @@ namespace Volian.Controls.Library
FileName = null;
//InitializeComponent();
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
MyPictureBox.Width = 100;
MyPictureBox.Height = 100;
//MyPictureBox.Width = 100;
//MyPictureBox.Height = 100;
this.Width = 100 + ImageMargin;
this.Height = 100;
if (insType == ImageItem.E_ImageSource.File)
@@ -546,6 +560,7 @@ namespace Volian.Controls.Library
imageText = val;
}
AddROImageToScreen(W, H, imageText);
}
catch (Exception ex)
{

View File

@@ -2001,7 +2001,7 @@ namespace Volian.Controls.Library
btnReviewCreatePDF.Click -= new System.EventHandler(btnPdfCreate_Click);
btnReviewPdfQuickCreate.SubItems.Clear();
btnReviewPdfQuickCreate.Tag = null;
btnReviewPdfQuickCreate.Click -= new System.EventHandler(btnPdfCreate_Click);
btnReviewPdfQuickCreate.Click -= new System.EventHandler(btnPdfQuickCreate_Click);
int k = 0;
foreach (string s in unitNames)
{

View File

@@ -22,10 +22,11 @@ namespace Volian.Controls.Library
public delegate void vlnTreeViewEvent(object sender, vlnTreeEventArgs args);
public delegate void vlnTreeViewTimeEvent(object sender, vlnTreeTimeEventArgs args);
public delegate void vlnTreeViewStatusEvent(object sender, vlnTreeStatusEventArgs args);
public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args);
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate ItemInfo vlnTreeViewClipboardStatusEvent(object sender, vlnTreeEventArgs args);
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
public delegate bool vlnTreeViewItemInfoDeleteFolderEvent(object sender, vlnTreeFolderDeleteEventArgs args);
public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args);
public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args);
public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args);
@@ -220,6 +221,15 @@ namespace Volian.Controls.Library
}
#endregion
}
public class vlnTreeFolderDeleteEventArgs : EventArgs
{
public int FolderId { get; }
public vlnTreeFolderDeleteEventArgs(int folderId)
{
FolderId = folderId;
}
}
public enum E_InsertType {Before, After, Child};
public partial class vlnTreeItemInfoInsertEventArgs
{
@@ -427,6 +437,12 @@ namespace Volian.Controls.Library
if (DeleteItemInfo != null) return DeleteItemInfo(sender, args);
return false;
}
public event vlnTreeViewItemInfoDeleteFolderEvent DeleteFolder;
private bool OnDeleteFolder(object sender, vlnTreeFolderDeleteEventArgs args)
{
if (DeleteItemInfo != null) return DeleteFolder(sender, args);
return false;
}
public event vlnTreeViewItemInfoInsertEvent InsertItemInfo;
private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
{
@@ -551,11 +567,11 @@ namespace Volian.Controls.Library
{
if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args);
}
public event vlnTreeViewEvent ExportImportProcedureSets;
private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args)
{
if (ExportImportProcedureSets != null) ExportImportProcedureSets(sender, args);
}
public event vlnTreeViewEvent ExportImportProcedureSets;
private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args)
{
if (ExportImportProcedureSets != null) ExportImportProcedureSets(sender, args);
}
public event vlnTreeViewEvent PrintTransitionReport;
private void OnPrintTransitionReport(object sender, vlnTreeEventArgs args)
{
@@ -693,11 +709,11 @@ namespace Volian.Controls.Library
//_MyLog.WarnFormat("Context Menu 1b - {0}", GC.GetTotalMemory(true));
if (ui.IsAdministrator() || ui.IsSetAdministrator(fi))
{
if (fi.MyParent != null) // don't allow insert before/after if at top node
if (fi.MyParent != null) // don't allow insert before/after if at top node
{
if (!ui.IsAdministrator() && DoSpecificInfo) cm.MenuItems.Add("Procedure Set Specific Information", new EventHandler(mi_Click));
// B2020-111 only allow Set Administrator to add new folders inside folders they admininstrate
if (ui.IsAdministrator()||ui.IsSetAdministrator(fi.MyParent))
if (ui.IsAdministrator() || ui.IsSetAdministrator(fi.MyParent))
{
cm.MenuItems.Add("Insert Folder Before", new EventHandler(mi_Click));
cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click));
@@ -712,16 +728,16 @@ namespace Volian.Controls.Library
if (fi.HasWorkingDraft)
cm.MenuItems.Add("Print Transition Report", new EventHandler(mi_Click));
}
else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs
else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs
{
isWrkDftNode = true;
//_MyLog.WarnFormat("Context Menu 1c - {0}", GC.GetTotalMemory(true));
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi))
{
cm.MenuItems.Add("Import Procedure", mi_Click);
}
if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi))
{
cm.MenuItems.Add("Import Procedure", mi_Click);
}
if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi))
{
OwnerInfoList.Reset();
oil = OwnerInfoList.GetByVersionID(dvi.VersionID);
@@ -812,15 +828,15 @@ namespace Volian.Controls.Library
urv.Enabled = !dvi.ROfstLastCompleted || dvi.NewerRoFst;
}
}
else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections
else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections
{
isProcNode = true;
ProcedureInfo pri = tn.VEObject as ProcedureInfo;
oi = OwnerInfo.GetByItemID(pri.ItemID, CheckOutType.Procedure);
if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion))
{
cm.MenuItems.Add("Export Procedure", mi_Click);
}
{
cm.MenuItems.Add("Export Procedure", mi_Click);
}
if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion) || ui.IsWriter(pri.MyDocVersion))
{
if (oi != null && oi.SessionID != MySessionInfo.SessionID)
@@ -1052,36 +1068,36 @@ namespace Volian.Controls.Library
ok = true;
else if (tn.VEObject is ItemInfo && (ui.IsAdministrator() || ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)))
ok = true;
if(ok)
if (ok)
Menu_Paste(tn, cm);
#endregion
//_MyLog.WarnFormat("Context Menu 5 - {0}", GC.GetTotalMemory(true));
#region Menu_Delete
if (ok)
{
// Add delete to the menu unless at the very 'top' node, on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items.
PartInfo pi = tn.VEObject as PartInfo;
if (pi == null && tn.Parent != null) // it's not a part and it's not the top....
{
// Add delete to the menu unless at the very 'top' node, on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items.
PartInfo pi = tn.VEObject as PartInfo;
if (pi == null && tn.Parent != null) // it's not a part and it's not the top....
fi = tn.VEObject as FolderInfo;
if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children
{
fi = tn.VEObject as FolderInfo;
if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children
DocVersionInfo di = tn.VEObject as DocVersionInfo;
if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children
{
DocVersionInfo di = tn.VEObject as DocVersionInfo;
if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children
{
// if it's an enhanced step that was linked from a source, don't allow delete
bool canDoDel = true;
ItemInfo iienh = tn.VEObject as ItemInfo;
if (iienh != null && iienh.IsProcedure && iienh.IsEnhancedProcedure) canDoDel = false;
if (iienh != null && iienh.IsSection && iienh.IsEnhancedSection && !iienh.IsEnhancedSectionTitleOnly) canDoDel = false;
if (iienh != null && iienh.IsEnhancedStep) canDoDel = false;
if (canDoDel) cm.MenuItems.Add("Delete", new EventHandler(mi_Click));
}
// if it's an enhanced step that was linked from a source, don't allow delete
bool canDoDel = true;
ItemInfo iienh = tn.VEObject as ItemInfo;
if (iienh != null && iienh.IsProcedure && iienh.IsEnhancedProcedure) canDoDel = false;
if (iienh != null && iienh.IsSection && iienh.IsEnhancedSection && !iienh.IsEnhancedSectionTitleOnly) canDoDel = false;
if (iienh != null && iienh.IsEnhancedStep) canDoDel = false;
if (canDoDel) cm.MenuItems.Add("Delete", new EventHandler(mi_Click));
}
}
}
}
#endregion
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
#region Menu_ExternalTransitions
@@ -1117,13 +1133,13 @@ namespace Volian.Controls.Library
}
doclink = string.Format("Unlink Source and {0} Procedure", doclink);
MenuItem mix = cm.MenuItems.Add(doclink, new EventHandler(miEnhanced_Click));
mix.Tag = -1; // NOTE this is what flags what gets processed on menu click, i.e. -1
mix.Tag = -1; // NOTE this is what flags what gets processed on menu click, i.e. -1
}
// if this is a source procedure that has enhanced, for example Background and/or deviation, ask which should be unlinked including all
else if (eds != null && eds.Count > 1)
{
MenuItem miu = new MenuItem("Unlink Enhanced Procedure(s) from Source");
miu.Tag = -2; // this menu item doesn't get used.
miu.Tag = -2; // this menu item doesn't get used.
int k = 0;
foreach (EnhancedDocument ed in eds)
{
@@ -1134,7 +1150,7 @@ namespace Volian.Controls.Library
}
// add all submenu item
MenuItem mp1 = miu.MenuItems.Add("All", new EventHandler(miEnhanced_Click));
mp1.Tag = 0; // Tag of 0 flags All
mp1.Tag = 0; // Tag of 0 flags All
cm.MenuItems.Add(miu);
}
}
@@ -1144,8 +1160,8 @@ namespace Volian.Controls.Library
// Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo)
// node (RNOs, Steps, Cautions, Notes) or at the step level.
// B2020-105 Allow Set Administrators to rename folder's (sets of procedures) to which they have been given access.
if ( tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))
if (tn.VEObject is FolderInfo) ok = (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo));
else ok = (tn.VEObject is DocVersionInfo) ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))
: (ui.IsAdministrator() || (tn.VEObject is ItemInfo) && (ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)
|| ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)));
PartInfo pia = tn.VEObject as PartInfo;
@@ -1256,7 +1272,7 @@ namespace Volian.Controls.Library
// F2022-024 added Time Critical Action Summary option
foreach (MenuItem itm in cm.MenuItems)
{
if(itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" ||
if (itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" ||
itm.Text == "Copy" || itm.Text == "Delete" || itm.Text == "Properties..." || itm.Text == "Replace Existing Procedure" ||
itm.Text.StartsWith("Showing Change Bars Starting") || itm.Text == "Create Continuous Action Summary" ||
itm.Text == "Create Time Critical Action Summary" || itm.Text == "Export Procedure")
@@ -1267,7 +1283,7 @@ namespace Volian.Controls.Library
{
foreach (MenuItem itm in cm.MenuItems)
{
if(!itm.Text.StartsWith("Document Checked Out"))
if (!itm.Text.StartsWith("Document Checked Out"))
itm.Enabled = false;
}
}
@@ -1284,7 +1300,7 @@ namespace Volian.Controls.Library
{
_currentPri = pri;
RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID);
if (ril.Count == 0) return; // no versions to list
if (ril.Count == 0) return; // no versions to list
MenuItem mi = menuItemCollection.Add("Versions");
int k = 0;
int lastApprovedRevisionID = 0;
@@ -1331,11 +1347,11 @@ namespace Volian.Controls.Library
ril = null;
}
}
public void AddNewNode(IVEDrillDownReadOnly o)
{
VETreeNode tn = new VETreeNode(o);
SelectedNode.Nodes.Add(tn);
}
public void AddNewNode(IVEDrillDownReadOnly o)
{
VETreeNode tn = new VETreeNode(o);
SelectedNode.Nodes.Add(tn);
}
private void AddApprovedRevisions(Menu.MenuItemCollection menuItemCollection, ProcedureInfo pri)
{
try
@@ -1344,7 +1360,7 @@ namespace Volian.Controls.Library
_currentPri = pri;
using (RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID))
{
//_MyLog.WarnFormat("Context Menu 1 After GET - {0}", GC.GetTotalMemory(true));
//_MyLog.WarnFormat("Context Menu 1 After GET - {0}", GC.GetTotalMemory(true));
if (ril.Count == 0) return; // no versions to list
MenuItem mi = menuItemCollection.Add("Versions");
int lastApprovedRevisionID = 0;
@@ -1425,7 +1441,7 @@ namespace Volian.Controls.Library
RevisionConfig rc = ri.MyConfig as RevisionConfig;
// bug fix: B2016-183 - add the child's name (ex Unit 1) to the export file name for Parent/Child procedures.
int applIdx = rc.Applicability_Index;
string str = (applIdx > 0)?_currentPri.MyDocVersion.UnitNames[applIdx-1] +"_":""; // if parent/child get the defined child name to inlcude the export filename
string str = (applIdx > 0) ? _currentPri.MyDocVersion.UnitNames[applIdx - 1] + "_" : ""; // if parent/child get the defined child name to inlcude the export filename
System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
xd.LoadXml(ri.LatestVersion.ApprovedXML);
string PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database;
@@ -1473,12 +1489,12 @@ namespace Volian.Controls.Library
{
MenuItem mip = mi.Parent as MenuItem;
//B2021-086 Added the check for the last revision stage is an Approved stage
if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved!=0)
if ((ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) && ri.LatestVersion.MyStage.IsApproved != 0)
superceded = true;
}
vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber), ri.LatestVersion.PDF, superceded ? "Superceded" : "");
OnViewPDF(sender, args);
// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded));
// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded));
}
void MultiUnitApprovedRevision_Click(object sender, EventArgs e)
{
@@ -1591,7 +1607,7 @@ namespace Volian.Controls.Library
// 'from' is object copied
// 'to' is object where paste was selected from
#region Menu_Paste_ToDocVersion
if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc
if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc
{
if (iiClipboard.IsProcedure)
{
@@ -1612,11 +1628,17 @@ namespace Volian.Controls.Library
if (!docVersionIsEnhanced && !docVersionIsSource && !procIsSource) canPaste = true;
else if (docVersionIsSource && !procIsSource) canPaste = true;
else if (docVersionIsSource) canPaste = (!procIsSource || (iiClipboard.MyDocVersion.ItemID == dvi.ItemID));
else if (docVersionIsEnhanced) canPaste = !procIsSource;
else if (docVersionIsEnhanced)
{
// B2024-028 Do not allow paste of non-enhanced into enhanced set
// (consistent with paste before/after, i.e. don't allow)
canPaste = false;
cm.MenuItems.Add("CANNOT PASTE HERE, Click for more information...", new EventHandler(mi_Click));
}
if (iiClipboard.IsRtfRaw) canPaste = false; // never paste an equation.
if (canPaste) cm.MenuItems.Add("Paste Procedure", new EventHandler(mi_Click));
}
#endregion
#endregion
}
else
{
@@ -1627,7 +1649,7 @@ namespace Volian.Controls.Library
{
SectionInfo si = (tn.VEObject as SectionInfo != null) ? tn.VEObject as SectionInfo : null;
#region Menu_Paste_ToFromProcedure
if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after
if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after
{
// Enhanced considerations, in order to paste a procedure around another procedure: NOTE that an 'enhanced' procedure cannot be in paste buffer!
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
@@ -1651,16 +1673,16 @@ namespace Volian.Controls.Library
bool prFromIsEnhanced = iiClipboard.IsEnhancedProcedure;
bool prFromIsSource = pcFromCfg.MyEnhancedDocuments != null && pcFromCfg.MyEnhancedDocuments.Count > 0 && pcFromCfg.MyEnhancedDocuments[0].Type != 0;
bool prCanPaste = false;
if (!prToIsEnhanced && !prToIsSource && !prFromIsEnhanced && !prFromIsSource) prCanPaste = true; // 1)
// else if ((!prToIsEnhanced && !prToIsSource) && prFromIsSource) prCanPaste = false; // 2) commented out because already set to false
else if (prToIsSource && !prFromIsEnhanced && !prFromIsSource) // 3)
if (!prToIsEnhanced && !prToIsSource && !prFromIsEnhanced && !prFromIsSource) prCanPaste = true; // 1)
// else if ((!prToIsEnhanced && !prToIsSource) && prFromIsSource) prCanPaste = false; // 2) commented out because already set to false
else if (prToIsSource && !prFromIsEnhanced && !prFromIsSource) // 3)
{
prCanPaste = true;
okToReplace = false;
}
else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) prCanPaste = true; // 4)
//else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID != iiClipboard.MyDocVersion.VersionID) prCanPaste = false; // 5) commented out because already set to false
//else if (prToIsEnhanced && prFromIsSource) prCanPaste = false; // 6)commented out because already set to false
else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) prCanPaste = true; // 4)
//else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID != iiClipboard.MyDocVersion.VersionID) prCanPaste = false; // 5) commented out because already set to false
//else if (prToIsEnhanced && prFromIsSource) prCanPaste = false; // 6)commented out because already set to false
if (iiClipboard.IsRtfRaw) prCanPaste = okToReplace = prCanPaste = false; // never paste an equation.
if (prCanPaste) cm.MenuItems.Add("Paste Procedure Before", new EventHandler(mi_Click));
if (okToReplace && prCanPaste) cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click));
@@ -1670,9 +1692,9 @@ namespace Volian.Controls.Library
if (!prCanPaste)
{
if (prToIsEnhanced)
cm.MenuItems.Add("CANNOT PASTE HERE, Click for more information...", new EventHandler(mi_Click));
cm.MenuItems.Add("CANNOT PASTE HERE, Click for more information...", new EventHandler(mi_Click));
else
cm.MenuItems.Add("CANNOT PASTE HERE. Click for more information...", new EventHandler(mi_Click));
cm.MenuItems.Add("CANNOT PASTE HERE. Click for more information...", new EventHandler(mi_Click));
}
}
#endregion
@@ -1692,9 +1714,9 @@ namespace Volian.Controls.Library
bool scFromIsEnhanced = iiClipboard.IsEnhancedSection;
bool scFromIsSource = scFromCfg.MyEnhancedDocuments != null && scFromCfg.MyEnhancedDocuments.Count > 0 && scFromCfg.MyEnhancedDocuments[0].Type != 0;
bool scCanPaste = false;
if (!prToIsEnhanced && !prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; // 1)
if (!prToIsEnhanced && !prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true; // 1)
else if (prToIsSource && !scFromIsEnhanced && !scFromIsSource) scCanPaste = true;
else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) scCanPaste = true; // 3)
else if (prToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) scCanPaste = true; // 3)
if (iiClipboard.IsRtfRaw) scCanPaste = false; // never paste an equation.
if (scCanPaste) cm.MenuItems.Add("Paste Section", new EventHandler(mi_Click));
}
@@ -1718,13 +1740,13 @@ namespace Volian.Controls.Library
bool secFromIsEnhanced = iiClipboard.IsEnhancedSection;
bool secFromIsSource = secFromCfg.MyEnhancedDocuments != null && secFromCfg.MyEnhancedDocuments.Count > 0 && secFromCfg.MyEnhancedDocuments[0].Type != 0;
bool secCanPaste = false;
if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1)
else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2)
if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1)
else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2)
{
secCanPaste = true;
okToReplace = false;
}
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3)
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) secCanPaste = true; // 3)
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
@@ -1754,9 +1776,9 @@ namespace Volian.Controls.Library
bool stpFromIsEnhanced = iiClipboard.IsEnhancedStep;
bool stpFromIsSource = stpFromCfg.MyEnhancedDocuments != null && stpFromCfg.MyEnhancedDocuments.Count > 0 && stpFromCfg.MyEnhancedDocuments[0].Type != 0;
bool stpCanPaste = false;
if (!secToIsEnhanced && !secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1)
if (!secToIsEnhanced && !secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1)
else if (secToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 2)
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) stpCanPaste = true; // 3)
else if (secToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) stpCanPaste = true; // 3)
if (iiClipboard.IsRtfRaw) stpCanPaste = false; // never paste an equation.
if (stpCanPaste) cm.MenuItems.Add("Paste Step", new EventHandler(mi_Click));
}
@@ -1780,8 +1802,8 @@ namespace Volian.Controls.Library
bool stpFromIsEnhanced = iiClipboard.IsEnhancedStep;
bool stpFromIsSource = stpFromCfg.MyEnhancedDocuments != null && stpFromCfg.MyEnhancedDocuments.Count > 0 && stpFromCfg.MyEnhancedDocuments[0].Type != 0;
bool stpCanPaste = false;
if (!stpToIsEnhanced && !stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1)
else if (stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) // 2)
if (!stpToIsEnhanced && !stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) stpCanPaste = true; // 1)
else if (stpToIsSource && !stpFromIsEnhanced && !stpFromIsSource) // 2)
{
stpCanPaste = true;
okToReplace = false;
@@ -1789,7 +1811,7 @@ namespace Volian.Controls.Library
else if (stpToIsSource && iiPasteHere.MyDocVersion.VersionID == iiClipboard.MyDocVersion.VersionID) // 3
{
stpCanPaste = true;
if (stpFromIsSource) okToReplace = false; // B2017-183: don't allow a replace to source steps
if (stpFromIsSource) okToReplace = false; // B2017-183: don't allow a replace to source steps
}
if (iiClipboard.IsRtfRaw) stpCanPaste = false; // never paste an equation.
if (stpCanPaste && AddToInsertMenu(iiPasteHere, 0)) cm.MenuItems.Add("Paste Step Before", new EventHandler(mi_Click));
@@ -1819,7 +1841,7 @@ namespace Volian.Controls.Library
OnPrintSection(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Print All Procedures for":
OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0,mi.Text,(int)mi.Tag));
OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Approve":
OnApproveProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
@@ -1831,10 +1853,10 @@ namespace Volian.Controls.Library
OnApproveSomeProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Create Continuous Action Summary":
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag));
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
case "Create Time Critical Action Summary":
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0,mi.Text,(int)mi.Tag));
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag));
break;
default:
if (mip.Text.StartsWith("Showing Change Bars Starting"))
@@ -1872,7 +1894,7 @@ namespace Volian.Controls.Library
{
if (selprc.IsEnhancedProcedure)
{
selprc.DoUnlinkEnhanced(selprc, 0, !hasValidConnectingProc); // if no valid linked: enhtype = 0 since this an enhanced doc is getting unlinked
selprc.DoUnlinkEnhanced(selprc, 0, !hasValidConnectingProc); // if no valid linked: enhtype = 0 since this an enhanced doc is getting unlinked
}
else // from source
{
@@ -1900,7 +1922,7 @@ namespace Volian.Controls.Library
{
ItemInfo lprc = ItemInfo.Get(ed.ItemID);
bool hasValidConnectingProc = CheckForValidEnhLink(lprc);
// if there is a valid connection, unlink both. Otherwise, just unlink this selected procedure.
// if there is a valid connection, unlink both. Otherwise, just unlink this selected procedure.
if (hasValidConnectingProc)
lprc.DoUnlinkEnhanced(lprc, ed.Type, !hasValidConnectingProc);
else
@@ -1924,27 +1946,27 @@ namespace Volian.Controls.Library
OnNodeSI(this, new vlnTreeEventArgs(tn, null, 0));
return;
}
if (mi.Text.StartsWith("Collapse"))
{
if (mi.Text.StartsWith("Collapse"))
{
CollapseProcedures();
return;
}
return;
}
if (mi.Text == "Print Transition Report")
{
OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode));
return;
}
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
{
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
return;
}
if (mi.Text == "Import Procedure Set" || mi.Text == "Import Procedure")
{
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 1));
return;
}
if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to"))
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
{
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
return;
}
if (mi.Text == "Import Procedure Set" || mi.Text == "Import Procedure")
{
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 1));
return;
}
if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to"))
{
OnProcedureCheckedOutTo(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
return;
@@ -2010,9 +2032,8 @@ namespace Volian.Controls.Library
tv_NodeCopy();
break;
// lots of paste options:
case "Paste Procedure":
case "Paste Procedure":
case "Paste Procedure Before":
case "Replace Existing Procedure":
case "Paste Procedure After":
case "Paste Section":
case "Paste Section Before":
@@ -2025,6 +2046,18 @@ namespace Volian.Controls.Library
case "Paste Subsection":
tv_NodePaste(mi.Text);
break;
case "Replace Existing Procedure":
DialogResult ovewriteEx = FlexibleMessageBox.Show("This will overwrite the selected procedure with then one you copied, would you like to overwrite it?\r\n\r\nSelecting 'Cancel' will cancel the paste action.", "Overwrite the procedure?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);// == DialogResult.Yes;
if (ovewriteEx == DialogResult.Cancel) break;
else
{
TreeNode treenodeDirectory = SelectedNode.Parent;
tv_NodePaste(mi.Text);
break;
}
case "Delete":
if (tv_NodeDelete())
{
@@ -2090,21 +2123,22 @@ namespace Volian.Controls.Library
UpdateROValues(SelectedNode as VETreeNode);
break;
case "Create Continuous Action Summary":
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0));
OnCreateContinuousActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
break;
// F2022-024 Time Critical Action Summary
// F2022-024 Time Critical Action Summary
case "Create Time Critical Action Summary":
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null,0));
OnCreateTimeCriticalActionSummary(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
break;
// B2017-243 added the following two Cannot Paste items when dealing with enhanced documents
// when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted
// B2017-243 added the following two Cannot Paste items when dealing with enhanced documents
// when then user selects these menu items a message box will appear giving more information as to why it cannot be pasted
case "CANNOT PASTE HERE. Click for more information...":
FlexibleMessageBox.Show("You have copied a document that is linked to an Enhanced Document.\n\n" +
"It can only be pasted before or after another document, within the set, that is linked to an Enhanced Document.", "Cannot Paste Here");
break;
case "CANNOT PASTE HERE, Click for more information...":
// B2024-028 clarify message
FlexibleMessageBox.Show("You have copied a document that is NOT linked to an Enhanced Document.\n\n" +
"It CANNOT be pasted before or after an Enhanced Document.", "Cannot Paste Here");
"You cannot paste a Non-Enhanced Procedure into an Enhanced Procedure Set.", "Cannot Paste Here");
break;
//case "Check Out Procedure Set":
// CheckOutDocVersion(SelectedNode as VETreeNode);
@@ -2138,7 +2172,7 @@ namespace Volian.Controls.Library
foreach (VETreeNode tnc in tn.Nodes)
CollapseProcedures(tnc);
if (tn.VEObject as DocVersionInfo == null && tn.VEObject as FolderInfo == null)
tn.Collapse();
tn.Collapse();
_doingCollapseNode = true; // B2016-058 this will prevent a Drag Node error when collapsing an RNOs, Cautions, or Notes tree node
}
private void tv_RemoveChgIds()
@@ -2193,12 +2227,12 @@ namespace Volian.Controls.Library
FinalProgressBarMessage = "Cannot check-out Working Draft";
return;
}
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
Cursor = Cursors.WaitCursor; // C2023-002: move wait cursor after check out error
int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion);
using (DocVersion dv = DocVersion.Get(MyDVI.VersionID))
{
swROUpdate = new System.IO.StreamWriter(ROFstInfo.ROUpdateResultsPath(MyDVI)); // RO changes placed in file in the Documents\VEPROMS folder
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
// B2022-026 RO Memory Reduction code - first load the new ro.fst so that we can assign the ROTableUpdate event to the correct roFstInfo
if (dv.ROfstLoadingFigures || dv.NewerRoFst) // B2017-125 see if loading figures was completed
{
// only load the RO.fst
@@ -2226,7 +2260,7 @@ namespace Volian.Controls.Library
swROUpdate.Write(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID));
}
private ProgressBarItem _ProgressBar=null;
private ProgressBarItem _ProgressBar = null;
public ProgressBarItem ProgressBar
{
get { return _ProgressBar; }
@@ -2390,6 +2424,7 @@ namespace Volian.Controls.Library
}
}
VETreeNode tn = SelectedNode as VETreeNode;
TreeNode treeNodeReplace = SelectedNode.Parent; //Get Tree Node of Parent we are proc we are placing into.
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
// Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section)
if (dvi != null)
@@ -2403,7 +2438,7 @@ namespace Volian.Controls.Library
// assume that item to paste is a procedure, otherwise the menuing would not have
// included the paste options
tn = (VETreeNode) tn.Nodes[tn.Nodes.Count - 1];
tn = (VETreeNode)tn.Nodes[tn.Nodes.Count - 1];
p = "After";
}
else // this is an empty docversion:
@@ -2425,13 +2460,17 @@ namespace Volian.Controls.Library
else if (p.IndexOf("After") > -1)
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
else if (p.IndexOf("Replace") > -1)
PasteReplace(tn, iiClipboard.ItemID);
{
PasteReplace(tn, iiClipboard.ItemID, treeNodeReplace);
}
else // paste as child
PasteAsChild(tn, iiClipboard.ItemID);
//if (p.IndexOf("Replace") <= -1)
this.Cursor = Cursors.Default;
}
private void PasteAsDocVersionChild(VETreeNode tn, int copyStartID)
public void PasteAsDocVersionChild(VETreeNode tn, int copyStartID)
{
// Only need to handle paste in tree since this will create a new procedure.
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
@@ -2445,7 +2484,7 @@ namespace Volian.Controls.Library
}
ItemInfo newProc = dvi.PasteChild(copyStartID);
VETreeNode tn1 = new VETreeNode(newProc);
SelectedNode.Nodes.Add(tn1); // add tree node to end of list.
SelectedNode.Nodes.Add(tn1); // add tree node to end of list.
SelectedNode = tn1;
}
@@ -2482,7 +2521,7 @@ namespace Volian.Controls.Library
}
if (pasteSectIntoEmptySect)
{
tn.ChildrenLoaded = false; // force a reload of treenode
tn.ChildrenLoaded = false; // force a reload of treenode
tn.LoadChildren(true);
}
SelectedNode = tn;
@@ -2518,10 +2557,10 @@ namespace Volian.Controls.Library
}
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
}
private void PasteReplace(VETreeNode tn, int copyStartID)
private void PasteReplace(VETreeNode tn, int copyStartID, TreeNode treeNodeReplace)
{
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
VETreeNode partn = (VETreeNode) tn.Parent;
VETreeNode prevtn = (VETreeNode)tn.PrevNode;
VETreeNode partn = (VETreeNode)tn.Parent;
ItemInfo ii = tn.VEObject as ItemInfo;
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true);
@@ -2529,29 +2568,49 @@ namespace Volian.Controls.Library
{
// first, check if a changeid is required.
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID, chgId);
ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID, chgId, treeNodeReplace);
StepConfig replItemConfig = ii.MyConfig as StepConfig;
if (replItemInfo != null)
{
OnOpenItem(this, new vlnTreeItemInfoEventArgs(replItemInfo));
ItemInfo newEnhStep = replItemInfo.PasteEnhancedItems(copyStartID, ii, ItemInfo.EAddpingPart.Replace, chgId);
}
}
// B2018-047: was crashing on the following line (before change it was casting the result to a VETreeNote when the partn.FirstNode was just a TreeNode)
SelectedNode = prevtn != null ? prevtn.NextNode : partn.FirstNode;
}
public void PasteRepalceEmpty(VETreeNode tn, int copyStartID)
{
// Only need to handle paste in tree since this will create a new procedure.
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
if (dvi.DocVersionAssociationCount == 0)
{
// Set docversionassociation to the copied docversion association
// so that the rofst for ro's can be found. (if there is no association set)
ROFstInfo rfi = GetAssociationRofstId(copyStartID);
Association myAs = Association.MakeAssociation(dvi.Get(), rfi.GetJustROFst(), "");
dvi.RefreshDocVersionAssociations();
}
ItemInfo newProc = dvi.PasteChild(copyStartID);
VETreeNode tn1 = new VETreeNode(newProc);
SelectedNode.Nodes.Add(tn1); // add tree node to end of list.
SelectedNode = tn1;
}
private void tv_NodeCopy()
{
if (SelectedNode==null)return;
if (SelectedNode == null) return;
VETreeNode tn = SelectedNode as VETreeNode;
OnNodeCopy(this, new vlnTreeEventArgs(tn));
OnNodeCopy(this, new vlnTreeEventArgs(tn));
}
#endregion
#region PropertyPagesInterface
private void SetupNodeProperties()
{
VETreeNode tn = SelectedNode as VETreeNode;
if (tn==null)return;
if (tn == null) return;
if ((tn.VEObject as FolderInfo) != null)
OpenProperties(tn.VEObject as FolderInfo);
@@ -2563,7 +2622,7 @@ namespace Volian.Controls.Library
if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0) rofstid = dvi.DocVersionAssociations[0].MyROFst.ROFstID;
OpenProperties(tn.VEObject as DocVersionInfo);
if (dvi != null && dvi.DocVersionAssociations != null && dvi.DocVersionAssociations.Count > 0 && rofstid != dvi.DocVersionAssociations[0].MyROFst.ROFstID)
OnTabDisplay(this,new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
OnTabDisplay(this, new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"));
}
else if ((tn.VEObject as ProcedureInfo) != null)
OpenProperties(tn.VEObject as ProcedureInfo);
@@ -2577,7 +2636,7 @@ namespace Volian.Controls.Library
{
using (Folder folder = folderInfo.Get())
{
OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig));
OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig));
}
}
private void OpenProperties(DocVersionInfo dvInfo)
@@ -2591,7 +2650,7 @@ namespace Volian.Controls.Library
{
using (Procedure proc = procInfo.Get())
{
OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig));
OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig));
}
}
private void OpenProperties(SectionInfo sectInfo)
@@ -2604,7 +2663,7 @@ namespace Volian.Controls.Library
title = string.Format("{0} {1} Properties", sectInfo.SectionConfig.Number, sectInfo.SectionConfig.Title);
else
title = string.Format("{0} Properties", sectInfo.SectionConfig.Title);
OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig));
OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig));
}
}
private void OpenProperties(StepInfo stpinfo)
@@ -2658,7 +2717,7 @@ namespace Volian.Controls.Library
{
if (newtype == MenuSelections.DocVersion)
{
int dvid = -1; // flag to allow user to cancel from dialog & then we remove it.
int dvid = -1; // flag to allow user to cancel from dialog & then we remove it.
using (DocVersion docversion = DocVersion.MakeDocVersion(parentfolder, "Working Draft", "Title", null, null, null))
{
ShowBrokenRules(docversion.BrokenRulesCollection);
@@ -2667,7 +2726,7 @@ namespace Volian.Controls.Library
{
docversion.Save();
tn = new VETreeNode(_LastDocVersionInfo);
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
parentfolder.Reset_ChildFolders();
parentfolder.Reset_FolderDocVersions();
}
@@ -2678,7 +2737,7 @@ namespace Volian.Controls.Library
}
else if (newtype == MenuSelections.Folder)
{
int f1 = -1; // flag to allow user to cancel from dialog & then we remove it.
int f1 = -1; // flag to allow user to cancel from dialog & then we remove it.
string uniquename = _LastFolderInfo.UniqueChildName("New Folder");
using (Folder folder = Folder.MakeFolder(parentfolder, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, string.Empty, DateTime.Now, VlnSettings.UserID))
{
@@ -2690,14 +2749,14 @@ namespace Volian.Controls.Library
{
folder.Save();
tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo);
SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist.
SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist.
}
else
f1 = folder.FolderID;
}
if (f1 != -1) Folder.Delete(f1);
}
else if (newtype == MenuSelections.FolderAfter||newtype == MenuSelections.FolderBefore)
else if (newtype == MenuSelections.FolderAfter || newtype == MenuSelections.FolderBefore)
{
int f2 = -1;
string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder");
@@ -2727,7 +2786,7 @@ namespace Volian.Controls.Library
else if (newtype == MenuSelections.Procedure)
{
int p1 = -1;
using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count!=0?_LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count-1]:null, null, "New Procedure", 0))
using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count != 0 ? _LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count - 1] : null, null, "New Procedure", 0))
{
ShowBrokenRules(procedure.BrokenRulesCollection);
SetLastValues(ProcedureInfo.Get(procedure.ItemID));
@@ -2736,8 +2795,8 @@ namespace Volian.Controls.Library
{
procedure.Save();
tn = new VETreeNode(_LastProcedureInfo);
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
// The following line will allow for a refresh of the procedure list on the Working Draft's treenodes docversion (B2016-034)
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
// The following line will allow for a refresh of the procedure list on the Working Draft's treenodes docversion (B2016-034)
if (((SelectedNode as VETreeNode).VEObject as DocVersionInfo) != null) ((SelectedNode as VETreeNode).VEObject as DocVersionInfo).ResetProcedures();
if (procedure.MyProcedureInfo.CreateEnhanced)
{
@@ -2784,16 +2843,16 @@ namespace Volian.Controls.Library
}
#endregion
#region InsertSection
else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list
else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list
{
string message = string.Empty;
if (_LastProcedureInfo != null)
if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message))
{
FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
OnUnPauseRefresh(this, null);
return;
}
{
FlexibleMessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning);
OnUnPauseRefresh(this, null);
return;
}
int s1 = -1;
if (!(_LastProcedureInfo == null) || !(_LastSectionInfo == null))
{
@@ -2823,7 +2882,7 @@ namespace Volian.Controls.Library
"If you would like to view or copy these hidden steps you will need to go\n" +
"into the properties of this section and check the Editable Data checkbox.\n" +
"You will then be able to view and copy those steps. When finished, open\n" +
"the properties page again and uncheck the Editable Data checkbox.\n\n"+
"the properties page again and uncheck the Editable Data checkbox.\n\n" +
"Do you want to continue creating the subsection?";
if (FlexibleMessageBox.Show(this, msgstr, "Subsection Insert", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
@@ -2835,7 +2894,7 @@ namespace Volian.Controls.Library
if (!hasMetaSubs) doPseudo = true;
}
}
using(Section section = CreateNewSection())
using (Section section = CreateNewSection())
{
ShowBrokenRules(section.BrokenRulesCollection);
SectionInfo savLastSectionInfo = _LastSectionInfo;
@@ -2845,10 +2904,10 @@ namespace Volian.Controls.Library
if (!doPseudo)
{
tn = new VETreeNode(_LastSectionInfo);
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
// if the new section was flagged as either having an enhanced link for Title or Contents, create the
// Enhanced section:
Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem.
SelectedNode.Nodes.Add(tn); // add tree node to end of list.
// if the new section was flagged as either having an enhanced link for Title or Contents, create the
// Enhanced section:
Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem.
if (sectiontmp.SectionConfig.LinkEnhanced == "T" || sectiontmp.SectionConfig.LinkEnhanced == "Y")
CreateEnhancedForSection(newtype, sectiontmp, savLastSectionInfo, sectiontmp.DisplayNumber, sectiontmp.MyContent.Text);
sectiontmp.Dispose();
@@ -2859,7 +2918,7 @@ namespace Volian.Controls.Library
// may have to add a 'steps' node if a step(s) already exist...
ItemInfo ii = (SelectedNode as VETreeNode).VEObject as ItemInfo;
int cpindx = 0;
if (SelectedNode.Nodes.Count>0)
if (SelectedNode.Nodes.Count > 0)
{
VETreeNode vtn = SelectedNode.Nodes[0] as VETreeNode;
// B2017-014: removed code that was adding a 2nd section part node. and also select node to
@@ -2869,13 +2928,13 @@ namespace Volian.Controls.Library
// B2017-014: removed code that was adding a 2nd section part node.
}
}
else // Properties was canceled out of:
else // Properties was canceled out of:
s1 = section.ItemID;
}
if (s1 != -1)
{
DeleteItemInfoAndChildren(_LastSectionInfo);// Delete Item and reset Previous and Next
// B2020-087 refresh the tree node after canceling the creation of the subsection
// B2020-087 refresh the tree node after canceling the creation of the subsection
_LastTreeNode.ChildrenLoaded = false;
_LastTreeNode.RefreshNode();
_LastTreeNode.Collapse();
@@ -2903,14 +2962,14 @@ namespace Volian.Controls.Library
if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK)
{
int indx = tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1);
int itemido = (indx >= par.Nodes.Count)?-1:(((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID;
if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido !=section.ItemID)
int itemido = (indx >= par.Nodes.Count) ? -1 : (((par.Nodes[indx] as VETreeNode).VEObject) as ItemInfo).ItemID;
if (indx >= par.Nodes.Count || (par.Nodes[indx] as VETreeNode).VEObject.ToString() != _LastSectionInfo.ToString() || itemido != section.ItemID)
{
tn = new VETreeNode(_LastSectionInfo);
par.Nodes.Insert(indx, tn);
// if the new section was flagged as either having an enhanced link for Title or Contents, create the
// Enhanced section:
Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem.
Section sectiontmp = Section.Get(section.ItemID); // need to do this because of 'caching' problem.
if (sectiontmp.SectionConfig.LinkEnhanced == "T" || sectiontmp.SectionConfig.LinkEnhanced == "Y")
CreateEnhancedForSection(newtype, sectiontmp, savLastSectionInfo, sectiontmp.DisplayNumber, sectiontmp.MyContent.Text);
sectiontmp.Dispose();
@@ -2922,7 +2981,7 @@ namespace Volian.Controls.Library
if (s2 != -1)
{
DeleteItemInfoAndChildren(_LastSectionInfo);// Delete Item and reset Previous and Next
// B2020-087 refresh the tree node after canceling the creation of the subsection
// B2020-087 refresh the tree node after canceling the creation of the subsection
_LastTreeNode.ChildrenLoaded = false;
_LastTreeNode.RefreshNode();
_LastTreeNode.Collapse();
@@ -2930,7 +2989,7 @@ namespace Volian.Controls.Library
}
#endregion
#region InsertStep
else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree.
else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree.
{
string message = string.Empty;
if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message))
@@ -3007,7 +3066,7 @@ namespace Volian.Controls.Library
using (Procedure newenhProcedure = Procedure.MakeProcedure(enhDVInfo, enhDVInfo.Procedures.Count != 0 ? enhDVInfo.Procedures[enhDVInfo.Procedures.Count - 1] : null, null, "New Procedure", 0))
{
SaveEnhancedForProcedure(sourceProc, newenhProcedure, ded.Type);
RefreshRelatedNode(ProcedureInfo.Get(newenhProcedure.ItemID)); // this updates the treeview to include the new enhanced procedure
RefreshRelatedNode(ProcedureInfo.Get(newenhProcedure.ItemID)); // this updates the treeview to include the new enhanced procedure
}
}
}
@@ -3058,6 +3117,15 @@ namespace Volian.Controls.Library
{
SaveEnhancedForSection(sourceSect, newenhSection, sed.Type);
RefreshRelatedNode(SectionInfo.Get(newenhSection.ItemID));
// B2024-023: when inserting a source section, the associated
// enhanced section did not appear in tree view or in edit window (if it
// was displayed in editor). Add to tree view and close the enhanced
// procedure edit window. Note that closing of edit window was done to
// be consistent on what happens upon delete of source w/ and enhanced
// section.
SectionInfo tmpsi = SectionInfo.Get(newenhSection.ItemID);
RefreshRelatedNode(ProcedureInfo.Get(tmpsi.MyParent.ItemID));
OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(tmpsi, true));
}
}
return;
@@ -3096,7 +3164,7 @@ namespace Volian.Controls.Library
{
SectionConfig newenhcfg = new SectionConfig(newenhSection);
newenhcfg.AddEnhancedDocument(0, sourceSect.ItemID);
newenhcfg.SaveEnhancedDocuments(); // does this save data?
newenhcfg.SaveEnhancedDocuments(); // does this save data?
using (Content c1 = Content.Get(newenhSection.ContentID))
{
c1.Config = newenhcfg.ToString();
@@ -3177,12 +3245,12 @@ namespace Volian.Controls.Library
// see if enhanced related steps need created:
SectionConfig scfgE = _LastItemInfo.ActiveSection.MyConfig as SectionConfig; // C2018-003 fixed use of getting the active section
if (scfgE != null && scfgE.Section_LnkEnh=="Y")
if (scfgE != null && scfgE.Section_LnkEnh == "Y")
{
// set up which item to insert from based on whether editor was open (see comment from 11/17 above).
EnhancedDocuments enhdocs = null;
ItemInfo.EAddpingPart addpart = ItemInfo.EAddpingPart.Child;
if (_LastItemInfo.MyPrevious != null) // the code above will do the MakeStep regardless of whether editor is up if this is the only step.
if (_LastItemInfo.MyPrevious != null) // the code above will do the MakeStep regardless of whether editor is up if this is the only step.
{
addpart = ItemInfo.EAddpingPart.After;
ItemInfo lstSrc = _LastItemInfo.MyPrevious;
@@ -3354,7 +3422,7 @@ namespace Volian.Controls.Library
result = FlexibleMessageBox.Show("Are you sure you want to delete this " + typeDescription + "?", "Verify Delete",
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
}
if (_LastProcedureInfo != null || result == DialogResult.Yes)
if (_LastProcedureInfo != null || result == DialogResult.Yes)
{
if (_LastFolderInfo != null)
{
@@ -3460,7 +3528,7 @@ namespace Volian.Controls.Library
// just clear enhanced links back
_LastSectionInfo.ClearEnhancedSectionLink();
}
OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo,true));
OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo, true));
// always return false because an event gets fired to delete tree nodes.
if (!DeleteItemInfoAndChildren(_LastSectionInfo))
{
@@ -3515,6 +3583,41 @@ namespace Volian.Controls.Library
}
return false;
}
public void RemoveFolder(int folderId)
{
TreeNode nodeToRemove = FindNodeById(folderId, this.Nodes);
if (nodeToRemove != null)
{
// Perform the removal logic
nodeToRemove.Remove(); // This removes the node from its parent
}
}
private TreeNode FindNodeById(int folderId, TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
VETreeNode vetNode = node as VETreeNode;
if (vetNode != null)
{
FolderInfo folderInfo = vetNode.VEObject as FolderInfo;
if (folderInfo != null && folderInfo.FolderID == folderId)
{
return node;
}
else
{
TreeNode foundNode = FindNodeById(folderId, node.Nodes);
if (foundNode != null)
{
return foundNode;
}
}
}
}
return null;
}
private bool DeleteItemInfoAndChildren(ItemInfo ii)
{
DateTime dtStart = DateTime.Now;

View File

@@ -699,7 +699,7 @@ namespace Volian.Print.Library
try
{
if (File.Exists(outputFileName))
if (File.Exists(outputFileName) && !OverWrite && !outputFileName.Contains("PageNumberPass") && !outputFileName.Contains("Foldout"))
{
if (!BaselineTesting && !SaveLinks) // B2024-031 don't do if creating PDF hyperlinks
{
@@ -836,14 +836,6 @@ namespace Volian.Print.Library
OnStatusChanged("Print " + myProcedure.DisplayNumber, PromsPrinterStatusType.Start);
string outputFileName = pdfFolder + "\\" + Prefix + PDFFile; // RHM20150506 Multiline ItemID TextBox
if (!OverWrite && File.Exists(outputFileName))
{
if (MessageBox.Show(outputFileName + " exists. Overwrite file?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.No)
{
ProfileTimer.Pop(profileDepth);
return null;
}
}
string retval = PrintProcedureOrFoldout(myProcedure, null, outputFileName, makePlacekeeper, makeContinuousActionSummary, makeTimeCriticalAction);
ProfileTimer.Pop(profileDepth);
return retval;