string beginDate="2007-1-1";
string endDate="2008-12-31";
//合同期限(月)=合同结束日期-合同开始日期
TimeSpan dt1 = new TimeSpan(Convert.ToDateTime(beginDate).Ticks);
TimeSpan dt2 = new TimeSpan(Convert.ToDateTime(endDate).Ticks);
TimeSpan dt = dt2.Subtract(dt1).Duration();
//string contractTerm = dt.Days.ToString();
int ICount = dt.Days / 30;
string contractTerm = ICount.ToString();