Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 23, 2012 09:59 PM by oned_gk
Nov 23, 2012 07:37 PM|LINK
My apologies if this has been asked and please point me in the right direction if so.
I need to add code where enterDate cannot be greater than currentDate, then validate, "future date cannot be entered". My code is all under the public bool Save() but did not think I needed to create a constructor to add some Datetime code.
Public Bool Save()
....Existing code here....
ValidationResults results = new
ValidationResults(); //this was already used in
a prior code under public bool Save() so I reuse below
DateTime? enterDate = tbEnterDate.NullableDate;
DateTime? CurrentDate = DateTime.Today;
if (enterDate > CurrentDate)
ValidationResult vr2 =
date cannot be entered"); //ValidationResult vr1 has already been used.
if (enterDate ==
Error points to my ValidationResult. Do I need create a whole new validation for this? Thank you.
Nov 23, 2012 09:59 PM|LINK