我想从DateTime计算返回布尔值,但行函数EnableEdit(Datetime URD)System.Datetime中的错误并非所有路径都返回一个值.在这里我的代码
public static int DayAfterReg(DateTime URD) {
int totalDay = (int)(URD - DateTime.Now).TotalDays;
return totalDay;
}
public static Boolean EnableEdit(DateTime URD)
{
if (UserClass.DayAfterReg(URD)<=3){
return true;
}
else if (UserClass.DayAfterReg(URD) >3)
{
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
怎么解决?