///
///
///
///
///
private bool CheckDate(int Year,int Month,int Day)
{
if (Year.ToString() != "" && Month.ToString() != "" && Day.ToString() != "")
{
try
{
if(Month>12 || Month<1)
{
this.PopupWin_Message.Visible = true;
this.PopupWin_Message.Title = "信息提示";
this.PopupWin_Message.Message = "您填入的时间有误,请重新填写!";
this.PopupWin_Message.Text = "您填入的时间有误,请重新填写!";
return false;
}
if((Month==1||Month==3||Month==5||Month==7||Month==8||Month==10||Month==12)&&(Day>31||Day<1))
{
this.PopupWin_Message.Visible = true;
this.PopupWin_Message.Title = "信息提示";
this.PopupWin_Message.Message = "您填入的时间有误,请重新填写!";
this.PopupWin_Message.Text = "您填入的时间有误,请重新填写!";
return false;
}
if((Month==4||Month==6||Month==9||Month==11)&&(Day>30||Day<1))
{
this.PopupWin_Message.Visible = true;
this.PopupWin_Message.Title = "信息提示";
this.PopupWin_Message.Message = "您填入的时间有误,请重新填写!";
this.PopupWin_Message.Text = "您填入的时间有误,请重新填写!";
return false;
}
if(Month==2)
{
if(Day<1)
{
this.PopupWin_Message.Visible = true;
this.PopupWin_Message.Title = "信息提示";
this.PopupWin_Message.Message = "您填入的时间有误,请重新填写!";
this.PopupWin_Message.Text = "您填入的时间有误,请重新填写!";
return false;
}
if(DateTime.IsLeapYear(Year))
{
if(Day>29)
{
this.PopupWin_Message.Visible = true;
this.PopupWin_Message.Title = "信息提示";
this.PopupWin_Message.Message = "您填入的时间有误,请重新填写!";
this.PopupWin_Message.Text = "您填入的时间有误,请重新填写!";
return false;
}
}
else
{
if(Day>28)
{
this.PopupWin_Message.Visible = true;
this.PopupWin_Message.Title = "信息提示";
this.PopupWin_Message.Message = "您填入的时间有误,请重新填写!";
this.PopupWin_Message.Text = "您填入的时间有误,请重新填写!";
return false;
}
}
}
return true;
}
catch(Exception e)
{
e.ToString();
return false;
}
}
else
{
return false;
}
}