B2024-058-RevisionDate-field-Print-dialog

This commit is contained in:
2024-08-08 09:27:27 -04:00
parent cf69aa93e6
commit 4248d40917
2 changed files with 61 additions and 20 deletions

View File

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