public Class maday
{
private int _Year;
private int _Month;
private int _Day;
public maday(int paraYear,int paraMonth,int paramDay)
{
_Year=paramYear;
_Month=paraMonth;
_Day=paraDay;
}
public int Day
{
get{return _Day;}
set{_Day=value;}
}
public int Month
{
get{return _Month;}
get{_Month=value;}
}
public int Year
{
get{return _Year;}
get{_Year=value;}
}
public DateTime YearMonthDay
{
get
{
return Convert.ToDateTime(_Year.ToString()+"-"+_Month.ToString()+"-"+_Day.ToString());
}
}
public void AddDays(int paraDays)
{
DateTime _DT;
_DT=Convert.ToDateTime(_Year.ToString()+"-"+_Month.ToString()+"-"+_Day.ToString());
_DT=_DT.AddDays(paraDays);
_year=_DT.Year;
_Month=_DT.Month;
_Day=_DT.Day;
}
public void AddMonths(int paraMonths)
{
DateTime _DT;
_DT=Convert.ToDateTime(_Year.ToString()+"-"+_Month.ToString()+"-"+_Day.ToString());
_DT=_DT.AddMonths(paramMonths);
_Year=_DT.Year;
_Month=_DT.Month;
_Day=_DT.Day;
}
public void AddYears(int paramYears)
{
DateTime _DT;
_DT=Convert.ToDateTime(_Year.ToString()+"-"+_Month.ToString()+"-"+_Day.ToString());
_DT=_DT.AddYears(paramYears);
_Year=_DT.Year;
_Month=_DT.Month;
_Day=_DT.Day;
}
}