using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace EMIS.Utility { public static class PlanningGraduateDateHelper { public static DateTime GetPlanningGraduateDate(DateTime schoolYear) { if (schoolYear.Month >= 1 && schoolYear.Month <= 6) { int month = Convert.ToInt32(EMIS.Utility.Const.LOCAL_SETTING_PlanningGraduateDateAutumnMonth); int day = Convert.ToInt32(EMIS.Utility.Const.LOCAL_SETTING_PlanningGraduateDateAutumnDay); return new DateTime(schoolYear.Year, month, day); } else { int month=Convert.ToInt32(EMIS.Utility.Const.LOCAL_SETTING_PlanningGraduateDateSpringMonth); int day=Convert.ToInt32( EMIS.Utility.Const.LOCAL_SETTING_PlanningGraduateDateSpringDay); return new DateTime((schoolYear.Year + 1), month, day); } //dt = dt + new TimeSpan((schoolYear.WeeksNum - 1) * 7, 0, 0, 0); //DateTime dtime = dt.AddDays((int)dt.DayOfWeek - 1); // return dtime; } } }