Compare commits

...

7 Commits

Author SHA1 Message Date
6128632186 B2024-063-Invalid-Format-message-box-displays-when-rev-date-empty 2024-08-27 10:58:04 -04:00
5db6a984f3 B2024-063-Invalid-Format-message-box-displays-when-rev-date-empty 2024-08-27 09:17:32 -04:00
a43e059733 Merge pull request 'F2024-070 - Add “DEVIATION:” to the enhanced background template after “KNOWLOEDGE/ABILITY”' (#395) from F2024-070_Catawba into Development
Format only change. ready for testing phase.
2024-08-22 11:26:17 -04:00
0ac79f4e46 F2024-070 - Add “DEVIATION:” to the enhanced background template after “KNOWLOEDGE/ABILITY” 2024-08-22 11:24:17 -04:00
218a2c17a2 Merge pull request 'B2024-061- Added a null reference check in the save annotation code. Need for when Admin deletes the annotation while a user modified the text of it' (#394) from B2024-061 into Development
null reference check added to the code, tested locally before uploading
2024-08-21 11:45:10 -04:00
a629f6834b B2024-061- Added a null reference check in the save annotation code. Need for when Admin deletes the annotation while a user modified the text of it 2024-08-21 11:37:37 -04:00
bf5337cf63 B2024-062 printing a procedure that is empty displays the Empty Procedure message. WhenOK button is clicked, PROMS will exit the Print function.. (#393)
B2024-062
When you attempt to print a procedure that is empty (i.e. none of the sections are applicable to the selected Child to print), the Empty Procedure message appears. When you click the OK button PROMS will now simply exit the Print function instead of displaying the “Try Again” message box.

Reviewed-on: #393
Reviewed-by: Paul Larsen <plarsen@volian.com>
Co-authored-by: John Jenko <jjenko@volian.com>
Co-committed-by: John Jenko <jjenko@volian.com>
2024-08-20 12:25:42 -04:00
5 changed files with 43 additions and 17 deletions

Binary file not shown.

View File

@@ -1206,20 +1206,28 @@ namespace VEPROMS
private bool validateDate(TextBox txtDate)
{
DateTime dDate;
if (DateTime.TryParse(txtDate.Text, out dDate))
if (!(txtDate.Text == ""))
{
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;
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)
{
txbDate = txbRevDate;

View File

@@ -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)

View File

@@ -674,12 +674,15 @@ namespace Volian.Controls.Library
{
using (Annotation annotation = CurrentAnnotation.Get())
{
annotation.RtfText = rtxbComment.Rtf;
annotation.SearchText = rtxbComment.Text;
annotation.MyAnnotationType = annotationType;
annotation.DTS = DateTime.Now;
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
annotation.Save();
if (annotation != null) // B2024-061 check for null reference
{
annotation.RtfText = rtxbComment.Rtf;
annotation.SearchText = rtxbComment.Text;
annotation.MyAnnotationType = annotationType;
annotation.DTS = DateTime.Now;
annotation.UserID = Volian.Base.Library.VlnSettings.UserID;
annotation.Save();
}
}
}
}

View File

@@ -138,6 +138,15 @@ namespace Volian.Print.Library
get { return _Prefix; }
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);
public event PromsPrinterStatusEvent StatusChanged;
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);
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;
}
OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count);