B2024-058-RevisionDate-field-Print-dialog #390
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user