From 4248d4091747af08d96db44e8303b538f4a27cce Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 8 Aug 2024 09:27:27 -0400 Subject: [PATCH 1/5] B2024-058-RevisionDate-field-Print-dialog --- .../DlgPrintProcedure.Designer.cs | 36 +++++++-------- .../DlgPrintProcedure.cs | 45 ++++++++++++++++++- 2 files changed, 61 insertions(+), 20 deletions(-) diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs index 5ddc7657..074597fe 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs @@ -97,12 +97,12 @@ namespace VEPROMS this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter(); this.panelEx2 = new DevComponents.DotNetBar.PanelEx(); this.groupPag = new DevComponents.DotNetBar.Controls.GroupPanel(); + this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox(); this.expPrnSetting = new DevComponents.DotNetBar.ExpandablePanel(); this.ppGpDuplex = new DevComponents.DotNetBar.Controls.GroupPanel(); this.tbBlankPage = new DevComponents.DotNetBar.Controls.TextBoxX(); this.lblBlPg = new DevComponents.DotNetBar.LabelX(); this.swtbtnPDFdtPrefixSuffix = new DevComponents.DotNetBar.Controls.SwitchButton(); - this.cbxGenerateTimeCritActSum = new System.Windows.Forms.CheckBox(); this.gpnlDebug.SuspendLayout(); this.grpDateSelector.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit(); @@ -1285,6 +1285,23 @@ namespace VEPROMS this.groupPag.TabIndex = 111; 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 // this.expPrnSetting.CanvasColor = System.Drawing.SystemColors.Control; @@ -1421,23 +1438,6 @@ namespace VEPROMS this.swtbtnPDFdtPrefixSuffix.TabIndex = 111; 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 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 101cbd55..9ca360ef 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -1193,14 +1193,54 @@ namespace VEPROMS if (_Initializing) return; ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef; } + + private bool validateDate(string txtDate) + { + DateTime dDate; + if (DateTime.TryParse(txbDate.Text, out dDate)) + { + return true; + } + else + { + string txtDate2 = txbDate.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; + } + } + private void txbRevDate_Enter(object sender, EventArgs e) { txbDate = txbRevDate; grpDateSelector.Text = "Select Revision Date"; grpDateSelector.Visible = calDateSelector.Visible = true; //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; - calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate; + DateTime dDate; + //if (DateTime.TryParse(txbDate.Text, out dDate)) + //{ + // DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today; + // calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate; + //} + //else + //{ + // string txtDate = txbDate.Text; + // string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate); + // string txtTitle = "Invalid Format"; + // MessageBox.Show(message, txtTitle); + // txbRevDate.Focus(); + //} + if (!validateDate(txbDate.Text)) + { + txbRevDate.Focus(); + } + } + + private void txbRevDate_Validating(object sender, EventArgs e) + { + string x = ""; + x = "this is it"; } private void txbRevDate_Leave(object sender, EventArgs e) @@ -1375,6 +1415,7 @@ namespace VEPROMS _NewRevForAllProcs = null; } + //private void cbxDebug_CheckedChanged(object sender, EventArgs e) //{ // cbxCmpPRMSpfd.Visible = cbxDebug.Checked; -- 2.47.2 From d7f829737aa39fd770ac1b737e62a8d0c0586150 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Thu, 8 Aug 2024 15:21:11 -0400 Subject: [PATCH 2/5] B2024-058-RevisionDate-field-Print-dialog --- PROMS/VEPROMS User Interface/DlgPrintProcedure.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 9ca360ef..047f1dee 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -1235,6 +1235,11 @@ namespace VEPROMS { 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_Validating(object sender, EventArgs e) -- 2.47.2 From 4bf42be80a393ec624edd0086796ebcea9e6d490 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 13 Aug 2024 10:05:05 -0400 Subject: [PATCH 3/5] B2024-058-RevisionDate-field-Print-dialog --- .../VEPROMS User Interface/DlgPrintProcedure.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 047f1dee..89a0769c 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -1096,6 +1096,14 @@ namespace VEPROMS } private void btnCreatePDF_Click(object sender, EventArgs e) { + if (txbRevDate.Visible) + { + if (!validateDate(txbRevDate)) + { + //txbRevDate.Focus(); + return; + } + } DoCreatePDF(); } @@ -1194,16 +1202,16 @@ namespace VEPROMS ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef; } - private bool validateDate(string txtDate) + private bool validateDate(TextBox txtDate) { DateTime dDate; - if (DateTime.TryParse(txbDate.Text, out dDate)) + if (DateTime.TryParse(txtDate.Text, out dDate)) { return true; } else { - string txtDate2 = txbDate.Text; + 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); @@ -1231,7 +1239,7 @@ namespace VEPROMS // MessageBox.Show(message, txtTitle); // txbRevDate.Focus(); //} - if (!validateDate(txbDate.Text)) + if (!validateDate(txbDate)) { txbRevDate.Focus(); } -- 2.47.2 From 0eadd3fe33f21df94c17e1e4bfa43ee5c2e94a9e Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Tue, 13 Aug 2024 14:01:38 -0400 Subject: [PATCH 4/5] B2024-058-RevisionDate-field-Print-dialog --- PROMS/VEPROMS User Interface/DlgPrintProcedure.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 89a0769c..5e6a2ec0 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -1226,19 +1226,6 @@ namespace VEPROMS grpDateSelector.Visible = calDateSelector.Visible = true; //C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date DateTime dDate; - //if (DateTime.TryParse(txbDate.Text, out dDate)) - //{ - // DateTime initSelDate = (txbDate.Text != null && txbDate.Text.Length != 0) ? Convert.ToDateTime(txbDate.Text) : DateTime.Today; - // calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate; - //} - //else - //{ - // string txtDate = txbDate.Text; - // string message = String.Format("Date {0} in wrong format" + System.Environment.NewLine + "Correct the revision date.", txtDate); - // string txtTitle = "Invalid Format"; - // MessageBox.Show(message, txtTitle); - // txbRevDate.Focus(); - //} if (!validateDate(txbDate)) { txbRevDate.Focus(); -- 2.47.2 From 3f3281e2f44b641004f4a42d189d3097377433d9 Mon Sep 17 00:00:00 2001 From: Paul Larsen Date: Wed, 14 Aug 2024 09:37:26 -0400 Subject: [PATCH 5/5] B2024-058-RevisionDate-field-Print-dialog --- PROMS/VEPROMS User Interface/DlgPrintProcedure.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs index 5e6a2ec0..aaf2fab9 100644 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs +++ b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs @@ -1096,6 +1096,7 @@ namespace VEPROMS } 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)) @@ -1201,7 +1202,7 @@ namespace VEPROMS if (_Initializing) return; 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; @@ -1226,6 +1227,7 @@ namespace VEPROMS grpDateSelector.Visible = calDateSelector.Visible = true; //C2021-007 position the calendar to the current RevDate or if no RevDate, position to today's date DateTime dDate; + // B2024-058 Add validation for Revision Date field of the Print dialog if (!validateDate(txbDate)) { txbRevDate.Focus(); @@ -1236,13 +1238,6 @@ namespace VEPROMS calDateSelector.DisplayMonth = calDateSelector.SelectedDate = initSelDate; } } - - private void txbRevDate_Validating(object sender, EventArgs e) - { - string x = ""; - x = "this is it"; - } - private void txbRevDate_Leave(object sender, EventArgs e) { if (_Initializing) return; -- 2.47.2