Compare commits
98 Commits
35c7b2b0cf
...
F2024-074-
Author | SHA1 | Date | |
---|---|---|---|
b47f9b2606 | |||
2b5becfa34 | |||
ce02c3e4bd | |||
2ab1856b13 | |||
027a9dc729 | |||
b071db8f60 | |||
98d6557cd2 | |||
ebd7b1249f | |||
1b6eeaf4ad | |||
1d3dac0e51 | |||
48da58b681 | |||
68639eadf0 | |||
dc77984c10 | |||
5b4e1cd694 | |||
3fbd974fa9 | |||
b457496297 | |||
dd83491169 | |||
a73a8fb993 | |||
fb7a99653d | |||
297d75a2b3 | |||
47c5bb159a | |||
610b2d178c | |||
bb45e551a3 | |||
77cf6177dc | |||
a830856df2 | |||
efe215f4d0 | |||
5e2e2f841c | |||
9da436ab2d | |||
5333b96c88 | |||
6561a11661 | |||
1c9334a52b | |||
2e00693a33 | |||
8617ce4562 | |||
78416ef452 | |||
9ad50af4dd | |||
a6f3d62a01 | |||
a25b5fc6b8 | |||
9e26e94e97 | |||
a571cb5f15 | |||
2e00c94d34 | |||
f1506b9aee | |||
2805471301 | |||
89f55e091f | |||
da6c47d0ff | |||
63cac73de3 | |||
c8ed5b0565 | |||
c6342fea49 | |||
7a3748f7e0 | |||
516b479c0c | |||
a43e059733 | |||
0ac79f4e46 | |||
c06744b3bb | |||
218a2c17a2 | |||
a629f6834b | |||
bf5337cf63 | |||
7713f0cd63 | |||
![]() |
2711520666 | ||
![]() |
4a6c0ba447 | ||
3f3281e2f4 | |||
0eadd3fe33 | |||
4bf42be80a | |||
d7f829737a | |||
25cc62c7c6 | |||
47596c7bca | |||
7129853902 | |||
![]() |
f08466f702 | ||
4248d40917 | |||
![]() |
7cf28366f4 | ||
037c82e22e | |||
6de13b12f9 | |||
cf69aa93e6 | |||
![]() |
4b915b78b6 | ||
![]() |
a891a62ffa | ||
7a768484a1 | |||
![]() |
5f7af3309d | ||
![]() |
1f3a1dabbc | ||
![]() |
4b61495960 | ||
![]() |
d091a37171 | ||
![]() |
189b78d7d3 | ||
8ee7a31b97 | |||
![]() |
055be66421 | ||
86a3e56a27 | |||
![]() |
0db98e4182 | ||
3102596a3d | |||
![]() |
41aa195785 | ||
![]() |
954186265e | ||
![]() |
33cced07c6 | ||
![]() |
afbf6f360d | ||
![]() |
df2be585a1 | ||
![]() |
c81f527cb8 | ||
0f67382c27 | |||
b42b8ddfa3 | |||
f3efd409c6 | |||
9011b134d6 | |||
7c33bad362 | |||
![]() |
e49a4d674f | ||
7872f192ed | |||
![]() |
870bba0aa6 |
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.
@@ -23,8 +23,8 @@ using System.Runtime.CompilerServices;
|
|||||||
// Build YYMM (two digit year, two digit month)
|
// Build YYMM (two digit year, two digit month)
|
||||||
// Revision DHH (day - no leading zero, two digit hour - military time
|
// Revision DHH (day - no leading zero, two digit hour - military time
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("2.3.2404.1611")]
|
[assembly: AssemblyVersion("2.3.2410.815")]
|
||||||
[assembly: AssemblyFileVersion("2.3.2404.1611")]
|
[assembly: AssemblyFileVersion("2.3.2410.815")]
|
||||||
|
|
||||||
//
|
//
|
||||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||||
@@ -92,5 +92,6 @@ using System.Runtime.CompilerServices;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -100,6 +100,7 @@ using System.Text;
|
|||||||
using RODBInterface;
|
using RODBInterface;
|
||||||
using ROFields;
|
using ROFields;
|
||||||
using VlnStatus;
|
using VlnStatus;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace ROEditor
|
namespace ROEditor
|
||||||
{
|
{
|
||||||
@@ -245,6 +246,37 @@ namespace ROEditor
|
|||||||
return CvtFldToUserFld(origGroup);
|
return CvtFldToUserFld(origGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//CSM C2024-023
|
||||||
|
//Part of 2024 PROMS Upgrades
|
||||||
|
//When the Overall Form is activated
|
||||||
|
//if there are any items that are Fields that are in use
|
||||||
|
//add them as auto-complete options to the
|
||||||
|
//Accessory Page Access - Value Textbox
|
||||||
|
//Typing < will bring up the auto-complete options
|
||||||
|
protected void tbValue_AddAutoComplete(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
string dummy = ""; // need for RODB_GetFIeldsInUse call, won't be used.
|
||||||
|
ArrayList AvailList, InUseList;
|
||||||
|
//first see if it is a valid 'InUse' Field.
|
||||||
|
AvailList = myrodb.RODB_GetFields(elem, (uint)RecordType.Schema);
|
||||||
|
InUseList = myrodb.RODB_GetFieldsInUse(elem, AvailList, "FieldsInUse", ref dummy, false);
|
||||||
|
|
||||||
|
//if any ROField items are in use,
|
||||||
|
//use LINQ to get a string array of the FieldNames
|
||||||
|
if (InUseList.Count > 0)
|
||||||
|
{
|
||||||
|
string[] InUseListFieldNames = InUseList.OfType<ROField>().Select(x => $"<{x.GetFieldname}>").ToArray();
|
||||||
|
AutoCompleteStringCollection allowedTypes = new AutoCompleteStringCollection();
|
||||||
|
allowedTypes.AddRange(InUseListFieldNames);
|
||||||
|
tbValue.AutoCompleteCustomSource = allowedTypes;
|
||||||
|
tbValue.AutoCompleteMode = AutoCompleteMode.Suggest;
|
||||||
|
tbValue.AutoCompleteSource = AutoCompleteSource.CustomSource;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void FillInData()
|
private void FillInData()
|
||||||
{
|
{
|
||||||
this.tbGroup.Text = DetermineGroupName();
|
this.tbGroup.Text = DetermineGroupName();
|
||||||
@@ -432,6 +464,7 @@ namespace ROEditor
|
|||||||
this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
|
this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
|
||||||
this.Name = "GroupDefFrm";
|
this.Name = "GroupDefFrm";
|
||||||
this.Text = "Group Definition";
|
this.Text = "Group Definition";
|
||||||
|
this.Activated += new EventHandler(tbValue_AddAutoComplete);
|
||||||
this.groupBox1.ResumeLayout(false);
|
this.groupBox1.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
@@ -97,12 +97,12 @@ namespace VEPROMS
|
|||||||
this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter();
|
this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter();
|
||||||
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
|
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
|
||||||
this.groupPag = new DevComponents.DotNetBar.Controls.GroupPanel();
|
this.groupPag = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||||
|
this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox();
|
||||||
this.expPrnSetting = new DevComponents.DotNetBar.ExpandablePanel();
|
this.expPrnSetting = new DevComponents.DotNetBar.ExpandablePanel();
|
||||||
this.ppGpDuplex = new DevComponents.DotNetBar.Controls.GroupPanel();
|
this.ppGpDuplex = new DevComponents.DotNetBar.Controls.GroupPanel();
|
||||||
this.tbBlankPage = new DevComponents.DotNetBar.Controls.TextBoxX();
|
this.tbBlankPage = new DevComponents.DotNetBar.Controls.TextBoxX();
|
||||||
this.lblBlPg = new DevComponents.DotNetBar.LabelX();
|
this.lblBlPg = new DevComponents.DotNetBar.LabelX();
|
||||||
this.swtbtnPDFdtPrefixSuffix = new DevComponents.DotNetBar.Controls.SwitchButton();
|
this.swtbtnPDFdtPrefixSuffix = new DevComponents.DotNetBar.Controls.SwitchButton();
|
||||||
this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox();
|
|
||||||
this.gpnlDebug.SuspendLayout();
|
this.gpnlDebug.SuspendLayout();
|
||||||
this.grpDateSelector.SuspendLayout();
|
this.grpDateSelector.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit();
|
||||||
@@ -1285,6 +1285,23 @@ namespace VEPROMS
|
|||||||
this.groupPag.TabIndex = 111;
|
this.groupPag.TabIndex = 111;
|
||||||
this.groupPag.Text = "Print using standard PROMS pagination rules by:";
|
this.groupPag.Text = "Print using standard PROMS pagination rules by:";
|
||||||
//
|
//
|
||||||
|
// cbxGenerateTimeCritActSum
|
||||||
|
//
|
||||||
|
this.cbxGenerateTimeCritActSum.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||||
|
| System.Windows.Forms.AnchorStyles.Right)));
|
||||||
|
this.cbxGenerateTimeCritActSum.AutoSize = true;
|
||||||
|
this.cbxGenerateTimeCritActSum.BackColor = System.Drawing.Color.Transparent;
|
||||||
|
this.cbxGenerateTimeCritActSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||||
|
this.cbxGenerateTimeCritActSum.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||||
|
this.cbxGenerateTimeCritActSum.Location = new System.Drawing.Point(240, 273);
|
||||||
|
this.cbxGenerateTimeCritActSum.Margin = new System.Windows.Forms.Padding(2);
|
||||||
|
this.cbxGenerateTimeCritActSum.Name = "cbxGenerateTimeCritActSum";
|
||||||
|
this.cbxGenerateTimeCritActSum.Size = new System.Drawing.Size(294, 17);
|
||||||
|
this.cbxGenerateTimeCritActSum.TabIndex = 102;
|
||||||
|
this.cbxGenerateTimeCritActSum.Text = "Generate Time Critical Action Summary (hidden but used)";
|
||||||
|
this.cbxGenerateTimeCritActSum.UseVisualStyleBackColor = false;
|
||||||
|
this.cbxGenerateTimeCritActSum.Visible = false;
|
||||||
|
//
|
||||||
// expPrnSetting
|
// expPrnSetting
|
||||||
//
|
//
|
||||||
this.expPrnSetting.CanvasColor = System.Drawing.SystemColors.Control;
|
this.expPrnSetting.CanvasColor = System.Drawing.SystemColors.Control;
|
||||||
@@ -1421,23 +1438,6 @@ namespace VEPROMS
|
|||||||
this.swtbtnPDFdtPrefixSuffix.TabIndex = 111;
|
this.swtbtnPDFdtPrefixSuffix.TabIndex = 111;
|
||||||
this.swtbtnPDFdtPrefixSuffix.ValueChanged += new System.EventHandler(this.swtbtnPDFdtPrefixSuffix_ValueChanged);
|
this.swtbtnPDFdtPrefixSuffix.ValueChanged += new System.EventHandler(this.swtbtnPDFdtPrefixSuffix_ValueChanged);
|
||||||
//
|
//
|
||||||
// cbxGenerateTimeCritActSum
|
|
||||||
//
|
|
||||||
this.cbxGenerateTimeCritActSum.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
|
||||||
this.cbxGenerateTimeCritActSum.AutoSize = true;
|
|
||||||
this.cbxGenerateTimeCritActSum.BackColor = System.Drawing.Color.Transparent;
|
|
||||||
this.cbxGenerateTimeCritActSum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
|
||||||
this.cbxGenerateTimeCritActSum.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
||||||
this.cbxGenerateTimeCritActSum.Location = new System.Drawing.Point(240, 273);
|
|
||||||
this.cbxGenerateTimeCritActSum.Margin = new System.Windows.Forms.Padding(2);
|
|
||||||
this.cbxGenerateTimeCritActSum.Name = "cbxGenerateTimeCritActSum";
|
|
||||||
this.cbxGenerateTimeCritActSum.Size = new System.Drawing.Size(294, 17);
|
|
||||||
this.cbxGenerateTimeCritActSum.TabIndex = 102;
|
|
||||||
this.cbxGenerateTimeCritActSum.Text = "Generate Time Critical Action Summary (hidden but used)";
|
|
||||||
this.cbxGenerateTimeCritActSum.UseVisualStyleBackColor = false;
|
|
||||||
this.cbxGenerateTimeCritActSum.Visible = false;
|
|
||||||
//
|
|
||||||
// DlgPrintProcedure
|
// DlgPrintProcedure
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@@ -231,7 +231,6 @@ namespace VEPROMS
|
|||||||
cbxOpenAfterCreate2.Visible = oneProcedure;
|
cbxOpenAfterCreate2.Visible = oneProcedure;
|
||||||
cbxOpenAfterCreate2.Checked = false;
|
cbxOpenAfterCreate2.Checked = false;
|
||||||
cbxOverwritePDF2.Visible = oneProcedure;
|
cbxOverwritePDF2.Visible = oneProcedure;
|
||||||
cbxOverwritePDF2.Checked = true;
|
|
||||||
gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode;
|
gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode;
|
||||||
swtbtnGeneratePlacekeeper.Value = false;
|
swtbtnGeneratePlacekeeper.Value = false;
|
||||||
cbxGenerateConActSum.Checked = false;
|
cbxGenerateConActSum.Checked = false;
|
||||||
@@ -1096,6 +1095,15 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
private void btnCreatePDF_Click(object sender, EventArgs e)
|
private void btnCreatePDF_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
|
if (txbRevDate.Visible)
|
||||||
|
{
|
||||||
|
if (!validateDate(txbRevDate))
|
||||||
|
{
|
||||||
|
//txbRevDate.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
DoCreatePDF();
|
DoCreatePDF();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1193,16 +1201,47 @@ namespace VEPROMS
|
|||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef;
|
ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef;
|
||||||
}
|
}
|
||||||
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
|
private bool validateDate(TextBox txtDate)
|
||||||
|
{
|
||||||
|
DateTime dDate;
|
||||||
|
if (!(txtDate.Text == ""))
|
||||||
|
{
|
||||||
|
|
||||||
|
if (DateTime.TryParse(txtDate.Text, out dDate))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string txtDate2 = txtDate.Text;
|
||||||
|
string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate2);
|
||||||
|
string txtTitle = "Invalid Format";
|
||||||
|
MessageBox.Show(message, txtTitle);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void txbRevDate_Enter(object sender, EventArgs e)
|
private void txbRevDate_Enter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
txbDate = txbRevDate;
|
txbDate = txbRevDate;
|
||||||
grpDateSelector.Text = "Select Revision Date";
|
grpDateSelector.Text = "Select Revision Date";
|
||||||
grpDateSelector.Visible = calDateSelector.Visible = true;
|
grpDateSelector.Visible = calDateSelector.Visible = true;
|
||||||
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
|
//C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date
|
||||||
DateTime initSelDate =(txbDate.Text != null && txbDate.Text.Length != 0)? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
|
DateTime dDate;
|
||||||
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
|
// B2024-058 Add validation for Revision Date field of the Print dialog
|
||||||
|
if (!validateDate(txbDate))
|
||||||
|
{
|
||||||
|
txbRevDate.Focus();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today;
|
||||||
|
calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void txbRevDate_Leave(object sender, EventArgs e)
|
private void txbRevDate_Leave(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_Initializing) return;
|
if (_Initializing) return;
|
||||||
@@ -1375,6 +1414,7 @@ namespace VEPROMS
|
|||||||
_NewRevForAllProcs = null;
|
_NewRevForAllProcs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
//private void cbxDebug_CheckedChanged(object sender, EventArgs e)
|
||||||
//{
|
//{
|
||||||
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
// cbxCmpPRMSpfd.Visible = cbxDebug.Checked;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -425,9 +425,9 @@ namespace VEPROMS
|
|||||||
MessageBox.Show(msg, "Import Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); // C2020-042 changed mesage box title
|
MessageBox.Show(msg, "Import Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); // C2020-042 changed mesage box title
|
||||||
//MessageBox.Show(string.Format("Finished Importing:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
//MessageBox.Show(string.Format("Finished Importing:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
if (canceledPressed)
|
if (canceledPressed || !isImported)
|
||||||
{
|
{
|
||||||
MessageBox.Show(string.Format("Canceling the import of:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show(string.Format("Cancelling the import of:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Cancelling Import", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
btnCloseImport.PerformClick();
|
btnCloseImport.PerformClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -906,8 +906,8 @@ namespace VEPROMS
|
|||||||
// C2020-032: Import Procedure set when existing name exists, allow user to import with 'Copy (#) of'.
|
// C2020-032: Import Procedure set when existing name exists, allow user to import with 'Copy (#) of'.
|
||||||
// This is similar functionality to the import of a procedure without the overwrite part.
|
// This is similar functionality to the import of a procedure without the overwrite part.
|
||||||
string msg = string.Format("The procedure set you are importing, {0}, already exists.\n\nDo you want to import {0} as a COPY of the existing set?\n\nThis will prefix the name with \"Copy (#) of\"", name);
|
string msg = string.Format("The procedure set you are importing, {0}, already exists.\n\nDo you want to import {0} as a COPY of the existing set?\n\nThis will prefix the name with \"Copy (#) of\"", name);
|
||||||
DialogResult dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure Set", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop);
|
DialogResult dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure Set", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop);
|
||||||
if (dr == DialogResult.Yes)
|
if (dr == DialogResult.OK)
|
||||||
{
|
{
|
||||||
string number = "";
|
string number = "";
|
||||||
int max = -1;
|
int max = -1;
|
||||||
@@ -931,6 +931,11 @@ namespace VEPROMS
|
|||||||
|
|
||||||
ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
ff = AddFolder(Folder.Get(MyFolder.FolderID), xd, name);
|
||||||
}
|
}
|
||||||
|
//else if (dr == System.Windows.Forms.DialogResult.Cancel)
|
||||||
|
//{
|
||||||
|
// //canceledPressed = true;
|
||||||
|
// //resolvedProcNum = false;
|
||||||
|
//}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,7 @@ namespace VEPROMS
|
|||||||
lbAnnotationTypes.DisplayMember = "Value";
|
lbAnnotationTypes.DisplayMember = "Value";
|
||||||
lbAnnotationTypes.ValueMember = "Key";
|
lbAnnotationTypes.ValueMember = "Key";
|
||||||
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
|
lbAnnotationTypes.SelectedIndexChanged += lbAnnotationTypes_SelectedIndexChanged;
|
||||||
|
lbAnnotationTypes.ClearSelected();
|
||||||
|
|
||||||
}
|
}
|
||||||
// create comma delimited string of procedures selected by user.
|
// create comma delimited string of procedures selected by user.
|
||||||
@@ -104,71 +105,77 @@ namespace VEPROMS
|
|||||||
// Process used to cleanup annotations "(Proceed?" button)
|
// Process used to cleanup annotations "(Proceed?" button)
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (lbAnnotationTypes.SelectedIndex > -1)
|
||||||
TextBox frm2 = mainForm.GettxtProcess();
|
|
||||||
TextBox frm3 = mainForm.GettxtResults();
|
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
|
||||||
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
|
||||||
frm3.AppendText("Deleting Annotations: Annotation Type: " + '"' + AnnotationName + '"');
|
|
||||||
frm3.AppendText(Environment.NewLine + "P = Procedure, F = Folder" + Environment.NewLine);
|
|
||||||
int deletecountProc = 0;
|
|
||||||
int deletecountDocv = 0;
|
|
||||||
foreach (var p in pil2)
|
|
||||||
{
|
{
|
||||||
if (p.IsProcedure)
|
|
||||||
{
|
|
||||||
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
|
||||||
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
|
||||||
//deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(p));
|
|
||||||
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
|
||||||
frm2.AppendText(Environment.NewLine + p.DisplayNumber + ' ' + p.DisplayText);
|
|
||||||
//frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Type: " + '"' + AnnotationName + '"' + " count: " + deletecountProc);
|
|
||||||
frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Delete count: " + deletecountProc);
|
|
||||||
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
|
||||||
lblCountNumber.Text = "0";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
TextBox frm2 = mainForm.GettxtProcess();
|
||||||
foreach (var d in dvil2)
|
TextBox frm3 = mainForm.GettxtResults();
|
||||||
{
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
if (d.IsDocVersion)
|
AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
|
frm3.AppendText("Deleting Annotations: Annotation Type: " + '"' + AnnotationName + '"');
|
||||||
|
frm3.AppendText(Environment.NewLine + "P = Procedure, F = Folder" + Environment.NewLine);
|
||||||
|
int deletecountProc = 0;
|
||||||
|
int deletecountDocv = 0;
|
||||||
|
foreach (var p in pil2)
|
||||||
{
|
{
|
||||||
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
if (p.IsProcedure)
|
||||||
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
{
|
||||||
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
frm3.AppendText(Environment.NewLine + "F: " + '"' + d.ActiveParent.ToString() + '"' + " Delete count: " + deletecountDocv);
|
//deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(p));
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, p.ItemID.ToString());
|
||||||
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
frm2.AppendText(Environment.NewLine + p.DisplayNumber + ' ' + p.DisplayText);
|
||||||
|
//frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Type: " + '"' + AnnotationName + '"' + " count: " + deletecountProc);
|
||||||
|
frm3.AppendText(Environment.NewLine + "P: " + p.DisplayNumber + '"' + p.DisplayText + '"' + " Delete count: " + deletecountProc);
|
||||||
|
Annotation.DeleteAnnotationProcByType(AnnotationTyp, p.ItemID.ToString());
|
||||||
|
lblCountNumber.Text = "0";
|
||||||
|
}
|
||||||
|
|
||||||
lblCountNumber.Text = "0";
|
|
||||||
}
|
}
|
||||||
|
foreach (var d in dvil2)
|
||||||
|
{
|
||||||
|
if (d.IsDocVersion)
|
||||||
|
{
|
||||||
|
//AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
|
//AnnotationName = System.Convert.ToString(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Value);
|
||||||
|
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, d.VersionID.ToString());
|
||||||
|
frm2.AppendText(Environment.NewLine + d.ActiveParent.ToString());
|
||||||
|
frm3.AppendText(Environment.NewLine + "F: " + '"' + d.ActiveParent.ToString() + '"' + " Delete count: " + deletecountDocv);
|
||||||
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
|
Annotation.DeleteAnnotationDocvByType(AnnotationTyp, d.VersionID.ToString());
|
||||||
|
|
||||||
|
lblCountNumber.Text = "0";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
|
||||||
}
|
}
|
||||||
frm3.AppendText(Environment.NewLine + Environment.NewLine + "Total Annotations Deleted: " + totalDeleteCnt + Environment.NewLine + Environment.NewLine);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve number of annotations that will be deleted.
|
// Retrieve number of annotations that will be deleted.
|
||||||
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
|
private void lbAnnotationTypes_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
btnClean.Enabled = false;
|
if (lbAnnotationTypes.SelectedIndex > -1)
|
||||||
lblCountNumber.Text = "";
|
|
||||||
int deletecountProc = 0;
|
|
||||||
int deletecountDocv = 0;
|
|
||||||
if (pil2.Count > 0)
|
|
||||||
{
|
{
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
btnClean.Enabled = false;
|
||||||
deletecountProc = Annotation.getAnnotationProcCnt(AnnotationTyp, getAnnotationProcItems(pil2));
|
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)
|
if (dvil2.Count > 0)
|
||||||
{
|
{
|
||||||
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
AnnotationTyp = System.Convert.ToInt32(((KeyValuePair<string, string>)lbAnnotationTypes.SelectedItem).Key);
|
||||||
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2));
|
deletecountDocv = Annotation.getAnnotationCountDocv(AnnotationTyp, getAnnotationDocvItems(dvil2));
|
||||||
|
}
|
||||||
|
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
|
||||||
|
totalDeleteCnt = (deletecountProc + deletecountDocv).ToString();
|
||||||
|
btnClean.Enabled = true;
|
||||||
}
|
}
|
||||||
lblCountNumber.Text = (deletecountProc + deletecountDocv).ToString();
|
|
||||||
totalDeleteCnt = (deletecountProc + deletecountDocv).ToString();
|
|
||||||
btnClean.Enabled = true;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// Close form.
|
// Close form.
|
||||||
|
445
PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs
generated
445
PROMS/VEPROMS User Interface/frmBatchRefresh.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,8 @@ using System.IO;
|
|||||||
using Volian.Controls.Library;
|
using Volian.Controls.Library;
|
||||||
using DevComponents.DotNetBar;
|
using DevComponents.DotNetBar;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
|
using Volian.Controls.Library;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace VEPROMS
|
namespace VEPROMS
|
||||||
{
|
{
|
||||||
@@ -24,11 +26,17 @@ namespace VEPROMS
|
|||||||
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
private bool IsAdministratorUser = false; //C2020-035 used to control what Set Amins can do
|
||||||
// C2017-030 - new Admin Tools user interface
|
// C2017-030 - new Admin Tools user interface
|
||||||
// pass in session info to constructor
|
// pass in session info to constructor
|
||||||
public frmBatchRefresh(SessionInfo sessionInfo)
|
|
||||||
|
private frmVEPROMS _veProms;
|
||||||
|
|
||||||
|
public frmBatchRefresh(SessionInfo sessionInfo, frmVEPROMS veProms)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_MySessionInfo = sessionInfo;
|
_MySessionInfo = sessionInfo;
|
||||||
|
|
||||||
|
_veProms = veProms;
|
||||||
|
|
||||||
|
|
||||||
// When opening Admin tools Check tab will be default.
|
// When opening Admin tools Check tab will be default.
|
||||||
this.sideNavItmCheck.Checked = true;
|
this.sideNavItmCheck.Checked = true;
|
||||||
|
|
||||||
@@ -36,7 +44,10 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
AdminToolType = (E_AdminToolType)4;
|
AdminToolType = (E_AdminToolType)4;
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
|
{
|
||||||
ResetDelTV(true);
|
ResetDelTV(true);
|
||||||
|
setupProgessSteps1();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ResetDelTV(false);
|
ResetDelTV(false);
|
||||||
}
|
}
|
||||||
@@ -101,6 +112,8 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
private Dictionary<TreeNode, ProcedureInfo> myProcedures = new Dictionary<TreeNode, ProcedureInfo>();
|
||||||
private Dictionary<TreeNode, DocVersionInfo> myDocVersions = new Dictionary<TreeNode, DocVersionInfo>();
|
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)
|
private void frmBatchRefresh_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
IsClosing = false;//B2017-221 Allow the batch dialog to close when waiting to process.
|
||||||
@@ -143,6 +156,7 @@ namespace VEPROMS
|
|||||||
//myTreeNodePath = new List<string>();
|
//myTreeNodePath = new List<string>();
|
||||||
myTV.Nodes.Clear();
|
myTV.Nodes.Clear();
|
||||||
myDocVersions.Clear();
|
myDocVersions.Clear();
|
||||||
|
myFolders.Clear();
|
||||||
FolderInfo fi = FolderInfo.GetTop();
|
FolderInfo fi = FolderInfo.GetTop();
|
||||||
TreeNode tn = myTV.Nodes.Add(fi.Name);
|
TreeNode tn = myTV.Nodes.Add(fi.Name);
|
||||||
tn.Tag = fi;
|
tn.Tag = fi;
|
||||||
@@ -166,44 +180,21 @@ namespace VEPROMS
|
|||||||
|
|
||||||
if (fi.ChildFolderCount > 0)
|
if (fi.ChildFolderCount > 0)
|
||||||
{
|
{
|
||||||
if (noProcs)
|
TreeNode tn = new TreeNode(fi.Name);
|
||||||
{
|
tn.Tag = fi;
|
||||||
LoadBottomLevelFolders(fi, myTVdel);
|
tn.StateImageIndex = -1; // Hide the checkbox for the root node
|
||||||
}
|
LoadChildFolders(fi, tn, noProcs);
|
||||||
else
|
myTVdel.Nodes.Add(tn);
|
||||||
{
|
|
||||||
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)
|
if (myTVdel.SelectedNode != null)
|
||||||
myTVdel.SelectedNode.Expand();
|
myTVdel.SelectedNode.Expand();
|
||||||
this.Cursor = Cursors.Default;
|
|
||||||
|
|
||||||
//btnFixLinks.Enabled = false;
|
//Expand if folders
|
||||||
//this.Cursor = Cursors.WaitCursor;
|
if (noProcs)
|
||||||
////myTreeNodePath = new List<string>();
|
myTVdel.ExpandAll();
|
||||||
//myTVdel.Nodes.Clear();
|
|
||||||
//myDocVersions.Clear();
|
this.Cursor = Cursors.Default;
|
||||||
//FolderInfo fi = FolderInfo.GetTop();
|
|
||||||
//TreeNode tn = myTVdel.Nodes.Add(fi.Name );
|
|
||||||
//tn.Tag = fi;
|
|
||||||
//if (fi.ChildFolderCount > 0)
|
|
||||||
//{
|
|
||||||
// if (noProcs)
|
|
||||||
// {
|
|
||||||
// LoadBottomLevelFolders(fi, myTVdel);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// LoadChildFolders(fi, tn, noProcs);
|
|
||||||
//}
|
|
||||||
//if (myTVdel.SelectedNode != null)
|
|
||||||
// myTVdel.SelectedNode.Expand();
|
|
||||||
//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
|
// B2021-060 Higher level folders where being removed from the tree even if there was a child folder that containe a working draft set
|
||||||
@@ -215,10 +206,13 @@ namespace VEPROMS
|
|||||||
{
|
{
|
||||||
TreeNode tnc = tn.Nodes.Add(fic.Name);
|
TreeNode tnc = tn.Nodes.Add(fic.Name);
|
||||||
tnc.Tag = fic;
|
tnc.Tag = fic;
|
||||||
|
|
||||||
if (fic.ChildFolderCount > 0)
|
if (fic.ChildFolderCount > 0)
|
||||||
|
{
|
||||||
if (LoadChildFolders(fic, tnc, noProcs))
|
if (LoadChildFolders(fic, tnc, noProcs))
|
||||||
loadedChildWorkingDraft = true;
|
loadedChildWorkingDraft = true;
|
||||||
// B2020-114 and C2020-035 only show folders the Set Admin can access
|
}
|
||||||
|
|
||||||
if (fic.FolderDocVersionCount > 0)
|
if (fic.FolderDocVersionCount > 0)
|
||||||
{
|
{
|
||||||
if (!LoadDocVersions(fic, tnc, noProcs))
|
if (!LoadDocVersions(fic, tnc, noProcs))
|
||||||
@@ -226,40 +220,27 @@ namespace VEPROMS
|
|||||||
else
|
else
|
||||||
loadedWorkingDraft = true;
|
loadedWorkingDraft = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (loadedChildWorkingDraft) loadedWorkingDraft = true; // B2021-060 if child folder working draft loaded set loadedWorkingDraft
|
|
||||||
if (tn.Parent != null && !loadedWorkingDraft)
|
|
||||||
tn.Remove();
|
|
||||||
return loadedWorkingDraft;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Load only bottom layer of folders into treenode.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fi"></param>
|
|
||||||
/// <param name="tn"></param>
|
|
||||||
private void LoadBottomLevelFolders(FolderInfo fi, TreeView treeView)
|
|
||||||
{
|
|
||||||
foreach (FolderInfo fic in fi.SortedChildFolders)
|
|
||||||
{
|
|
||||||
if (fic.ChildFolderCount > 0)
|
|
||||||
{
|
|
||||||
// Recursively call for child folders
|
|
||||||
LoadBottomLevelFolders(fic, treeView);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (fic.Name != "PROMS")
|
// Add the folder to the dictionary
|
||||||
{
|
if (!myFolders.ContainsKey(tnc))
|
||||||
|
myFolders.Add(tnc, fic);
|
||||||
|
|
||||||
|
|
||||||
// If the folder is a bottom-level folder (no child folders), add it directly to the TreeView
|
|
||||||
TreeNode tnc = treeView.Nodes.Add(fic.Name);
|
|
||||||
tnc.Tag = fic;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (loadedChildWorkingDraft)
|
||||||
|
{
|
||||||
|
loadedWorkingDraft = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tn.Parent != null && !loadedWorkingDraft)
|
||||||
|
{
|
||||||
|
tn.Remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadedWorkingDraft;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
|
private bool LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs)
|
||||||
{
|
{
|
||||||
bool rtnval = false;
|
bool rtnval = false;
|
||||||
@@ -1276,6 +1257,76 @@ 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;
|
private ProgressBarItem _ProgressBar = null;
|
||||||
|
|
||||||
@@ -1466,8 +1517,20 @@ namespace VEPROMS
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case E_AdminToolType.Delete:
|
case E_AdminToolType.Delete:
|
||||||
splitContainer3.Panel2Collapsed = true;
|
if (swDeleteFolder.Value)
|
||||||
progressSteps1.Visible = false;
|
{
|
||||||
|
splitContainer3.Panel2Collapsed = false;
|
||||||
|
progressSteps1.Items.Add(siOrphDatRecs);
|
||||||
|
lblAdmToolProgressType.Text = "Deleting: ";
|
||||||
|
progressSteps1.Visible = true;
|
||||||
|
progressSteps1.Refresh();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblAdmToolProgressType.Text = "";
|
||||||
|
splitContainer3.Panel2Collapsed = true;
|
||||||
|
progressSteps1.Visible = false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1669,6 +1732,7 @@ namespace VEPROMS
|
|||||||
//C2024-005 Delete Annotations, Delete Folders
|
//C2024-005 Delete Annotations, Delete Folders
|
||||||
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
|
private void swDeleteAnnotations_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
setupProgessSteps1();
|
||||||
swDeleteFolder.Value = !swDeleteAnnotations.Value;
|
swDeleteFolder.Value = !swDeleteAnnotations.Value;
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
ResetDelTV(true);
|
ResetDelTV(true);
|
||||||
@@ -1678,6 +1742,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
|
private void swDeleteFolder_ValueChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
setupProgessSteps1();
|
||||||
swDeleteAnnotations.Value = !swDeleteFolder.Value;
|
swDeleteAnnotations.Value = !swDeleteFolder.Value;
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
ResetDelTV(true);
|
ResetDelTV(true);
|
||||||
@@ -1691,68 +1756,120 @@ namespace VEPROMS
|
|||||||
txtResults.Clear();
|
txtResults.Clear();
|
||||||
txtProcess.Clear();
|
txtProcess.Clear();
|
||||||
|
|
||||||
|
this.Cursor = Cursors.WaitCursor;
|
||||||
|
|
||||||
|
//Create checked proce and doc info lists.
|
||||||
|
List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
||||||
|
List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
||||||
|
|
||||||
|
// Create a list of procedures the user selected
|
||||||
|
foreach (TreeNode tn in myProcedures.Keys)
|
||||||
|
if (tn.Checked)
|
||||||
|
pil.Add(myProcedures[tn]);
|
||||||
|
|
||||||
|
// Create a list of doc versions the user selected
|
||||||
|
foreach (TreeNode tn in myDocVersions.Keys)
|
||||||
|
if (tn.Checked)
|
||||||
|
dvil.Add(myDocVersions[tn]);
|
||||||
|
|
||||||
|
bool cancelledOut = false; // Flag to indicate if the process should be cancelled
|
||||||
|
StringBuilder sbDocVersions = new StringBuilder();
|
||||||
|
|
||||||
|
foreach (DocVersionInfo dq in dvil)
|
||||||
|
{
|
||||||
|
string msg = string.Empty;
|
||||||
|
if (!MySessionInfo.CanCheckOutItem(dq.VersionID, CheckOutType.DocVersion, ref msg))
|
||||||
|
{
|
||||||
|
string msgp = string.Empty;
|
||||||
|
foreach (ProcedureInfo pi in dq.Procedures)
|
||||||
|
{
|
||||||
|
if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgp))
|
||||||
|
{
|
||||||
|
FolderInfo fi = (FolderInfo)dq.ActiveParent;
|
||||||
|
int itemID = (int)fi.FolderID;
|
||||||
|
string folderName = fi.Name;
|
||||||
|
|
||||||
|
if (swDeleteFolder.Value)
|
||||||
|
sbDocVersions.AppendLine($"{folderName} - {msgp}");
|
||||||
|
else
|
||||||
|
sbDocVersions.AppendLine(msgp);
|
||||||
|
|
||||||
|
cancelledOut = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//B2024-074 If only deleting annotations from an individual procedure, verify can check out procedure.
|
||||||
|
string msgpi = string.Empty;
|
||||||
|
foreach (ProcedureInfo pi in pil)
|
||||||
|
{
|
||||||
|
//LINQ used for 1st check of if statement
|
||||||
|
//basically check if procedure was already part of a docVersionsFolder
|
||||||
|
//before checking if procedure was checked out already
|
||||||
|
//to avoid duplicate messages for checked out procedures
|
||||||
|
if (!dvil.Any(x => x.Procedures.Any(y => y.ItemID == pi.ItemID)) && !MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msgpi))
|
||||||
|
{
|
||||||
|
sbDocVersions.AppendLine(msgpi);
|
||||||
|
cancelledOut = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cancelledOut)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.AppendLine("The batch update process was not successful for all working drafts selected.");
|
||||||
|
sb.AppendLine("The following procedures are currently checked out...");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine(sbDocVersions.ToString());
|
||||||
|
sb.AppendLine();
|
||||||
|
if (swDeleteFolder.Value)
|
||||||
|
sb.AppendLine("If you want to delete these folders, please contact the respective users and have them close any procedures in the working draft.");
|
||||||
|
else
|
||||||
|
sb.AppendLine("If you want to delete annotations from these working drafts, please contact the respective users and have them close any procedures in the working draft.");
|
||||||
|
sb.AppendLine();
|
||||||
|
txtProcess.AppendText(sb.ToString());
|
||||||
|
this.Cursor = Cursors.Default;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (swDeleteFolder.Value)
|
if (swDeleteFolder.Value)
|
||||||
{
|
{
|
||||||
//TODO process deletions of folders
|
if (FlexibleMessageBox.Show(this, "Are 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...");
|
{
|
||||||
|
txtProcess.AppendText("Deleting Folders...");
|
||||||
|
|
||||||
//List<ProcedureInfo> pil = new List<ProcedureInfo>();
|
//Load Selected Folders
|
||||||
//foreach (TreeNode tn in myProcedures.Keys)
|
List<FolderInfo> ef = new List<FolderInfo>();
|
||||||
// if (tn.Checked)
|
foreach (TreeNode tn in myFolders.Keys)
|
||||||
// pil.Add(myProcedures[tn]);
|
|
||||||
|
|
||||||
////Load Selected Folders
|
if (tn.Checked)
|
||||||
Dictionary<int, string> folderData = new Dictionary<int, string>();
|
ef.Add(myFolders[tn]);
|
||||||
|
|
||||||
//List<FolderInfo> Flist = new List<FolderInfo>();
|
ProcessDelete(dvil, ef);
|
||||||
//foreach (TreeNode tn in myDocVersions.Keys)
|
}
|
||||||
// if (tn.Checked)
|
|
||||||
// Flist.Add();
|
|
||||||
|
|
||||||
//List<DocVersionInfo> dvil = new List<DocVersionInfo>();
|
|
||||||
//foreach (TreeNode tn in myDocVersions.Keys)
|
|
||||||
// if (tn.Checked)
|
|
||||||
// dvil.Add(myDocVersions[tn]);
|
|
||||||
|
|
||||||
//foreach (TreeNode tn in myTVdel.Nodes)
|
|
||||||
//{
|
|
||||||
// if (tn.Checked)
|
|
||||||
// {
|
|
||||||
// var itemInfo = myProcedures[tn];
|
|
||||||
// folderData.Add(itemInfo.ItemID, itemInfo.DisplayText);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//ProcessDelete(dvil);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Write progress status
|
// Write progress status
|
||||||
txtProcess.AppendText("Deleting Annotations..." + Environment.NewLine);
|
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);
|
frmAnnotationsCleanup frmAnnoDel = new frmAnnotationsCleanup(this, pil, dvil);
|
||||||
|
|
||||||
frmAnnoDel.ShowDialog();
|
frmAnnoDel.ShowDialog();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessDelete(List<DocVersionInfo> foldersToDelete)
|
private void ProcessDelete(List<DocVersionInfo> foldersToDelete, List<FolderInfo> emptyFoldersToDelete)
|
||||||
{
|
{
|
||||||
|
int foldersDeleted = 0;
|
||||||
|
|
||||||
DateTime pStart = DateTime.Now;
|
DateTime pStart = DateTime.Now;
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
txtProcess.AppendText(Environment.NewLine);
|
||||||
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
|
txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm"));
|
||||||
@@ -1760,17 +1877,19 @@ namespace VEPROMS
|
|||||||
|
|
||||||
foreach (var kvp in foldersToDelete)
|
foreach (var kvp in foldersToDelete)
|
||||||
{
|
{
|
||||||
int itemID = (int)kvp.ItemID;
|
//Gather folder information
|
||||||
string folderName = kvp.Name;
|
FolderInfo fi = (FolderInfo)kvp.ActiveParent;
|
||||||
|
int itemID = (int)fi.FolderID;
|
||||||
|
string folderName = fi.Name;
|
||||||
|
|
||||||
// Perform the deletion operation
|
// Perform the deletion operation
|
||||||
// Assume DeleteFolderByID is a method that deletes the folder by its ItemID
|
|
||||||
bool deletionSuccessful = DeleteFolderByID(itemID);
|
bool deletionSuccessful = DeleteFolderByID(itemID);
|
||||||
|
|
||||||
// Update txtProcess with the progress
|
// Update txtProcess with the progress
|
||||||
if (deletionSuccessful)
|
if (deletionSuccessful)
|
||||||
{
|
{
|
||||||
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
|
txtProcess.AppendText($"Successfully deleted folder: {folderName} (ID: {itemID})");
|
||||||
|
foldersDeleted += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1778,13 +1897,69 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
txtProcess.AppendText(Environment.NewLine);
|
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})");
|
||||||
|
foldersDeleted += 1;
|
||||||
|
}
|
||||||
|
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, {foldersDeleted} folders have been deleted.", "Delete Folders");
|
||||||
|
ClearStepProgress();
|
||||||
|
|
||||||
|
txtResults.AppendText($"Folder deletion process completed, {foldersDeleted} folders have been deleted.");
|
||||||
|
txtResults.AppendText(Environment.NewLine);
|
||||||
}
|
}
|
||||||
// Example deletion method
|
|
||||||
private bool DeleteFolderByID(int itemID)
|
private bool DeleteFolderByID(int folderID)
|
||||||
{
|
{
|
||||||
// Implement your folder deletion logic here
|
try
|
||||||
// Return true if deletion was successful, false otherwise
|
{
|
||||||
return true; // Placeholder
|
//Delete
|
||||||
|
Folder.DeleteFolderAdmin(folderID);
|
||||||
|
|
||||||
|
//update treeview UI via veProms
|
||||||
|
_veProms.tv_FolderDelete(folderID);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string err = ex.ToString();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ProcedureInfo> RetrieveChkAnnotations()
|
public List<ProcedureInfo> RetrieveChkAnnotations()
|
||||||
|
@@ -121,9 +121,7 @@
|
|||||||
<value>17, 17</value>
|
<value>17, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<data name="swDeleteFolder.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This allows the user to remove folders and sub folders as well as their contents.
|
||||||
|
|
||||||
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.
|
Be sure a current backup of the database exists prior performing this function.
|
||||||
|
|
||||||
@@ -132,28 +130,34 @@ It is recommended that this be done during off hours.
|
|||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX13.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This allows the user to remove folders and sub folders as well as their contents.
|
||||||
|
|
||||||
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.
|
Be sure a current backup of the database exists prior performing this function.
|
||||||
|
|
||||||
It is recommended that this be done during off hours.
|
It is recommended that this be done during off hours.
|
||||||
|
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="swDeleteAnnotations.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This function will allow the user to remove annotations from the selected working drafts.
|
||||||
|
|
||||||
Be sure a current backup of the database exists prior to running this function.
|
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>
|
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="labelX14.SuperTooltip" xml:space="preserve">
|
<data name="labelX14.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.
|
<value>This function will allow the user to remove annotations from the selected working drafts.
|
||||||
|
|
||||||
Be sure a current backup of the database exists prior to running this function.
|
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>
|
If more than one working draft is selected, it is recommended that this be performed during off hours.</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnDeleteItems.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>
|
||||||
<data name="swCheckROLinks.SuperTooltip" xml:space="preserve">
|
<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.
|
<value>This allows the user to check referenced objects links in procedure step data for multiple working drafts in a batch mode.
|
||||||
|
@@ -295,7 +295,10 @@ namespace VEPROMS
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
// B2024-062 Added check for EmptyProcedure. We don't need to show the Try Again message if the procedure
|
||||||
|
// is empty, as it would be just be a waste of time for the user.
|
||||||
|
while (!MyPromsPrinter.MergeNotIncluded && _PdfFile == null && !MyPromsPrinter.EmptyProcedure &&
|
||||||
|
MessageBox.Show("Try Again?", "PDF Creation Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes);
|
||||||
|
|
||||||
|
|
||||||
if (_PdfFile == null)
|
if (_PdfFile == null)
|
||||||
|
@@ -254,6 +254,21 @@ namespace VEPROMS
|
|||||||
tc.RefreshItem(myItemInfo);
|
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;
|
private E_UCFImportOptions _UCFImportOptionsFromSettings;
|
||||||
|
|
||||||
public frmVEPROMS()
|
public frmVEPROMS()
|
||||||
@@ -474,6 +489,7 @@ namespace VEPROMS
|
|||||||
tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew);
|
tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew);
|
||||||
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
|
tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem);
|
||||||
tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay);
|
tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay);
|
||||||
|
tv.DeleteFolder += new vlnTreeViewItemInfoDeleteFolderEvent(Tv_DeleteFolder);
|
||||||
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
|
tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo);
|
||||||
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
|
tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo);
|
||||||
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
|
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
|
||||||
@@ -1654,16 +1670,38 @@ namespace VEPROMS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
|
string stk = Volian.Base.Library.vlnStackTrace.StackToString();
|
||||||
|
|
||||||
if (!stk.Contains("Exception"))
|
if (!stk.Contains("Exception"))
|
||||||
{
|
{
|
||||||
// B2018-091 Allow PROMS to close if only MSWord sections have been opened.
|
// B2018-091 Allow PROMS to close if only MSWord sections have been opened.
|
||||||
// B2019-071 we will now close one or all of the tabs (even step editor ones)
|
// B2019-071 we will now close one or all of the tabs (even step editor ones)
|
||||||
|
if (_WeAreExitingPROMS)
|
||||||
|
{
|
||||||
|
string DisplayTabID = "";
|
||||||
|
int pos;
|
||||||
|
int TabItemID;
|
||||||
|
string DisplayTabName = "";
|
||||||
|
int cnt = 0;
|
||||||
|
// Deactivate previous procedure tab state by user
|
||||||
|
VEPROMS.CSLA.Library.Item.DeactivateStateDisplayTabTmp(MySessionInfo.UserID);
|
||||||
|
// Save current procedure tab state
|
||||||
|
foreach (KeyValuePair<string, DisplayTabItem> pgTab in tc._MyDisplayTabItems)
|
||||||
|
{
|
||||||
|
cnt++;
|
||||||
|
DisplayTabID = pgTab.Key;
|
||||||
|
TabItemID = Int32.Parse(DisplayTabID.Substring(DisplayTabID.IndexOf("Item - ") + 7));
|
||||||
|
DisplayTabName = pgTab.Value.ToString();
|
||||||
|
//tc.SelectedDisplayTabItem.MyStepTabPanel.ToString()
|
||||||
|
VEPROMS.CSLA.Library.Item.AddDisplayTabsState(TabItemID, DisplayTabID, DisplayTabName, MySessionInfo.UserID, cnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int n = tc._MyDisplayTabItems.Count;
|
int n = tc._MyDisplayTabItems.Count;
|
||||||
|
|
||||||
while (n-- > 0 && tc._MyDisplayTabItems.Count > 0)
|
while (n-- > 0 && tc._MyDisplayTabItems.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
tc.CloseTabItem(tc.SelectedDisplayTabItem);
|
tc.CloseTabItem(tc.SelectedDisplayTabItem);
|
||||||
|
|
||||||
// B2019-071 close just the current tab and continue working
|
// B2019-071 close just the current tab and continue working
|
||||||
@@ -2304,6 +2342,27 @@ namespace VEPROMS
|
|||||||
CurrentID = txtSearch.Text;
|
CurrentID = txtSearch.Text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add retrieve displaytabs state here.
|
||||||
|
openDisplaytabstate();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void openDisplaytabstate()
|
||||||
|
{
|
||||||
|
DataTable DisPlayTabState = VEPROMS.CSLA.Library.Item.GetDisplayTabs(VlnSettings.UserID);
|
||||||
|
|
||||||
|
if (DisPlayTabState.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (DataRow TabState in DisPlayTabState.Rows)
|
||||||
|
{
|
||||||
|
int _ItemID = (int)TabState["ItemID"];
|
||||||
|
//ItemInfoList _Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure));
|
||||||
|
ItemInfo _Procedure = ItemInfo.Get(_ItemID);
|
||||||
|
//ItemInfo.Get
|
||||||
|
//ItemInfo.Get
|
||||||
|
OpenItem(_Procedure);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
|
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
|
||||||
@@ -2741,7 +2800,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
void btnAdministrativeTools_Click(object sender, EventArgs e)
|
void btnAdministrativeTools_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo);
|
frmBatchRefresh frm = new frmBatchRefresh(MySessionInfo, this);
|
||||||
frm.ProgressBar = bottomProgBar;
|
frm.ProgressBar = bottomProgBar;
|
||||||
frm.ShowDialog(this);
|
frm.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
@@ -511,7 +511,7 @@ namespace VEPROMS
|
|||||||
|
|
||||||
private void btnPC_Click(object sender, EventArgs e)
|
private void btnPC_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(this, "Are you sure you want to add Applicability to this Working Draft?", "Add Applicability", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop) == DialogResult.Yes)
|
if (MessageBox.Show(this, "Are you sure you want to add Applicability to this Working Draft?", "Add Applicability", MessageBoxButtons.YesNo, MessageBoxIcon.Stop) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
btnApplicability.Visible = true;
|
btnApplicability.Visible = true;
|
||||||
tiApplicability.Visible = true;
|
tiApplicability.Visible = true;
|
||||||
|
@@ -8004,6 +8004,171 @@ namespace VEPROMS.CSLA.Library
|
|||||||
MyContent.Config = _ProcedureConfig.ToString();
|
MyContent.Config = _ProcedureConfig.ToString();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
public class DisplayTabs
|
||||||
|
{
|
||||||
|
private int _ItemID;
|
||||||
|
public int ItemID
|
||||||
|
{
|
||||||
|
get { return _ItemID; }
|
||||||
|
set { _ItemID = value; }
|
||||||
|
|
||||||
|
}
|
||||||
|
private string _DisplayTabID;
|
||||||
|
public string DisplayTabID
|
||||||
|
{
|
||||||
|
get { return _DisplayTabID; }
|
||||||
|
set { _DisplayTabID = value; }
|
||||||
|
}
|
||||||
|
private string _DisplayTabName;
|
||||||
|
public string DisplayTabName
|
||||||
|
{
|
||||||
|
get { return _DisplayTabName; }
|
||||||
|
set { _DisplayTabName = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public SafeDataReader Dr { get; }
|
||||||
|
|
||||||
|
public DisplayTabs()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public DisplayTabs(int itemID, String displayTabID, String displayTabName)
|
||||||
|
{
|
||||||
|
_ItemID = itemID;
|
||||||
|
_DisplayTabID = displayTabID;
|
||||||
|
_DisplayTabName = displayTabName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DisplayTabs(SafeDataReader dr)
|
||||||
|
{
|
||||||
|
Dr = dr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static DataTable GetDisplayTabs(int itemID) //, string displayTabID, string displayTabName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DataTable tmp = DataPortal.Fetch<DataTable>(new DisplayTabs(itemID, "", "")); //, displayTabID, displayTabName));
|
||||||
|
//ItemInfo.AddList(tmp);
|
||||||
|
//tmp.AddEvents();
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private DataTable dt = new DataTable();
|
||||||
|
private DataTable DataPortal_Fetch(DisplayTabs criteria)
|
||||||
|
{
|
||||||
|
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "GetDisplayTabData";
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||||
|
da.Fill(dt);
|
||||||
|
cn.Close();
|
||||||
|
da.Dispose();
|
||||||
|
return dt;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
|
||||||
|
throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
|
||||||
|
//{
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// //DisplayTabs tmp =
|
||||||
|
// DataPortal.Fetch<DisplayTabs>(new DisplayTabs(itemID, displayTabID, displayTabName)); //, displayTabID, displayTabName));
|
||||||
|
// //ItemInfo.AddList(tmp);
|
||||||
|
// //tmp.AddEvents();
|
||||||
|
// //return tmp;
|
||||||
|
// }
|
||||||
|
// catch (Exception ex)
|
||||||
|
// {
|
||||||
|
// throw new DbCslaException("Error on ItemInfoList.GetChildren", ex);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//private DataTable dt = new DataTable();
|
||||||
|
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||||
|
//{
|
||||||
|
|
||||||
|
// using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
// {
|
||||||
|
// using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
// cm.CommandText = "AddDisplayTabState";
|
||||||
|
// cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
// cm.Parameters.AddWithValue("@ItemID", ItemID);
|
||||||
|
// cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||||
|
// cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||||
|
// cm.ExecuteNonQuery();
|
||||||
|
// //SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||||
|
// //da.Fill(dt);
|
||||||
|
// //cn.Close();
|
||||||
|
// //da.Dispose();
|
||||||
|
// //return dt; // fix
|
||||||
|
// }
|
||||||
|
// catch (Exception ex)
|
||||||
|
// {
|
||||||
|
// //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DataPortal_Fetch", ex);
|
||||||
|
// throw new DbCslaException("ItemExt.DataPortal_Fetch", ex);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName)
|
||||||
|
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||||
|
{
|
||||||
|
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "AddDisplayTabState";
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||||
|
cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||||
|
cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||||
|
cm.ExecuteNonQuery();
|
||||||
|
//SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||||
|
//da.Fill(dt);
|
||||||
|
//cn.Close();
|
||||||
|
//da.Dispose();
|
||||||
|
//return dt; // fix
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex);
|
||||||
|
throw new DbCslaException("ItemExt.AddDisplayTabsState", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region SectionInfo
|
#region SectionInfo
|
||||||
|
@@ -951,7 +951,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// it is pasted into a section without enhanced data, then clear it.
|
// it is pasted into a section without enhanced data, then clear it.
|
||||||
|
|
||||||
// config data can only be on hls/notes/cautions for pasted steps.
|
// config data can only be on hls/notes/cautions for pasted steps.
|
||||||
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote) return;
|
// B2024-059: clear links on a source section. When a paste occurs, the section is copied with the links but not
|
||||||
|
// new section is created in the enhanced document, so the links point to the original section (copied). These
|
||||||
|
// need to be removed.
|
||||||
|
if (!pasteItem.IsHigh && !pasteItem.IsCaution && !pasteItem.IsNote && !pasteItem.IsSection) return;
|
||||||
|
|
||||||
// See if the pasted step's section is enhanced with enhanced steps, and if not, clear it
|
// See if the pasted step's section is enhanced with enhanced steps, and if not, clear it
|
||||||
// Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code.
|
// Also, if pasting into a source section, don't clear (B2017-225), the 'isSourceSection' portion of the code.
|
||||||
@@ -974,6 +977,12 @@ namespace VEPROMS.CSLA.Library
|
|||||||
// of the pasted step.
|
// of the pasted step.
|
||||||
if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig();
|
if (pasteItem.HasEnhancedLinkedStep) pasteItem.RemoveEnhancedFromConfig();
|
||||||
}
|
}
|
||||||
|
// B2024-059: clear links on a source section
|
||||||
|
if (isSourceSection)
|
||||||
|
{
|
||||||
|
EnhancedDocuments seleds = pasteItem.GetMyEnhancedDocuments();
|
||||||
|
foreach (EnhancedDocument ed in seleds) pasteItem.DoUnlinkEnhanced(pasteItem, ed.Type, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Insert Child
|
#region Insert Child
|
||||||
@@ -1309,8 +1318,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
||||||
{
|
{
|
||||||
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
||||||
TreeNode trn = null;
|
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid);
|
||||||
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
|
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
|
||||||
@@ -1868,6 +1876,10 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (IsCaution) enhType = 20006;
|
if (IsCaution) enhType = 20006;
|
||||||
return enhType;
|
return enhType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// B2024-075: Paste Before/After with Enhanced Documents is creating situation
|
||||||
|
//where Background item is linked to Source but Source is not linked to Background
|
||||||
|
//When Fixing the linking, need to not create a duplicate link if one already exists
|
||||||
public void DoCreateLinksEnhancedSingleItem(ItemInfo enhii, int enhtype)
|
public void DoCreateLinksEnhancedSingleItem(ItemInfo enhii, int enhtype)
|
||||||
{
|
{
|
||||||
// Link the 2 items, srcII & enhii:
|
// Link the 2 items, srcII & enhii:
|
||||||
@@ -1885,12 +1897,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (Item ei = Item.Get(enhii.ItemID))
|
using (Item ei = Item.Get(enhii.ItemID))
|
||||||
{
|
{
|
||||||
StepConfig sc = enhii.MyConfig as StepConfig;
|
StepConfig sc = enhii.MyConfig as StepConfig;
|
||||||
sc.AddEnhancedDocument(0, this.ItemID);
|
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||||
sc.SaveEnhancedDocuments();
|
{
|
||||||
ei.MyContent.Text = DisplayText;
|
sc.AddEnhancedDocument(0, this.ItemID);
|
||||||
ei.MyContent.Config = sc.ToString();
|
sc.SaveEnhancedDocuments();
|
||||||
ei.Save();
|
ei.MyContent.Text = DisplayText;
|
||||||
enhii.RefreshConfig();
|
ei.MyContent.Config = sc.ToString();
|
||||||
|
ei.Save();
|
||||||
|
enhii.RefreshConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IsSection)
|
else if (IsSection)
|
||||||
@@ -1908,12 +1923,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (Item ei = Item.Get(enhii.ItemID))
|
using (Item ei = Item.Get(enhii.ItemID))
|
||||||
{
|
{
|
||||||
SectionConfig sc = enhii.MyConfig as SectionConfig;
|
SectionConfig sc = enhii.MyConfig as SectionConfig;
|
||||||
sc.AddEnhancedDocument(0, this.ItemID);
|
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||||
sc.SaveEnhancedDocuments();
|
{
|
||||||
ei.MyContent.Text = DisplayText;
|
sc.AddEnhancedDocument(0, this.ItemID);
|
||||||
ei.MyContent.Config = sc.ToString();
|
sc.SaveEnhancedDocuments();
|
||||||
ei.Save();
|
ei.MyContent.Text = DisplayText;
|
||||||
enhii.RefreshConfig();
|
ei.MyContent.Config = sc.ToString();
|
||||||
|
ei.Save();
|
||||||
|
enhii.RefreshConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IsProcedure)
|
else if (IsProcedure)
|
||||||
@@ -1934,16 +1952,66 @@ namespace VEPROMS.CSLA.Library
|
|||||||
using (Item ii = this.Get())
|
using (Item ii = this.Get())
|
||||||
{
|
{
|
||||||
ProcedureConfig sc = this.MyConfig as ProcedureConfig;
|
ProcedureConfig sc = this.MyConfig as ProcedureConfig;
|
||||||
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
if (!sc.MyEnhancedDocuments.Exists(x => x.Type == 0))
|
||||||
sc.SaveEnhancedDocuments();
|
{
|
||||||
ii.MyContent.Config = sc.ToString();
|
sc.AddEnhancedDocument(enhtype, enhii.ItemID);
|
||||||
ii.Save();
|
sc.SaveEnhancedDocuments();
|
||||||
RefreshConfig();
|
ii.MyContent.Config = sc.ToString();
|
||||||
|
ii.Save();
|
||||||
|
RefreshConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region DataPortal
|
#region DataPortal
|
||||||
|
// C2017-031: Support for paste/replace an enhanced step
|
||||||
|
private void DataPortal_Fetch(PastingPartEnhancedCriteria criteria)
|
||||||
|
{
|
||||||
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
Csla.ApplicationContext.LocalContext["cn"] = cn;
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.Parameters.AddWithValue("@StartItemID", criteria.StartItemID); // copy children
|
||||||
|
cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); //copy to
|
||||||
|
cm.Parameters.AddWithValue("@Type", criteria.Type);
|
||||||
|
cm.Parameters.AddWithValue("@DTS", criteria.DTS);
|
||||||
|
cm.Parameters.AddWithValue("@UserID", criteria.UserID);
|
||||||
|
SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int);
|
||||||
|
param_ContentID.Direction = ParameterDirection.Output;
|
||||||
|
cm.Parameters.Add(param_ContentID);
|
||||||
|
cm.CommandText = "PasteItemEnhancedReplace";
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
|
||||||
|
{
|
||||||
|
if (!dr.Read())
|
||||||
|
{
|
||||||
|
_ErrorMessage = "No Record Found";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ReadData(dr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// removing of item only needed for local data portal
|
||||||
|
if (Csla.ApplicationContext.ExecutionLocation == Csla.ApplicationContext.ExecutionLocations.Client)
|
||||||
|
Csla.ApplicationContext.LocalContext.Remove("cn");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (!ex.Message.Contains("This step has been deleted") && !ex.Message.Contains("This current step has been deleted in another session"))
|
||||||
|
{
|
||||||
|
if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex);
|
||||||
|
}
|
||||||
|
_ErrorMessage = ex.Message;
|
||||||
|
throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
private void DataPortal_Fetch(PastingPartCriteria criteria)
|
private void DataPortal_Fetch(PastingPartCriteria criteria)
|
||||||
{
|
{
|
||||||
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode());
|
||||||
@@ -2065,9 +2133,72 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex);
|
throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
#region PastingPartEnhancedCriteria
|
||||||
|
// C2017-031: Support for paste/replace an enhanced step
|
||||||
|
[Serializable()]
|
||||||
|
public class PastingPartEnhancedCriteria
|
||||||
|
{
|
||||||
|
#region Properties
|
||||||
|
private int _StartItemID;
|
||||||
|
public int StartItemID
|
||||||
|
{
|
||||||
|
get { return _StartItemID; }
|
||||||
|
set { _StartItemID = value; }
|
||||||
|
}
|
||||||
|
private int _ItemID; // paste relative to this itemid
|
||||||
|
public int ItemID
|
||||||
|
{
|
||||||
|
get { return _ItemID; }
|
||||||
|
set { _ItemID = value; }
|
||||||
|
}
|
||||||
|
private EAddpingPart _AddType;
|
||||||
|
public EAddpingPart AddType
|
||||||
|
{
|
||||||
|
get { return _AddType; }
|
||||||
|
set { _AddType = value; }
|
||||||
|
}
|
||||||
|
private int? _FromType = null;
|
||||||
|
public int? FromType
|
||||||
|
{
|
||||||
|
get { return _FromType; }
|
||||||
|
set { _FromType = value; }
|
||||||
|
}
|
||||||
|
private int? _Type = null;
|
||||||
|
public int? Type
|
||||||
|
{
|
||||||
|
get { return _Type; }
|
||||||
|
set { _Type = value; }
|
||||||
|
}
|
||||||
|
private DateTime _DTS;
|
||||||
|
public DateTime DTS
|
||||||
|
{
|
||||||
|
get { return _DTS; }
|
||||||
|
set { _DTS = value; }
|
||||||
|
}
|
||||||
|
private string _UserID;
|
||||||
|
public string UserID
|
||||||
|
{
|
||||||
|
get { return _UserID; }
|
||||||
|
set { _UserID = value; }
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#region Constructor
|
||||||
|
public PastingPartEnhancedCriteria(int startItemid, int itemID, EAddpingPart addType, int? type, int? fromType, DateTime dts, string userID)
|
||||||
|
{
|
||||||
|
_StartItemID = startItemid;
|
||||||
|
_ItemID = itemID;
|
||||||
|
_AddType = addType;
|
||||||
|
_Type = type;
|
||||||
|
_FromType = fromType;
|
||||||
|
_DTS = dts;
|
||||||
|
_UserID = userID;
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region PastingPartCriteria
|
}
|
||||||
[Serializable()]
|
#endregion
|
||||||
|
#region PastingPartCriteria
|
||||||
|
[Serializable()]
|
||||||
public class PastingPartCriteria
|
public class PastingPartCriteria
|
||||||
{
|
{
|
||||||
#region Properties
|
#region Properties
|
||||||
@@ -2356,6 +2487,14 @@ namespace VEPROMS.CSLA.Library
|
|||||||
_MyPrevious = null; // Reset list so that the next line gets a new list
|
_MyPrevious = null; // Reset list so that the next line gets a new list
|
||||||
if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value
|
if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value
|
||||||
}
|
}
|
||||||
|
// C2017-031: Support for paste/replace an enhanced step
|
||||||
|
internal static ItemInfo CopyPasteReplaceEnhancedItemInfoFetch(int copyStartID, ItemInfo itemInfo)
|
||||||
|
{
|
||||||
|
ItemInfo tmp = null;
|
||||||
|
tmp = DataPortal.Fetch<StepInfo>(new ItemInfo.PastingPartEnhancedCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID));
|
||||||
|
AddToCache(tmp);
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
internal static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType)
|
||||||
{
|
{
|
||||||
ItemInfo tmp = null;
|
ItemInfo tmp = null;
|
||||||
@@ -2498,16 +2637,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region PasteReplace
|
#region PasteReplace
|
||||||
|
// B2024-045, 049 and 050: remove the treenode that was passed in - adjust tree from user interface code, not in item extension
|
||||||
|
// code (the 2 PasteReplace methods here had a treenode passed in)
|
||||||
|
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;
|
bool tmp = false;
|
||||||
return PasteReplace(itemInfo, copyStartID, chgid, treeNodeReplace, ref tmp);
|
return PasteReplace(itemInfo, copyStartID, chgid, 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
|
// 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, TreeNode treeNodeReplace, ref bool firstTrans)
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
|
||||||
{
|
{
|
||||||
firstTrans = false;
|
firstTrans = false;
|
||||||
if (!CanDeleteObject())
|
if (!CanDeleteObject())
|
||||||
@@ -2518,8 +2656,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
ItemInfo newItemInfo = null;
|
ItemInfo newItemInfo = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type);
|
// C2017-031: Support for paste/replace an enhanced step, if this is replacing enhanced, do a specific query
|
||||||
if (newItemInfo == null) return null;
|
if (itemInfo.IsEnhancedStep)
|
||||||
|
{
|
||||||
|
newItemInfo = ItemInfo.CopyPasteReplaceEnhancedItemInfoFetch(copyStartID, itemInfo);
|
||||||
|
if (newItemInfo == null) return null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newItemInfo = ItemInfo.CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); if (newItemInfo == null) return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex1)
|
catch (Exception ex1)
|
||||||
{
|
{
|
||||||
@@ -2565,10 +2711,11 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Create tree node for copied procedure when no other procedures exist in the working draft (treeNodeReplace)
|
// B2024-045, 049 and 050: if not a single procedure replace, update user interface by using the 'OnNewChild'. Single
|
||||||
VETreeNode tn = null;
|
// procedure's MyParent is null because its parent is a working draft (docversion) since MyParent's type is iteminfo.
|
||||||
tn = new VETreeNode(newItemInfo);
|
// For the single procedure case, the user interface code in vlntreeview will update the tree.
|
||||||
treeNodeReplace.Nodes.Add(tn);
|
if (newItemInfo.MyParent != null)
|
||||||
|
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
|
||||||
}
|
}
|
||||||
return newItemInfo;
|
return newItemInfo;
|
||||||
}
|
}
|
||||||
|
@@ -156,32 +156,38 @@ namespace VEPROMS.CSLA.Library
|
|||||||
SessionInfoList sil = DataPortal.Fetch<SessionInfoList>(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType));
|
SessionInfoList sil = DataPortal.Fetch<SessionInfoList>(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType));
|
||||||
if (sil.Count == 0)
|
if (sil.Count == 0)
|
||||||
return true;
|
return true;
|
||||||
if (objectType == CheckOutType.Session)
|
if (objectType == CheckOutType.Session)
|
||||||
{
|
{
|
||||||
if (sil.Count == 1)
|
if (sil.Count == 1)
|
||||||
{
|
{
|
||||||
OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID);
|
OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID);
|
||||||
if (oil.Count == 0)
|
if (oil.Count == 0)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents";
|
message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database";
|
message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool rv = true;
|
bool rv = true;
|
||||||
// C2015-022 part of separate windows logic, check the processID instead of the sessionID
|
// C2015-022 part of separate windows logic, check the processID instead of the sessionID
|
||||||
foreach (SessionInfo si in sil)
|
foreach (SessionInfo si in sil)
|
||||||
{
|
{
|
||||||
if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure)
|
if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure)
|
||||||
{
|
{
|
||||||
message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID);
|
//B2024-074 If no Number for Procedure, Display Title
|
||||||
|
ProcedureInfo tmpproc = ItemInfo.Get(objectID).MyProcedure;
|
||||||
|
string name = tmpproc.DisplayNumber;
|
||||||
|
if (string.IsNullOrEmpty(name))
|
||||||
|
{ name = tmpproc.DisplayText; }
|
||||||
|
|
||||||
|
message = string.Format("The procedure {0} is already checked out to {1}", name, si.UserID);
|
||||||
rv = rv && false;
|
rv = rv && false;
|
||||||
}
|
}
|
||||||
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document)
|
else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document)
|
||||||
@@ -195,8 +201,16 @@ namespace VEPROMS.CSLA.Library
|
|||||||
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID);
|
||||||
if (oi == null)
|
if (oi == null)
|
||||||
message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine;
|
message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine;
|
||||||
else if(oi.OwnerType == 0)
|
else if (oi.OwnerType == 0)
|
||||||
message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine;
|
{
|
||||||
|
//B2024-074 If no Number for Procedure, Display Title
|
||||||
|
ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure;
|
||||||
|
string name = tmpproc.DisplayNumber;
|
||||||
|
if (string.IsNullOrEmpty(name))
|
||||||
|
{ name = tmpproc.DisplayText; }
|
||||||
|
|
||||||
|
message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine;
|
||||||
|
}
|
||||||
else if (oi.OwnerType == 1)
|
else if (oi.OwnerType == 1)
|
||||||
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
||||||
else if (oi.OwnerType == 2)
|
else if (oi.OwnerType == 2)
|
||||||
@@ -211,7 +225,15 @@ namespace VEPROMS.CSLA.Library
|
|||||||
if (oi != null)
|
if (oi != null)
|
||||||
{
|
{
|
||||||
if (oi.OwnerType == 0)
|
if (oi.OwnerType == 0)
|
||||||
message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine;
|
{
|
||||||
|
//B2024-074 If no Number for Procedure, Display Title
|
||||||
|
ProcedureInfo tmpproc = ItemInfo.Get(oi.OwnerItemID).MyProcedure;
|
||||||
|
string name = tmpproc.DisplayNumber;
|
||||||
|
if (string.IsNullOrEmpty(name))
|
||||||
|
{ name = tmpproc.DisplayText; }
|
||||||
|
|
||||||
|
message = message + string.Format("The procedure {0} is already checked out to {1}", name, si.UserID) + Environment.NewLine;
|
||||||
|
}
|
||||||
else if (oi.OwnerType == 1)
|
else if (oi.OwnerType == 1)
|
||||||
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine;
|
||||||
else if (oi.OwnerType == 2)
|
else if (oi.OwnerType == 2)
|
||||||
|
@@ -1433,6 +1433,31 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Folder.Remove", ex);
|
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
|
#endregion
|
||||||
#region Exists
|
#region Exists
|
||||||
public static bool Exists(int folderID)
|
public static bool Exists(int folderID)
|
||||||
|
@@ -1132,6 +1132,91 @@ namespace VEPROMS.CSLA.Library
|
|||||||
throw new DbCslaException("Item.Add", ex);
|
throw new DbCslaException("Item.Add", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void DeactivateStateDisplayTabTmp(string UserID)
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "DeactivateStateDisplayTabTmp";
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||||
|
cm.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||||
|
throw new DbCslaException("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void AddDisplayTabsState(int itemID, string displayTabID, string displayTabName, string UserID, int order)
|
||||||
|
//private void DataPortal_Fetch(int itemID, string displayTabID, string displayTabName)
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "AddDisplayTabState";
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
cm.Parameters.AddWithValue("@ItemID", itemID);
|
||||||
|
cm.Parameters.AddWithValue("@displayTabID", displayTabID);
|
||||||
|
cm.Parameters.AddWithValue("@displayTabName", displayTabName);
|
||||||
|
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||||
|
cm.Parameters.AddWithValue("@order", order);
|
||||||
|
cm.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.AddDisplayTabsState", ex);
|
||||||
|
throw new DbCslaException("ItemExt.AddDisplayTabsState", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static DataTable GetDisplayTabs(string UserID) //, string displayTabID, string displayTabName)
|
||||||
|
//public static void DeactivateStateDisplayTabTmp(string UserID)
|
||||||
|
{
|
||||||
|
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||||
|
{
|
||||||
|
using (SqlCommand cm = cn.CreateCommand())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cm.CommandType = CommandType.StoredProcedure;
|
||||||
|
cm.CommandText = "GetDisplayTabdata";
|
||||||
|
cm.CommandTimeout = Database.DefaultTimeout;
|
||||||
|
cm.Parameters.AddWithValue("@UserID", UserID);
|
||||||
|
//cm.ExecuteNonQuery();
|
||||||
|
SqlDataAdapter da = new SqlDataAdapter(cm);
|
||||||
|
//da.Fill(dt);
|
||||||
|
//cn.Close();
|
||||||
|
//da.Dispose();
|
||||||
|
//return dt; // fix
|
||||||
|
|
||||||
|
SqlDataReader reader = cm.ExecuteReader();
|
||||||
|
DataTable dt = new DataTable();
|
||||||
|
dt.Load(reader);
|
||||||
|
return dt;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||||
|
throw new DbCslaException("ItemExt.DeactivateStateDisplayTabTmp", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
[Transactional(TransactionalTypes.TransactionScope)]
|
[Transactional(TransactionalTypes.TransactionScope)]
|
||||||
protected override void DataPortal_Update()
|
protected override void DataPortal_Update()
|
||||||
{
|
{
|
||||||
|
@@ -277,17 +277,27 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
private void btnRemoveAnnotation_Click(object sender, EventArgs e)
|
private void btnRemoveAnnotation_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//using (Annotation annotation = CurrentAnnotation.Get())
|
// CSM B2024-068 / B2024-069 - check if current annotation is not selected before removal of annotation
|
||||||
//{
|
if (CurrentAnnotation != null)
|
||||||
// annotation.Delete();
|
{
|
||||||
_AnnotationSearch.LoadingList = true;
|
//using (Annotation annotation = CurrentAnnotation.Get())
|
||||||
Annotation.DeleteAnnotation(CurrentAnnotation);
|
//{
|
||||||
// annotation.Save();
|
// annotation.Delete();
|
||||||
_AnnotationSearch.LoadingList = false;
|
_AnnotationSearch.LoadingList = true;
|
||||||
CurrentAnnotation = null;
|
Annotation.DeleteAnnotation(CurrentAnnotation);
|
||||||
UpdateAnnotationGrid();
|
// annotation.Save();
|
||||||
_AnnotationSearch.UpdateAnnotationSearchResults(); // B2019-004: update search results list when an annotation is removed.
|
_AnnotationSearch.LoadingList = false;
|
||||||
//}
|
CurrentAnnotation = null;
|
||||||
|
UpdateAnnotationGrid();
|
||||||
|
_AnnotationSearch.UpdateAnnotationSearchResults(); // B2019-004: update search results list when an annotation is removed.
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FlexibleMessageBox.Show("You Must Select an Annotation To Remove", "Annotation Not Selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnSaveAnnotation_Click(object sender, EventArgs e)
|
private void btnSaveAnnotation_Click(object sender, EventArgs e)
|
||||||
@@ -674,12 +684,15 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
using (Annotation annotation = CurrentAnnotation.Get())
|
using (Annotation annotation = CurrentAnnotation.Get())
|
||||||
{
|
{
|
||||||
annotation.RtfText = rtxbComment.Rtf;
|
if (annotation != null) // B2024-061 check for null reference
|
||||||
annotation.SearchText = rtxbComment.Text;
|
{
|
||||||
annotation.MyAnnotationType = annotationType;
|
annotation.RtfText = rtxbComment.Rtf;
|
||||||
annotation.DTS = DateTime.Now;
|
annotation.SearchText = rtxbComment.Text;
|
||||||
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
|
annotation.MyAnnotationType = annotationType;
|
||||||
annotation.Save();
|
annotation.DTS = DateTime.Now;
|
||||||
|
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
|
||||||
|
annotation.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -503,7 +503,7 @@ namespace Volian.Controls.Library
|
|||||||
this.cbxSortBySetpointID.Size = new System.Drawing.Size(121, 23);
|
this.cbxSortBySetpointID.Size = new System.Drawing.Size(121, 23);
|
||||||
this.cbxSortBySetpointID.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
this.cbxSortBySetpointID.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||||
this.cbxSortBySetpointID.TabIndex = 11;
|
this.cbxSortBySetpointID.TabIndex = 11;
|
||||||
this.cbxSortBySetpointID.Text = "Sort By Sepoint ID";
|
this.cbxSortBySetpointID.Text = "Sort By Setpoint ID";
|
||||||
this.cbxSortBySetpointID.Visible = false;
|
this.cbxSortBySetpointID.Visible = false;
|
||||||
//
|
//
|
||||||
// DisplayReports
|
// DisplayReports
|
||||||
|
@@ -270,7 +270,7 @@ namespace Volian.Controls.Library
|
|||||||
this.cbxTranCategory.Name = "cbxTranCategory";
|
this.cbxTranCategory.Name = "cbxTranCategory";
|
||||||
this.cbxTranCategory.Size = new System.Drawing.Size(215, 21);
|
this.cbxTranCategory.Size = new System.Drawing.Size(215, 21);
|
||||||
this.cbxTranCategory.TabIndex = 1;
|
this.cbxTranCategory.TabIndex = 1;
|
||||||
this.cbxTranCategory.WatermarkText = "Select Cateogry of Transitions";
|
this.cbxTranCategory.WatermarkText = "Select Category of Transitions";
|
||||||
//
|
//
|
||||||
// lblTranCategory
|
// lblTranCategory
|
||||||
//
|
//
|
||||||
@@ -402,7 +402,7 @@ namespace Volian.Controls.Library
|
|||||||
this.cbxTranCategory.Name = "cbxTranCategory";
|
this.cbxTranCategory.Name = "cbxTranCategory";
|
||||||
this.cbxTranCategory.Size = new System.Drawing.Size(215, 21);
|
this.cbxTranCategory.Size = new System.Drawing.Size(215, 21);
|
||||||
this.cbxTranCategory.TabIndex = 1;
|
this.cbxTranCategory.TabIndex = 1;
|
||||||
this.cbxTranCategory.WatermarkText = "Select Cateogry of Transitions";
|
this.cbxTranCategory.WatermarkText = "Select Category of Transitions";
|
||||||
//
|
//
|
||||||
// lblTranCategory
|
// lblTranCategory
|
||||||
//
|
//
|
||||||
|
@@ -672,8 +672,10 @@ namespace Volian.Controls.Library
|
|||||||
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
if (_MyDisplayTabItems.ContainsKey(key) && pasteType != ItemInfo.EAddpingPart.Replace) // If procedure page open use it unless replace
|
||||||
{
|
{
|
||||||
DisplayTabItem pg = _MyDisplayTabItems[key];
|
DisplayTabItem pg = _MyDisplayTabItems[key];
|
||||||
|
// B2024-038: if section, refresh the editor even if the section is not expanded.
|
||||||
|
bool isSec = myItemInfo.IsSection;
|
||||||
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
if (pg.MyStepTabPanel.MyStepPanel._LookupEditItems.ContainsKey(myItemInfo.ItemID) &&
|
||||||
pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded)
|
(pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID].Expanded || isSec))
|
||||||
{
|
{
|
||||||
EditItem edtitm = pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID];
|
EditItem edtitm = pg.MyStepTabPanel.MyStepPanel._LookupEditItems[myItemInfo.ItemID];
|
||||||
switch (pasteType)
|
switch (pasteType)
|
||||||
@@ -710,7 +712,8 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
else if (_MyDisplayTabItems.ContainsKey(key) && pasteType == ItemInfo.EAddpingPart.Replace)
|
||||||
{
|
{
|
||||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
// B2024-038: changed tab key to procedure (was item, which caused crash if section)
|
||||||
|
CloseTabItem(_MyDisplayTabItems["Item - " + proc.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
||||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
return false; //B2017-179 PasteReplace will return null if was aborted
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@@ -103,7 +103,7 @@ namespace Volian.Controls.Library
|
|||||||
public string TbFSwd
|
public string TbFSwd
|
||||||
{
|
{
|
||||||
get {return tbFSWd.Text;}
|
get {return tbFSWd.Text;}
|
||||||
set { tbFSWd.Text = value; tbFSWd.Refresh(); trBarFS.Value = Convert.ToInt32(value); }
|
set { tbFSWd.Text = value; tbFSWd.Refresh(); } // trBarFS.Value = Convert.ToInt32(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string TbFSht
|
public string TbFSht
|
||||||
@@ -111,7 +111,7 @@ namespace Volian.Controls.Library
|
|||||||
get { return tbFSHt.Text; }
|
get { return tbFSHt.Text; }
|
||||||
set { tbFSHt.Text = value; tbFSHt.Refresh(); _origFigureSizeRatio = float.Parse(value) / float.Parse(tbFSWd.Text); }
|
set { tbFSHt.Text = value; tbFSHt.Refresh(); _origFigureSizeRatio = float.Parse(value) / float.Parse(tbFSWd.Text); }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor
|
#region Constructor
|
||||||
public DisplayTags()
|
public DisplayTags()
|
||||||
|
@@ -9,6 +9,7 @@ using System.Text.RegularExpressions;
|
|||||||
using VEPROMS.CSLA.Library;
|
using VEPROMS.CSLA.Library;
|
||||||
using Volian.Base.Library;
|
using Volian.Base.Library;
|
||||||
using JR.Utils.GUI.Forms;
|
using JR.Utils.GUI.Forms;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Volian.Controls.Library
|
namespace Volian.Controls.Library
|
||||||
{
|
{
|
||||||
@@ -285,7 +286,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public EditItem ActiveParent
|
public EditItem ActiveParent
|
||||||
{
|
{
|
||||||
get { return _MyParentEditItem != null ? _MyParentEditItem : _MyPreviousEditItem.ActiveParent; }
|
get { return _MyParentEditItem != null ? _MyParentEditItem : _MyPreviousEditItem?.ActiveParent; }
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return the Parent EditItem
|
/// Return the Parent EditItem
|
||||||
@@ -893,6 +894,18 @@ namespace Volian.Controls.Library
|
|||||||
b4topadjust -= newFocus.Top;
|
b4topadjust -= newFocus.Top;
|
||||||
TopMostYBefore -= b4topadjust;
|
TopMostYBefore -= b4topadjust;
|
||||||
|
|
||||||
|
//B2024-075: If Deleting an item in a Source Document that is unlinked
|
||||||
|
//and the overall procedure has connected Background Documents
|
||||||
|
//and a window is open containing the background documents
|
||||||
|
//then need to force a refresh on that window as
|
||||||
|
//step numbering will shift
|
||||||
|
EnhancedDocuments ProcEnh = MyItemInfo.MyProcedure.GetMyEnhancedDocuments();
|
||||||
|
if (ProcEnh.Count > 0)
|
||||||
|
{
|
||||||
|
DisplayTabItem wndowToRefresh = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items.Cast<DisplayTabItem>().FirstOrDefault(x => x.MyKey == $"Item - {ProcEnh[0].ItemID}");
|
||||||
|
wndowToRefresh?.MyStepTabPanel.MyStepPanel.Reset(wndowToRefresh.MyItemInfo);
|
||||||
|
}
|
||||||
|
|
||||||
//_MyTimer.ActiveProcess = "Dispose";
|
//_MyTimer.ActiveProcess = "Dispose";
|
||||||
Dispose();
|
Dispose();
|
||||||
//_MyTimer.ActiveProcess = "SetAllTabs";
|
//_MyTimer.ActiveProcess = "SetAllTabs";
|
||||||
@@ -1634,10 +1647,54 @@ namespace Volian.Controls.Library
|
|||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type));
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type));
|
||||||
|
|
||||||
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||||
ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Before, GetChangeId(MyItemInfo));
|
//if doing a paste before/after and item being copied is unlinked, item pasted should also be unlinked.
|
||||||
|
ItemInfo tmpCopyStartSourceItem = ItemInfo.Get(copyStartID);
|
||||||
|
ItemInfo newEnh = null;
|
||||||
|
if (tmpCopyStartSourceItem.GetMyEnhancedDocuments().Count > 0)
|
||||||
|
{
|
||||||
|
newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Before, GetChangeId(MyItemInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
//B2024-075: When doing Paste Before / After with Enhanced Documents only link from Background document to source was created
|
||||||
|
//since source is done first
|
||||||
|
//this is so that after the steps are created in the enhanced, go back and update the link in the source to point to the correct item
|
||||||
|
if (newEditItem != null && newEnh != null)
|
||||||
|
{
|
||||||
|
FixEnhanceLinkOnSource(newEditItem.MyItemInfo, newEnh, MyItemInfo.GetMyEnhancedDocuments());
|
||||||
|
}
|
||||||
|
else if (newEnh == null && newEditItem != null && newEditItem.MyItemInfo.IsEnhancedStep)
|
||||||
|
{
|
||||||
|
UnlinkEnhanced(newEditItem);
|
||||||
|
}
|
||||||
|
else if (newEnh == null && newEditItem != null)
|
||||||
|
{
|
||||||
|
//if did a paste before/after in a source document that contains enhanced steps
|
||||||
|
//but step being pasted was non-enhanced (unlinked)
|
||||||
|
//then look to see if the background page is open
|
||||||
|
//and if it is, do a refresh so that step numbers update appropriately
|
||||||
|
//without having to close and re-open the background steps
|
||||||
|
foreach (EnhancedDocument edSource in MyItemInfo.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||||
|
DisplayTabItem wndowToRefresh = newEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items.Cast<DisplayTabItem>().FirstOrDefault(x => x.MyKey == $"Item - {exEnh.MyProcedure.ItemID}");
|
||||||
|
wndowToRefresh?.MyStepTabPanel.MyStepPanel.Reset(wndowToRefresh.MyItemInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if enhanced items were created, then see if they need displayed:
|
// if enhanced items were created, then see if they need displayed:
|
||||||
if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo);
|
if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//B2024-075: When doing Paste Before / After with Enhanced Documents only link from Background document to source was created
|
||||||
|
//since source is done first
|
||||||
|
//this is so that after the steps are created in the enhanced, go back and update the link in the source to point to the correct item
|
||||||
|
//if enhanced document wasn't created then paste happened inside a enhanced Step/background step - so remove any links that shouldn't be there
|
||||||
|
//and don't have a corresponding spot in the Source
|
||||||
|
private void FixEnhanceLinkOnSource(ItemInfo SourceItem, ItemInfo newEnhItem, EnhancedDocuments enhancedDocuments)
|
||||||
|
{
|
||||||
|
if (enhancedDocuments.Count > 0)
|
||||||
|
CreateLinksEnhancedSingleItem(SourceItem, newEnhItem, enhancedDocuments[0].Type);
|
||||||
|
}
|
||||||
private void AddAllEnhancedItemsToDisplay(ItemInfo newItemInfo)
|
private void AddAllEnhancedItemsToDisplay(ItemInfo newItemInfo)
|
||||||
{
|
{
|
||||||
EnhancedDocuments eds = newItemInfo.GetMyEnhancedDocuments();
|
EnhancedDocuments eds = newItemInfo.GetMyEnhancedDocuments();
|
||||||
@@ -1684,12 +1741,15 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void UnlinkEnhanced(ItemInfo enhII)
|
public void UnlinkEnhanced(EditItem enhII)
|
||||||
{
|
{
|
||||||
// B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced
|
// B2022-049: Copy/paste of enhanced procedure and bad links between source and enhanced
|
||||||
// Pass in to unlink as before this change
|
// Pass in to unlink as before this change
|
||||||
enhII.DoUnlinkEnhanced(enhII, 0, false);
|
// B2024 - 075: Change made to pass in an EditTem instead of a ItemInfo
|
||||||
|
//so can refresh the UI
|
||||||
|
enhII.MyItemInfo.DoUnlinkEnhanced(enhII.MyItemInfo, 0, false);
|
||||||
SetFocus();
|
SetFocus();
|
||||||
|
enhII.MyStepPanel.Reset(enhII.MyItemInfo); //need to reset parts so refreshes display to show as unlinked
|
||||||
}
|
}
|
||||||
public ItemInfo AddMissingEnhancedStep(ItemInfo ii, int EnhType)
|
public ItemInfo AddMissingEnhancedStep(ItemInfo ii, int EnhType)
|
||||||
{
|
{
|
||||||
@@ -1753,7 +1813,42 @@ namespace Volian.Controls.Library
|
|||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type));
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type));
|
||||||
|
|
||||||
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
// MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced.
|
||||||
ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.After, GetChangeId(MyItemInfo));
|
//if doing a paste before/after and item being copied is unlinked, item pasted should also be unlinked.
|
||||||
|
ItemInfo tmpCopyStartSourceItem = ItemInfo.Get(copyStartID);
|
||||||
|
ItemInfo newEnh = null;
|
||||||
|
if (tmpCopyStartSourceItem.GetMyEnhancedDocuments().Count > 0)
|
||||||
|
{
|
||||||
|
newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.After, GetChangeId(MyItemInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
//B2024-075: When doing Paste Before / After with Enhanced Documents only link from Background document to source was created
|
||||||
|
//since source is done first
|
||||||
|
//this is so that after the steps are created in the enhanced, go back and update the link in the source to point to the correct item
|
||||||
|
//if enhanced document wasn't created then paste happened inside a enhanced Step/background step - so remove any links that shouldn't be there
|
||||||
|
//and don't have a cooresponding spot in the Source
|
||||||
|
if (newEditItem != null && newEnh != null)
|
||||||
|
{
|
||||||
|
FixEnhanceLinkOnSource(newEditItem.MyItemInfo, newEnh, MyItemInfo.GetMyEnhancedDocuments());
|
||||||
|
}
|
||||||
|
else if (newEnh == null && newEditItem != null && newEditItem.MyItemInfo.IsEnhancedStep)
|
||||||
|
{
|
||||||
|
UnlinkEnhanced(newEditItem);
|
||||||
|
}
|
||||||
|
else if (newEnh == null && newEditItem != null)
|
||||||
|
{
|
||||||
|
//if did a paste before/after in a source document that contains enhanced steps
|
||||||
|
//but step being pasted was non-enhanced (unlinked)
|
||||||
|
//then look to see if the background page is open
|
||||||
|
//and if it is, do a refresh so that step numbers update appropriately
|
||||||
|
//without having to close and re-open the background steps
|
||||||
|
foreach (EnhancedDocument edSource in MyItemInfo.GetMyEnhancedDocuments())
|
||||||
|
{
|
||||||
|
ItemInfo exEnh = ItemInfo.Get(edSource.ItemID);
|
||||||
|
DisplayTabItem wndowToRefresh = newEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items.Cast<DisplayTabItem>().FirstOrDefault(x => x.MyKey == $"Item - {exEnh.MyProcedure.ItemID}");
|
||||||
|
wndowToRefresh?.MyStepTabPanel.MyStepPanel.Reset(wndowToRefresh.MyItemInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo);
|
if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo);
|
||||||
}
|
}
|
||||||
public void PasteChild(int copyStartID)
|
public void PasteChild(int copyStartID)
|
||||||
@@ -1844,8 +1939,8 @@ namespace Volian.Controls.Library
|
|||||||
bool gotoFirstTrans = false;
|
bool gotoFirstTrans = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TreeNode treeNodeReplace = null;
|
// B2024-045, 049 and 050: do not pass in a tree node to Item.PasteReplace
|
||||||
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), treeNodeReplace, ref gotoFirstTrans);
|
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), ref gotoFirstTrans);
|
||||||
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
|
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
|
||||||
{
|
{
|
||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);
|
||||||
@@ -1944,7 +2039,8 @@ namespace Volian.Controls.Library
|
|||||||
sia.IdentifyChildren(highlight);
|
sia.IdentifyChildren(highlight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (MyBeforeEditItems != null)
|
// C2017-031: Support for paste/replace an enhanced step: don't identify/copy before items, i.e. notes/cautions
|
||||||
|
if (MyBeforeEditItems != null && !MyItemInfo.IsEnhancedStep)
|
||||||
{
|
{
|
||||||
foreach (EditItem sib in MyBeforeEditItems)
|
foreach (EditItem sib in MyBeforeEditItems)
|
||||||
{
|
{
|
||||||
|
@@ -256,7 +256,8 @@ namespace Volian.Controls.Library
|
|||||||
private int _origCfgHt = 0; // keep track if original size was stored in cfg
|
private int _origCfgHt = 0; // keep track if original size was stored in cfg
|
||||||
private int _origCfgWd = 0;
|
private int _origCfgWd = 0;
|
||||||
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
|
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
|
||||||
private DisplayTags _displayTags;
|
private DisplayTags _displayTags = new DisplayTags();
|
||||||
|
//House myhouse = new House();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@@ -316,8 +317,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
private void SetWidthsAndHeights(System.Drawing.Image img)
|
private void SetWidthsAndHeights(System.Drawing.Image img)
|
||||||
{
|
{
|
||||||
|
|
||||||
int wd = img.Width * MyStepPanel.DPI / 72; // converts from screen resolution's DPI to image's points (72/inch)
|
int wd = img.Width * MyStepPanel.DPI / 72; // converts from screen resolution's DPI to image's points (72/inch)
|
||||||
int ht = img.Height * MyStepPanel.DPI / 72;
|
int ht = img.Height * MyStepPanel.DPI / 72;
|
||||||
|
|
||||||
|
|
||||||
if (MyItemInfo.MyContent.MyImage != null) // image is null if creating new.
|
if (MyItemInfo.MyContent.MyImage != null) // image is null if creating new.
|
||||||
{
|
{
|
||||||
ImageConfig ic = new ImageConfig(MyItemInfo.MyContent.MyImage);
|
ImageConfig ic = new ImageConfig(MyItemInfo.MyContent.MyImage);
|
||||||
@@ -340,9 +344,9 @@ namespace Volian.Controls.Library
|
|||||||
_displayTags.TbFSwd = wd.ToString();
|
_displayTags.TbFSwd = wd.ToString();
|
||||||
_displayTags.TbFSht = ht.ToString();
|
_displayTags.TbFSht = ht.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// the following gets called for 'NEW' images
|
// the following gets called for 'NEW' images
|
||||||
private E_ImageSource InsType = E_ImageSource.None;
|
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, DisplayTags displayTags)
|
public ImageItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, ImageItem.E_ImageSource insType, DisplayTags displayTags)
|
||||||
|
BIN
PROMS/Volian.Controls.Library/RTBItem.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/RTBItem.designer.cs
generated
Binary file not shown.
@@ -1231,7 +1231,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public ItemSelectedChangedEventArgs(EditItem myEditItem)
|
public ItemSelectedChangedEventArgs(EditItem myEditItem)
|
||||||
{
|
{
|
||||||
_MyItemInfo = myEditItem.MyItemInfo;
|
_MyItemInfo = myEditItem?.MyItemInfo;
|
||||||
_MyEditItem = myEditItem;
|
_MyEditItem = myEditItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -485,6 +485,8 @@ namespace Volian.Controls.Library
|
|||||||
public void RefreshDisplay(bool activeMode)
|
public void RefreshDisplay(bool activeMode)
|
||||||
{
|
{
|
||||||
if (IsExperimenting) return;
|
if (IsExperimenting) return;
|
||||||
|
if (IsDisposed) return;
|
||||||
|
|
||||||
ActiveMode = activeMode;
|
ActiveMode = activeMode;
|
||||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
||||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 2");
|
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 2");
|
||||||
|
@@ -337,8 +337,10 @@ namespace Volian.Controls.Library
|
|||||||
else if (btn.Name.Contains("Unlink"))
|
else if (btn.Name.Contains("Unlink"))
|
||||||
{
|
{
|
||||||
// C2019=003: add a confirmation dialog before unlinking a step:
|
// C2019=003: add a confirmation dialog before unlinking a step:
|
||||||
|
// B2024 - 075: Change made to pass in an EditTem instead of a ItemInfo
|
||||||
|
//so can refresh the UI
|
||||||
if (FlexibleMessageBox.Show(this, "Do you want to unlink this step?", "Confirm Enhanced Step Unlink", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
if (FlexibleMessageBox.Show(this, "Do you want to unlink this step?", "Confirm Enhanced Step Unlink", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
MyEditItem.UnlinkEnhanced(MyEditItem.MyItemInfo);
|
MyEditItem.UnlinkEnhanced(MyEditItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1750,7 +1752,7 @@ namespace Volian.Controls.Library
|
|||||||
// note in follow if statements, 'setting' == false when in enhanced document:
|
// note in follow if statements, 'setting' == false when in enhanced document:
|
||||||
if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit
|
if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit
|
||||||
allowDel = true; // allow delete if not linked
|
allowDel = true; // allow delete if not linked
|
||||||
btnCpyStp.Enabled = setting;
|
btnCpyStp.Enabled = MyUserInfo.IsAllowedToEdit(Mydvi); // C2017-031: Support for paste/replace an enhanced step
|
||||||
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
||||||
StepTabPanel tmp = Parent as StepTabPanel;
|
StepTabPanel tmp = Parent as StepTabPanel;
|
||||||
//B2020-058: crash on null reference
|
//B2020-058: crash on null reference
|
||||||
@@ -1801,7 +1803,8 @@ namespace Volian.Controls.Library
|
|||||||
btnPasteAfter.Enabled = btnCMPasteAfter.Enabled = enable;
|
btnPasteAfter.Enabled = btnCMPasteAfter.Enabled = enable;
|
||||||
//B20170-158 Don't allow a step to replace a linked step
|
//B20170-158 Don't allow a step to replace a linked step
|
||||||
//B2017-180: The fix for B2017-158 also needed the 'HasEnhancedLinkedStep' to check if the copied step is a source step
|
//B2017-180: The fix for B2017-158 also needed the 'HasEnhancedLinkedStep' to check if the copied step is a source step
|
||||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && !MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep;
|
// C2017-031: Support for paste/replace an enhanced step, enable button
|
||||||
|
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && ((!MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep) || (MyItemInfo.IsEnhancedStep));
|
||||||
}
|
}
|
||||||
private void SetPasteButtonEnabled()
|
private void SetPasteButtonEnabled()
|
||||||
{
|
{
|
||||||
@@ -4110,9 +4113,19 @@ namespace Volian.Controls.Library
|
|||||||
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
||||||
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, true);
|
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, true);
|
||||||
EditItem oldEditItem = MyEditItem;
|
EditItem oldEditItem = MyEditItem;
|
||||||
|
// C2017-031: Support for paste/replace an enhanced step, if pasting an enhanced, remove its EditItem from the 'cache'. A new EditItem gets created during paste.
|
||||||
|
if (MyEditItem != null && MyEditItem.MyItemInfo.IsEnhancedStep) MyEditItem.MyStepPanel._LookupEditItems.Remove(MyEditItem.MyItemInfo.ItemID);
|
||||||
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||||
if (MyEditItem == null) oldEditItem.IdentifyMe(false); // B2017-179 if null then we didn't do the replace but did position to the first transition that needs resolved
|
if (MyEditItem == null) oldEditItem.IdentifyMe(false); // B2017-179 if null then we didn't do the replace but did position to the first transition that needs resolved
|
||||||
if (MyEditItem != null && MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) oldEditItem.Dispose();
|
// C2017-031: Support for paste/replace an enhanced step, add Dispose of old EditItem if enhanced
|
||||||
|
if (MyEditItem != null && ((MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) || MyEditItem.MyItemInfo.IsEnhancedStep))
|
||||||
|
oldEditItem.Dispose();
|
||||||
|
// C2017-031: Support for paste/replace an enhanced step, refresh ItemInfo's in user interface caches.
|
||||||
|
if (MyEditItem.MyItemInfo.IsEnhancedStep)
|
||||||
|
{
|
||||||
|
MyEditItem.MyItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||||
|
tmp.MyStepPanel.SelectedItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnPdfCreate_Click(object sender, EventArgs e)
|
private void btnPdfCreate_Click(object sender, EventArgs e)
|
||||||
|
@@ -1,36 +1,36 @@
|
|||||||
namespace Volian.Controls.Library
|
namespace Volian.Controls.Library
|
||||||
{
|
{
|
||||||
partial class vlnTreeView
|
partial class vlnTreeView
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required designer variable.
|
/// Required designer variable.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private System.ComponentModel.IContainer components = null;
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clean up any resources being used.
|
/// Clean up any resources being used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected void Dispose(bool disposing)
|
protected void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
}
|
}
|
||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Component Designer generated code
|
#region Component Designer generated code
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Required method for Designer support - do not modify
|
/// Required method for Designer support - do not modify
|
||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
components = new System.ComponentModel.Container();
|
components = new System.ComponentModel.Container();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,9 @@ namespace Volian.Controls.Library
|
|||||||
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
|
public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||||
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
|
public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args);
|
||||||
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
|
public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args);
|
||||||
|
|
||||||
public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args);
|
public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args);
|
||||||
|
public delegate bool vlnTreeViewItemInfoDeleteFolderEvent(object sender, vlnTreeFolderDeleteEventArgs args);
|
||||||
public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args);
|
public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args);
|
||||||
public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args);
|
public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args);
|
||||||
public delegate DialogResult vlnTreeViewPropertyEvent(object sender, vlnTreePropertyEventArgs args);
|
public delegate DialogResult vlnTreeViewPropertyEvent(object sender, vlnTreePropertyEventArgs args);
|
||||||
@@ -220,6 +222,15 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
public class vlnTreeFolderDeleteEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public int FolderId { get; }
|
||||||
|
|
||||||
|
public vlnTreeFolderDeleteEventArgs(int folderId)
|
||||||
|
{
|
||||||
|
FolderId = folderId;
|
||||||
|
}
|
||||||
|
}
|
||||||
public enum E_InsertType {Before, After, Child};
|
public enum E_InsertType {Before, After, Child};
|
||||||
public partial class vlnTreeItemInfoInsertEventArgs
|
public partial class vlnTreeItemInfoInsertEventArgs
|
||||||
{
|
{
|
||||||
@@ -427,6 +438,12 @@ namespace Volian.Controls.Library
|
|||||||
if (DeleteItemInfo != null) return DeleteItemInfo(sender, args);
|
if (DeleteItemInfo != null) return DeleteItemInfo(sender, args);
|
||||||
return false;
|
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;
|
public event vlnTreeViewItemInfoInsertEvent InsertItemInfo;
|
||||||
private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
|
private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -551,6 +568,11 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args);
|
if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public event vlnTreeViewEvent ExportImportProcedureSets;
|
public event vlnTreeViewEvent ExportImportProcedureSets;
|
||||||
private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args)
|
private void OnExportImportProcedureSets(object sender, vlnTreeEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -1059,6 +1081,11 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
#region Menu_Delete
|
#region Menu_Delete
|
||||||
if (ok)
|
if (ok)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Add delete to the menu unless at the very 'top' node, on a grouping (partinfo)
|
// 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.
|
// node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items.
|
||||||
@@ -1082,6 +1109,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
|
//_MyLog.WarnFormat("Context Menu 6 - {0}", GC.GetTotalMemory(true));
|
||||||
#region Menu_ExternalTransitions
|
#region Menu_ExternalTransitions
|
||||||
@@ -1712,10 +1740,13 @@ namespace Volian.Controls.Library
|
|||||||
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
|
// 1) 'to' & 'from' both 'non', i.e. Neither can have enhanced config data (be source or enhanced)
|
||||||
// can do Before/After/Replace
|
// can do Before/After/Replace
|
||||||
// 2) 'to' section is 'source' and 'from' section is 'non' (has no MyEnhancedDocuments)
|
// 2) 'to' section is 'source' and 'from' section is 'non' (has no MyEnhancedDocuments)
|
||||||
// can do Before/After - no links exist in pasted section.
|
// can do Before/After - no links exist in pasted section so cannot do Replace
|
||||||
// cannot do Replace
|
|
||||||
// 3) 'to' section is 'source' and 'from' section is same docversion 'source'
|
// 3) 'to' section is 'source' and 'from' section is same docversion 'source'
|
||||||
// can do Before/After/Replace
|
// can do Before/After (B2024-038 removes replace)
|
||||||
|
// 4) 'to' section is not 'source' and 'from' section is source
|
||||||
|
// can do Before/After but not replace - would have to manage
|
||||||
|
// links for 'from' section (B2024-038 added this case)
|
||||||
|
|
||||||
SectionConfig secToCfg = iiPasteHere.MyConfig as SectionConfig;
|
SectionConfig secToCfg = iiPasteHere.MyConfig as SectionConfig;
|
||||||
SectionConfig secFromCfg = iiClipboard.MyConfig as SectionConfig;
|
SectionConfig secFromCfg = iiClipboard.MyConfig as SectionConfig;
|
||||||
|
|
||||||
@@ -1724,13 +1755,22 @@ namespace Volian.Controls.Library
|
|||||||
bool secFromIsEnhanced = iiClipboard.IsEnhancedSection;
|
bool secFromIsEnhanced = iiClipboard.IsEnhancedSection;
|
||||||
bool secFromIsSource = secFromCfg.MyEnhancedDocuments != null && secFromCfg.MyEnhancedDocuments.Count > 0 && secFromCfg.MyEnhancedDocuments[0].Type != 0;
|
bool secFromIsSource = secFromCfg.MyEnhancedDocuments != null && secFromCfg.MyEnhancedDocuments.Count > 0 && secFromCfg.MyEnhancedDocuments[0].Type != 0;
|
||||||
bool secCanPaste = false;
|
bool secCanPaste = false;
|
||||||
if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1)
|
if (!secToIsEnhanced && !secToIsSource && !secFromIsEnhanced && !secFromIsSource) secCanPaste = true; // 1)
|
||||||
else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2)
|
else if (secToIsSource && !secFromIsEnhanced && !secFromIsSource) // 2)
|
||||||
{
|
{
|
||||||
secCanPaste = true;
|
secCanPaste = true;
|
||||||
okToReplace = false;
|
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)
|
||||||
|
okToReplace = false;
|
||||||
|
}
|
||||||
|
else if (!secToIsSource && secFromIsSource)
|
||||||
|
{
|
||||||
|
secCanPaste = true; // 4
|
||||||
|
okToReplace = false;
|
||||||
|
}
|
||||||
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
|
if (iiClipboard.IsRtfRaw) secCanPaste = okToReplace = false; // never paste an equation.
|
||||||
if (secCanPaste) cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click));
|
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));
|
if (okToReplace && secCanPaste) cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click));
|
||||||
@@ -1940,6 +1980,16 @@ namespace Volian.Controls.Library
|
|||||||
OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode));
|
OnPrintTransitionReport(this, new vlnTreeEventArgs(SelectedNode as VETreeNode));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
|
if (mi.Text == "Export Procedure Set" || mi.Text == "Export Procedure")
|
||||||
{
|
{
|
||||||
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
|
OnExportImportProcedureSets(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0));
|
||||||
@@ -2408,7 +2458,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
VETreeNode tn = SelectedNode as VETreeNode;
|
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;
|
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)
|
// Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section)
|
||||||
if (dvi != null)
|
if (dvi != null)
|
||||||
@@ -2445,11 +2495,27 @@ namespace Volian.Controls.Library
|
|||||||
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
||||||
else if (p.IndexOf("Replace") > -1)
|
else if (p.IndexOf("Replace") > -1)
|
||||||
{
|
{
|
||||||
PasteReplace(tn, iiClipboard.ItemID, treeNodeReplace);
|
bool OnlyProc = iiPaste.IsProcedure && iiPaste.MyPrevious == null && (iiPaste.NextItems == null || iiPaste.NextItems.Count == 0);
|
||||||
|
VETreeNode tmp = null;
|
||||||
|
if (OnlyProc)
|
||||||
|
{
|
||||||
|
VETreeNode tnp = SelectedNode as VETreeNode;
|
||||||
|
tmp = tnp == null ? null : tnp.Parent as VETreeNode;
|
||||||
|
}
|
||||||
|
ItemInfo repitem = PasteReplace(tn, iiClipboard.ItemID);
|
||||||
|
// B2024-045, 049 and 050: The treenode was passed into the business object's replace but sometimes it was null. And this
|
||||||
|
// wasn't working if it was a single procedure in a working Draft. Adjust the tree here if single procedure in working draft.
|
||||||
|
if (OnlyProc && repitem != null && tmp != null)
|
||||||
|
{
|
||||||
|
VETreeNode tn1 = new VETreeNode(repitem);
|
||||||
|
tmp.Nodes.Add(tn1);
|
||||||
|
SelectedNode = tn1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else // paste as child
|
else // paste as child
|
||||||
PasteAsChild(tn, iiClipboard.ItemID);
|
PasteAsChild(tn, iiClipboard.ItemID);
|
||||||
|
|
||||||
|
|
||||||
//if (p.IndexOf("Replace") <= -1)
|
//if (p.IndexOf("Replace") <= -1)
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
@@ -2541,18 +2607,19 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
||||||
}
|
}
|
||||||
private void PasteReplace(VETreeNode tn, int copyStartID, TreeNode treeNodeReplace)
|
private ItemInfo PasteReplace(VETreeNode tn, int copyStartID)
|
||||||
{
|
{
|
||||||
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
|
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
|
||||||
VETreeNode partn = (VETreeNode) tn.Parent;
|
VETreeNode partn = (VETreeNode) tn.Parent;
|
||||||
ItemInfo ii = tn.VEObject as ItemInfo;
|
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
|
// 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);
|
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true);
|
||||||
|
ItemInfo replItemInfo = null;
|
||||||
if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type)))
|
if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type)))
|
||||||
{
|
{
|
||||||
// first, check if a changeid is required.
|
// first, check if a changeid is required.
|
||||||
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
|
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
|
||||||
ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID, chgId, treeNodeReplace);
|
replItemInfo = Item.PasteReplace(ii, copyStartID, chgId);
|
||||||
|
|
||||||
StepConfig replItemConfig = ii.MyConfig as StepConfig;
|
StepConfig replItemConfig = ii.MyConfig as StepConfig;
|
||||||
if (replItemInfo != null)
|
if (replItemInfo != null)
|
||||||
@@ -2562,8 +2629,8 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
// 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)
|
// 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;
|
SelectedNode = prevtn != null ? prevtn.NextNode : partn.FirstNode;
|
||||||
|
return replItemInfo;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public void PasteRepalceEmpty(VETreeNode tn, int copyStartID)
|
public void PasteRepalceEmpty(VETreeNode tn, int copyStartID)
|
||||||
{
|
{
|
||||||
@@ -3567,6 +3634,41 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return false;
|
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)
|
private bool DeleteItemInfoAndChildren(ItemInfo ii)
|
||||||
{
|
{
|
||||||
DateTime dtStart = DateTime.Now;
|
DateTime dtStart = DateTime.Now;
|
||||||
|
@@ -138,6 +138,15 @@ namespace Volian.Print.Library
|
|||||||
get { return _Prefix; }
|
get { return _Prefix; }
|
||||||
set { _Prefix = value; }
|
set { _Prefix = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// B2024-062 Set to true when the procedure being printed has no content.
|
||||||
|
// When set to true, will prevent the "Try Again" dialog from appearing
|
||||||
|
// and simply exit the print function
|
||||||
|
private bool _EmptyProcedure = false;
|
||||||
|
public bool EmptyProcedure
|
||||||
|
{
|
||||||
|
get { return _EmptyProcedure; }
|
||||||
|
}
|
||||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
public event PromsPrinterStatusEvent StatusChanged;
|
public event PromsPrinterStatusEvent StatusChanged;
|
||||||
internal void OnStatusChanged(object sender, PromsPrintStatusArgs args)
|
internal void OnStatusChanged(object sender, PromsPrintStatusArgs args)
|
||||||
@@ -933,6 +942,9 @@ namespace Volian.Print.Library
|
|||||||
{
|
{
|
||||||
MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
ProfileTimer.Pop(profileDepth);
|
ProfileTimer.Pop(profileDepth);
|
||||||
|
// B2024-062 Added check for EmptyProcedure. This is to prevent the Try Again message
|
||||||
|
// from appearing after the user clicks on the OK button from the Empty Procedure message
|
||||||
|
_EmptyProcedure = true;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);
|
OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);
|
||||||
|
Reference in New Issue
Block a user