DateTime startDate;
DateTime endDate;
bool isStartValid = DateTime.TryParseExact(
lblstartdate.Text,
"dd/MM/yyyy",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out startDate);
bool isEndValid = DateTime.TryParseExact(
lblenddate.Text,
"dd/MM/yyyy",
CultureInfo.InvariantCulture,
DateTimeStyles.None,
out endDate);
if (isStartValid && isEndValid)
{
DateTime currentDate = DateTime.Today;
if (currentDate >= startDate && currentDate <= endDate)
{
lnkEdit.Visible = true; // show offer button
}
else
{
lnkEdit.Visible = true; // hide offer button
}
}
No comments:
Post a Comment