Source code quote in C#n° 116
21 August, 2014 at 05:14
/// <summary>
/// We want to check if record date is proper.
/// </summary>
/// <returns>TRUE if Ok.</returns>
public bool IsRecordDateIsOk()
{
int act, min, max;
/* We compare only the date, not the time */
act = System.DateTime.Now.Year * 10000 + System.DateTime.Now.Month * 100 + System.DateTime.Now.Day;
min = this.recordDate.Year * 10000 + this.recordDate.Month * 100 + this.recordDate.Day;
max = this.dateMax.Year * 10000 + this.dateMax.Month * 100 + this.dateMax.Day;
if ((min <= act) && (act <= max))
{
return (true);
}
else
{
return (false);
}
}