B2024-063-Invalid-Format-message-box-displays-when-rev-date-empty
This commit is contained in:
parent
a43e059733
commit
5db6a984f3
@ -1206,18 +1206,23 @@ 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user